The sherpa.astro.io module
Provide Astronomy-specific I/O routines for Sherpa.
This module contains read and write routines for handling FITS and ASCII format data. The actual support is provided by the selected I/O backend package (currently Crates, provided by CIAO, or the FITS support in the AstroPy package, if installed).
Which backend is used?
When this module is first imported, Sherpa tries to import the
backends installed with Sherpa in the order listed in the
.sherpa.rc or .sherpa-standalone.rc file. The first module that imports
successfully is set as the active backend. The following command prints the
name of the active backend:
>>> from sherpa.astro import io
>>> print(io.backend.name)
A list of available backends can be obtained with:
>>> print(io.IO_BACKENDS.keys())
dict_keys(['dummy'...])
Change the backend
After the initial import, the backend can be changed by loading one of the I/O backends shipped with sherpa:
Functions
|
Set the Sherpa IO backend. |
|
Set the Sherpa I/O backend as a context, e.g. for a single operation. |
global list of all successfully imported I/O backends |
|
|
Create a dataset from a tabular file. |
|
Create an image dataset from a file. |
|
Create a DataARF object. |
|
Create a DataRMF object. |
|
Create a dataset from multiple arrays. |
|
Create a DataPHA object. |
|
Write out an ARF. |
|
Write out an image. |
|
Write out a PHA dataset. |
|
Write out a RMF. |
|
Write out a table. |
|
Convert a Sherpa data object into an I/O item (tabular). |
|
Convert a Sherpa data object into an I/O item (image). |
|
Convert a Sherpa PHA data object into an I/O item (tabular). |
|
Return the HDU elements (columns and header) from a FITS table. |