Book

class sofia_redux.visualization.models.mid_model.Book(hdul: HL, filename: str, number: int, aperture: int | None = None, **kwargs)[source]

Bases: MidModel

Multi-image data object.

Parameters:
hdulastropy.io.fits.HDUList

FITS HDU list to load.

filenamestr

Filename associated with the FITS file.

numberint

Index number for the data object.

apertureint

Aperture number for the data object.

Methods Summary

describe()

Describe the loaded data structure.

load_combined(hdu, filename)

Load a Book that is combined in a single extension.

load_split(hdul, filename)

Load a book that is split across multiple extensions.

retrieve(field, level)

Return raw data for a specified field.

Methods Documentation

describe() Dict[str, Any][source]

Describe the loaded data structure.

load_combined(hdu: ImageHDU, filename: str) None[source]

Load a Book that is combined in a single extension.

Parameters:
hduastropy.io.fits.HDU

An HDU object.

filenamestr

Name of the FITS file.

load_split(hdul: HDUList, filename: str) None[source]

Load a book that is split across multiple extensions.

Parameters:
hdulastropy.io.fits.HDUList

List of HDU objects.

filenamestr

Name of the FITS file.

retrieve(field: str, level: str) LowModels | ndarray | None[source]

Return raw data for a specified field.

Parameters:
fieldstr

Name of field to pull from self.data.

level{‘low’, ‘raw’}

Determines the level of the data to return. ‘Low’ returns the Spectrum object; ‘raw’ returns the raw numeric data array.

Returns:
datalow_model.LowModel or array-like

Retrieved raw data. Can be any subclass of low_model.LowModel, a numpy array, or None