Skip to main content

Deproject is a Sherpa extension package to facilitate deprojection of two-dimensional annular X-ray spectra to recover the three-dimensional source properties. For typical thermal models this would include the radial temperature and density profiles. This basic method has been used extensively for X-ray cluster analysis and is the basis for the XSPEC model projct. The deproject module brings this functionality to Sherpa as a Python module that is straightforward to use and understand.

The basic physical assumption of deproject is that the extended source emissivity is constant and optically thin within spherical shells whose radii correspond to the annuli used to extract the specta. Given this assumption one constructs a model for each annular spectrum that is a linear volume-weighted combination of shell models.

Version 0.2 of deproject is limited to circular annuli.

Further documentation is available at https://deproject.readthedocs.io/

License

The deproject module is released under the BSD 2-Clause license, available as the file LICENSE in the source distribution.

Requirements

The installation assumes that you are installing deproject into the CIAO environment (CIAO 4.11 or later), since this is the easiest way to get the XSPEC models along with Sherpa. The standalone Sherpa version can be used, but in this case you will need to build Sherpa with XSPEC support.

The following Python packages are required:

  • sherpa

  • Astropy (restricted to version 3.0 when using CIAO 4.11)

  • SciPy.

Installation

The deproject module should install with the following command (assuming CIAO 4.11 is already installed):

echo “numpy==1.12.1” > constraints.txt pip install -c constraints.txt ‘astropy<3.1’ deproject

Example

If you have a set of X-ray PHA spectra called src<n>.pi, where <n> is an integer representing the annulus number, and the files contain the XFLT0001 to XFLT0005 header keywords used by the XSPEC projct model, then a Deproject object can be created using the deproject_from_xflt helper routine with the commands:

>>> from deproject import deproject_from_xflt
>>> from astropy import units as u
>>> dep = deproject_from_xflt('src*.pi', 0.492 * u.arcsec)

where, in this example, the XFLT0001 and XFLT0002 keywords, which specify the inner and outer radii of the annulus, are in ACIS pixels, and so need to be multiplied by 0.492 arcseconds to convert to an angle (the second parameter).

This will automatically load the spectra into separate Sherpa datasets, which can be fitted individually, but it is generally easier to use the object returned by deproject_from_xflt. For instance, the following will set the data range to be fit for each spectra and ensure that the background is subtracted before fitting:

>>> dep.ignore(None, 0.5)
>>> dep.ignore(7.0, None)
>>> dep.subtract()

Sherpa functions are used to change the statistic and optimiser:

>>> from sherpa.astro import ui
>>> ui.set_stat('chi2xspecvar')
>>> ui.set_method('levmar')

The data can be fit, and errors estimated for all the parameter, using the onion-skin deprojection approach, with the following commands:

>>> onion = dep.fit()
>>> errs = dep.conf()

The return value includes the density (and errors, if appropriate), as an Astropy Quantity.

>>> print(onion['density'])
print(onion['density'])
      density
      1 / cm3
--------------------
  0.1100953546292787
 0.07736622021374819
 0.04164827967805805
 0.03630168106524076
0.025221797991301052
0.021845331641349316
                 ...
0.012396857131392835
 0.01336640115325031
0.012303975980575187
0.013631563529090736
0.013996131292837352
0.010843683594144967
0.023067220584935984
Length = 20 rows

The on-line documentation contains more information, including creating the Deproject object directly (without the need for the XFLTxxxx keywords).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deproject-0.2.0.tar.gz (33.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deproject-0.2.0-py3-none-any.whl (33.2 kB view details)

Uploaded Python 3

File details

Details for the file deproject-0.2.0.tar.gz.

File metadata

  • Download URL: deproject-0.2.0.tar.gz
  • Upload date:
  • Size: 33.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.5.4

File hashes

Hashes for deproject-0.2.0.tar.gz
Algorithm Hash digest
SHA256 64effacb0a20a0d13918d44369874764db000081fc9cc9c0a5589274f13a93cf
MD5 f6ae69e002238950aac7589efd10955f
BLAKE2b-256 c9390819bd27eba201a20df73670e06715c401a4cc1ec91c1915a2c6ce9ed1b3

See more details on using hashes here.

File details

Details for the file deproject-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: deproject-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 33.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.5.4

File hashes

Hashes for deproject-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 29dd51292b655f834ed7babb05c339437125ccf5777ffa9e9bbdd0a4ff628897
MD5 b8f311eb6a17f35c2fe5280495605bb4
BLAKE2b-256 a6b44fd1683cc780ecd6bbede29bf79bfd5aa3cc799b3feeb8a41dcba6f0792e

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.2

2 files

This release

0.2.0 This release

2 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