read_image

sherpa.astro.io.read_image(arg, coord='logical', dstype=<class 'sherpa.astro.data.DataIMG'>)[source] [edit on github]

Create an image dataset from a file.

Changed in version 4.16.0: Setting coord to a value other than ‘logical’ will now correctly change the coordinate setting for DataIMG datasets.

Parameters:
  • arg – The name of the file or a representation of the file (the type depends on the I/O backend).

  • coord ({'logical', 'physical', 'world'}, optional) – The type of axis coordinates to use. An error is raised if the file does not contain the necessary metadata for the selected coordinate system.

  • dstype (optional) – The data type to create (it is expected to follow the sherpa.data.BaseData interface).

Returns:

data

Return type:

a sherpa.data.BaseData derived object

See also

write_image

Examples

The following examples do not contain argument types specific to a particular I/O backend.

Create a sherpa.astro.data.DataIMG object from the FITS file img.fits:

>>> d = read_image('img.fits')

Select the physical coordinate system from the file:

>>> d = read_image('img.fits', coord='physical')