average_alt

sofia_redux.calibration.pipecal_util.average_alt(header)[source]

Robust average of altitude from FITS header.

Keys used are ALTI_STA and ALTI_END. If both are good (>= 0), they will be averaged. If only one is good, it will be returned. If both are bad, a PipeCalError will be raised.

Input values are expected in feet; return value is in kilo-feet, i.e. input values are divided by 1000 before returning.

Parameters:
headerastropy.io.fits.header.Header

FITS header containing altitude keys.

Returns:
float

The altitude value, in kilo-feet

Raises:
PipeCalError

If no valid altitude is found.