average_za

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

Robust average of zenith angle from FITS header.

Keys used are ZA_START and ZA_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.

Parameters:
headerastropy.io.fits.header.Header

FITS header containing ZA keys.

Returns:
float

The ZA value

Raises:
PipeCalError

If no valid ZA is found.