Skip to main content

Docs

Multi-dimensional X-ray data modelling in Python

nDspec is a software package designed to model (primarly) X-ray astronomical data; in particular, it is meant to enable users to fit spectral, timing and (in the future) polarimetric data natively. Currently, nDspec provides the following features:

  • a class to handle folding an energy-dependent model through a given X-ray instrument response matrix. We currently support existing and legacy missions (Swift/XRT, RXTE, NuSTAR, Nicer, XMM-Newton); next-generation missions like XRISM and Athena are not supported yet.

  • Classes to handle the standard spectral-timing data products (power spectra, two-dimensional cross spectra, as well as their one-dimensional projections like lag-frequency spectra). Models need to be defined by the user either in the time domain (ie, an impulse response function) or in the Fourier domain (ie, a transfer functions). Additive models can be combined by the users before computing a given Fourier product.

  • a small library of phenomenological spectral-timing models, currently including a one dimensional power-law, black body and gaussian, as well as example impulse response and/or transfer functions that parametrize the time dependence of these components.

The goal of the software is to provide users with an Xspec-like package, but to move beyond simple one-dimensional spectral fitting, which typically has relied on each group utilizing their own custom software. Being an open-source modular package, unlike legacy software nDspec allows users to interface with data science libraries for model handling or fitting.

Documentation

The software documentation, including installation instructions, tutorials, and the full API, is found on readthedocs. You can also find notebooks discussing the features of each class in the /notebooks/ folder.

Installation and testing

The stable version of the software can be installed via pip; if you want to use (or contribute to!) features that are still in-developement, you should install the software directly from the repository. Unit tests make use of py.test. Running the unit tests simply requires opening the folder in which users downloaded the repository, and running the command pytest in the command line.

Contributing

nDspec is a fully open source software, so we welcome your contribution and feedback! The best way to contact the developers is through the issues page - even a simple comment on what you find useful or intuitive (or vice versa) goes a long way in helping the project. If you would like to contribute a piece of code, you are welcome to do so either by opening an issue or submitting a pull request. Before you do so, you should read the code of conduct and coding conventions.

Citing

The initial release paper is not released yet; until then, please refer to this repository if you make use of the software in your work.

License

All content © 2023 The Authors. The code is distributed under the MIT license; see LICENSE for details.

Metadata

Release files for ndspec 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ndspec 0.4.0
File Size Uploaded
ndspec-0.4.0.tar.gz 34.7 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for ndspec 0.4.0
File Interpreter ABI Platform
ndspec-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 69.8 MB

Release files / ndspec-0.4.0.tar.gz

Download URL ndspec-0.4.0.tar.gz
Size 34.7 MB
Tags Source
SHA-256 checksum
How to use checksums
f33a56058ebe88265eae62b9ebc2837d59713581fb6671d1ec2dfe255f93429f
BLAKE2b-256 checksum
How to use checksums
74b59127d7a27a211525cfd02e835fd465f831daa0169589a96f22cd7fc66e4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.

Transparency log

Release files / ndspec-0.4.0-py3-none-any.whl

Download URL ndspec-0.4.0-py3-none-any.whl
Size 35.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b5fbcf5431218b7589e0a2609cce4bb224e693d46fae02a601acfc14e2bbe85a
BLAKE2b-256 checksum
How to use checksums
b6600470715f422a94137b1a1adb0cd200a301c4c30e54da817e7da881b64b7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.1

2 release files

0.3.0

1 release file

0.2.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page