read_image, coord='logical', dstype=<class ''>)[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.

  • 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 interface).



Return type:

a derived object

See also



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

Create a 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')