load_image

sherpa.astro.ui.load_image(id, arg=None, coord='logical', dstype=<class 'sherpa.astro.data.DataIMG'>)

Load an image as a data set.

Parameters:
  • id (int or str, optional) – The identifier for the data set to use. If not given then the default identifier is used, as returned by get_default_id.
  • arg – Identify the image data: a file name, or a data structure representing the data to use, as used by the I/O backend in use by Sherpa: an IMAGECrate for crates, as used by CIAO, or a list of AstroPy HDU objects.
  • coord ({ 'logical', 'image', 'physical', 'world', 'wcs' }) – The coordinate system to use. The ‘image’ option is the same as ‘logical’, and ‘wcs’ the same as ‘world’.
  • dstype (optional) – The data class to use. The default is DataIMG.

See also

load_arrays()
Create a data set from array values.
load_ascii()
Load an ASCII file as a data set.
load_table()
Load a FITS binary file as a data set.
set_coord()
Set the coordinate system to use for image analysis.
set_data()
Set a data set.
unpack_image()
Create an image data structure.

Notes

The function does not follow the normal Python standards for parameter use, since it is designed for easy interactive use. When called with a single un-named argument, it is taken to be the arg parameter. If given two un-named arguments, then they are interpreted as the id and arg parameters, respectively. The remaining parameters are expected to be given as named arguments.

Examples

Load the image from the file “img.fits” into the default data set:

>>> load_image('img.fits')

Set the ‘bg’ data set to the contents of the file “img_bg.fits”:

>>> load_image('bg', 'img_bg.fits')