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.3.1

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.3.1
File Size Uploaded
ndspec-0.3.1.tar.gz 34.3 MB Details

Built distribution (wheel)

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

Total release size: 69.0 MB

Release files / ndspec-0.3.1.tar.gz

Download URL ndspec-0.3.1.tar.gz
Size 34.3 MB
Tags Source
SHA-256 checksum
How to use checksums
b05c45b14c6f8d36d559f322821a222bebc7a4a16ec271d7383c531aee4ea3c8
BLAKE2b-256 checksum
How to use checksums
776daa81aed08e3c8e3b6b60db26556dc58f01ad130ffb43d5d4f5c94d0bdf15
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 10, 2026.

Transparency log

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

Download URL ndspec-0.3.1-py3-none-any.whl
Size 34.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
39008df9edaa8e47f572f4cd05324d6d7d790ae36d5a2971e62581777c09c8b5
BLAKE2b-256 checksum
How to use checksums
57132dc647f525247dc571c06c8e19cdab898331f9241d041c52dec2b68fcf7b
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 10, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.0

2 release files

This release

0.3.1 This release

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