get_header_quantity

sofia_redux.scan.utilities.utils.get_header_quantity(header, key, default=nan, default_unit=Unit(dimensionless))[source]

Get an astropy quantity from a FITS header value.

The unit is determined from the FITS comment, where unit should be enclosed in [unit] or (unit).

Parameters:
headerastropy.io.fits.header.Header
keystr
defaultfloat, optional

The default value to pass back if the key is not found in the header.

default_unitastropy.units.Unit or astropy.units.Quantity or str

The default unit if cannot be determined from header. If a quantity is provided, will be multiplied by the value.

Returns:
astropy.units.Quantity