LowModel

class sofia_redux.visualization.models.low_model.LowModel(hdu: ImageHDU, filename: str, **kwargs)[source]

Bases: object

Describe a low-level data object.

A low-level data object holds a single data array and the information describing it, such as the kind of data it holds and the units.

Parameters:
hduastropy.io.fits.ImageHDU

The FITS HDU to load.

filenamestr

Filename associated with the FITS HDU.

kwargsdict, optional

Optional keywords to set name, data, and kind properties.

Attributes:
headerastropy.io.fits.Header

FITS header.

filenamestr

Filename associated with the FITS HDU.

unitstr

Unit associated with the data.

unit_keystr

Associated keyword to parse corresponding units. For example, ‘XUNITS’ for x-axis units.

namestr

Name of FITS extension. For example, wavepos, slitpos, spectral_flux, or spectral_error.

datanp.ndarray

Data from the FITS HDU.

kindstr

Determines the variable kind (e.g. ‘wavelength’), to determine its units.

available_unitsdict

Recognized units that can be converted from or to.

kind_namesDict

Dictionary of variable kinds depending on if its Image or a spectrum.

default_ndimsint

Default data dimensions.

idstr

Full name including the filename and extension name.

enabledbool

Indicates if the data set is enabled or not.

Methods Summary

convert(target_unit, wavelength, wavelength_unit)

Convert units.

get_unit()

Get the current data unit.

retrieve()

Retrieve data array from the model.

set_visibility(enabled)

Set visibility for the model.

Methods Documentation

convert(target_unit: str, wavelength: Data, wavelength_unit: str) None[source]

Convert units.

Parameters:
target_unitstr

Unit to convert to.

wavelengtharray-like

Wavelength data array associated with current data.

wavelength_unitstr

Wavelength units.

Raises:
ValueError

If conversion cannot be completed.

get_unit() str[source]

Get the current data unit.

retrieve() ndarray[source]

Retrieve data array from the model.

Returns:
data: np.ndarray

Data from FITS file in a numpy array.

set_visibility(enabled: bool) None[source]

Set visibility for the model.

Parameters:
enabledbool

If True, the model is enabled. If False, it is disabled.