Model

class sofia_redux.visualization.models.model.Model[source]

Bases: object

The starting point for Eye of SOFIA models.

Data read in from FITS or non-fits files are stored in a collection of model object in this directory. The structure of a single complete FITS file is as follows:

  • High-Level Model
    • High-level models hold the contents of an entire FITS file. All interfaces should interact with the high level model, which controls and manages the lower level models.

    • Available models are:
      • Grism : for files with multiple images and a single spectrum.

      • MultiOrder: for files with multiple images and multiple spectra.

  • Mid-Level Models
    • Mid-level models hold all data structures that would need to be included together to be considered valid.

    • Available models are:
      • Book: For holding multiple images of the same target.

      • Order: For holding multiple spectra of the same target.

  • Low-Level Models
    • Low-level models hold the simplest data sets. For example, a single Order is made of multiple Spectrum objects, one for the wavelength data, one for the flux data, one for the error data, etc. All operations are performed at this level, such as unit conversions, but only by interacting through the higher-level models. The user should not interact with low level models directly.

    • Available models are:
      • Image: For holding a single 2d data set.

      • Spectrum: For holding a single 1d data set.

This module contains the interface controlling the initialization of a high level model. Once the high level model is created, the viewer operates on that object. The Model object here is not to be instantiated; it is merely used to implement the add_model method.

Methods Summary

add_model([filename, hdul])

Parse a FITS file into the appropriate high level model.

Methods Documentation

static add_model(filename: str = '', hdul: HDUList | None = None) HighModel[source]

Parse a FITS file into the appropriate high level model.

Either filename or hdul must be specified.

Parameters:
filenamestr, optional

Absolute path to the FITS file to read and parse.

hdulastropy.io.fits.HDUList, optional

An astropy HDUList to parse.

Returns:
modelmodel.high_model.HighModel

The high level model populated with the contents of filename.

Raises:
NotImplementedError

If the current instrument/data type is not supported.

RuntimeError

If invalid arguments are passed.