unpack_data
- sherpa.astro.ui.unpack_data(filename, *args, **kwargs)
Create a sherpa data object from a file.
The object returned by
unpack_datacan be used in aset_datacall. 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, orIMAGECratefor 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_dataReturn the data set by identifier.
load_arraysCreate a data set from array values.
set_dataSet a data set.
unpack_arraysCreate a sherpa data object from arrays of data.
unpack_asciiUnpack an ASCII file into a data structure.
unpack_imageCreate an image data structure.
unpack_phaCreate a PHA data structure.
unpack_tableUnpack 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)