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 a set_data call. The data types supported are those supported by unpack_pha, unpack_image, unpack_table, and unpack_ascii.

Parameters:
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)