1.382. simpleFitsReader

Full Name: herschel.ia.toolbox.util.SimpleFitsReaderTask
Alias: simpleFitsReader
Type: Java Task - Java Task
Import: from herschel.ia.toolbox.util import SimpleFitsReaderTask



Task to read HCSS products (and simple external FITS).

We recommend that you use fitsReader instead of this task. simpleFitsReader creates a product or a dataset from a FITS file. This tasks reads non-HCSS (external) fits files as simple HCSS products. If you need to import products (images, cubes, spectra), use FitsReader. fitsReader has a superset of the functionality of this task.

To save products into FITS files use simpleFitsWriter.


Example 1: Read as Herschel if possible else as a standard product
filepath = "path_to_file/filename"
product = simpleFitsReader(file=filepath)
Example 2: Read a standard product (non Herschel), with readerType argument
filepath = "path_to_file/filename"
readertype = SimpleFitsReaderTask.ReaderType.STANDARD
product=simpleFitsReader(file=filepath, reader=readertype)
Example 3: Read a standard product (non Herschel), with a String argument
filepath = "path_to_file/filename"
product=simpleFitsReader(file=filepath, reader="standard")


  • SimpleFitsReader cannot import complex external FITS files. Use FitsReader instead.

  • SimpleFitsReader does not support zipped fits (only gzipped). Use decompress on those zipped files.

API details


String file [INPUT, MANDATORY, default=no default value]

The path of the FITS file to be read. Can be gzipped.

Object reader [INPUT, OPTIONAL, default="Herschel then standard"]

The strategy used to parse the contents. Allows SimpleFitsReaderTask.ReaderType or String HCSS has priority over STANDARD and RAW as any FITS file can be read as STANDARD but only some of them are also HCSS FITS files. Possible values (you can use strings too, HCSS and Herschel are considered synonyms):

  • SimpleFitsReaderTask.ReaderType.HCSS_THEN_STANDARD (same as default) or "Herschel then standard": try to read the FITS Archive as an HCSS FITS file, if it fails then try to read it as an standard FITS file.

  • SimpleFitsReaderTask.ReaderType.HCSS or "HCSS": read it as an HCSS FITS file.

  • SimpleFitsReaderTask.ReaderType.STANDARD or "Standard": read it as an STANDARD FITS file.

  • SimpleFitsReaderTask.ReaderType.RAW: read it as an STANDARD FITS file, keeping the original metadata.

Annotatable product [OUTPUT, MANDATORY, default=no default value]

The Product or Dataset read from the FITS file.

See also


  • 2008-07-09 - JCS: first release
  • 2008-08-18 - JDS: added optional parameter reader (type) to allow transparent failover reading
  • 2011-01-24 - JDS: limitations