MultiOrder

class sofia_redux.visualization.models.high_model.MultiOrder(hdul: HDUList, general: bool | None = False)[source]

Bases: HighModel

High-level model for FITS files with multiple independent spectra.

Parameters:
hdulastropy.io.fits.HDUList

The HDU list from a spectral FITS file.

Attributes:
default_ndimint

Default number of dimensions.

num_ordersint

Number of orders in a dataset.

bookslist

List of mid_model.Book objects.

orderslist

List of mid_model.Order objects.

Methods Summary

load_data([general])

Parse the input Orders.

retrieve([order, field, level, aperture])

Access contents of lower level models.

valid_field(field)

Determine if a field is valid for the loaded data.

Methods Documentation

load_data(general: bool | None = False) None[source]

Parse the input Orders.

Parameters:
generalbool, optional

If set, the input data is handled in a generic way, assuming all extra spectral dimensions are orders rather than apertures.

retrieve(order: int = 0, field: str = '', level: str = 'raw', aperture: int | None = None) MidModels | LowModels | ndarray | None[source]

Access contents of lower level models.

Parameters:
orderint

Order number to be returned.

fieldstr

Name of the field to pull data for.

level{‘high’, ‘low’, ‘raw’}

Sets the level to return. ‘High’ will return the Order object, ‘low’, will return the Spectrum object, and ‘raw’ will return the raw numerical data.

aperture: int, optional

Aperture number to retrieve (zero-based indexing). If not included, assume the data only has a single aperture.

Returns:
datalow_model.LowModel or mid_model.MidModel or array-like

The requested data set. Can be a Book, Order, Image, Spectrum, or numpy array. If the parameters are not valid (i.e. no loaded data matches them) then None is returned.

valid_field(field: str) bool[source]

Determine if a field is valid for the loaded data.

Parameters:
fieldstr

Name of field.

Returns:
checkbool

True if the field is valid, False otherwise.