unpack_data
- sherpa.astro.ui.unpack_data(filename, *args, **kwargs)
Create a sherpa data object from a file.
The object returned by
unpack_data
can be used in aset_data
call. The data types supported are those supported byunpack_pha
,unpack_image
,unpack_table
, andunpack_ascii
.- Parameters
filename – A file name or a data structure representing the data to use, as used by the I/O backend in use by Sherpa: e.g. a
PHACrateDataset
,TABLECrate
, orIMAGECrate
for crates, as used by CIAO, or a list of AstroPy HDU objects.args – The arguments supported by
unpack_pha
,unpack_image
,unpack_table
, andunpack_ascii
.kwargs – The keyword arguments supported by
unpack_pha
,unpack_image
,unpack_table
, andunpack_ascii
.
- Returns
The data set object.
- Return type
instance
See also
get_data
Return the data set by identifier.
load_arrays
Create a data set from array values.
set_data
Set a data set.
unpack_arrays
Create a sherpa data object from arrays of data.
unpack_ascii
Unpack an ASCII file into a data structure.
unpack_image
Create an image data structure.
unpack_pha
Create a PHA data structure.
unpack_table
Unpack a FITS binary file into a data structure.
Examples
Create a data object from the contents of the file “src.dat” and use it to create a Sherpa data set called “src”:
>>> dat = unpack_data('src.dat') >>> set_data('src', dat)