get_badpix

sofia_redux.instruments.exes.get_badpix.get_badpix(header, clip_reference=False, apply_detsec=False)[source]

Get a bad pixel mask from a reference file.

The file name for the input mask is specified in header[‘BPM’].

Input bad pixel masks are expected to be single-extension FITS files, containing a 1024 x 1032 image in which a value of 1 indicates a good pixel, 0 indicates a bad pixel, and 2 indicates the 8 columns of reference pixels. These reference pixels will be clipped from the output to make a 1024 x 1024 mask, if clip_reference is set.

The output mask has Boolean type with True=good pixel and False=bad. The output size may be clipped to a detector section indicated in the input header, if apply_detsec is True.

Parameters:
headerfits.Header

FITS header, optionally containing BPM and DETSEC keywords.

clip_referencebool, optional

If True, 8 reference columns are clipped from the output mask.

apply_detsecbool, optional

If set, the output mask is clipped to match any detector section provided in header[‘DETSEC’].

Returns:
masknumpy.ndarray of bool

The bad pixel mask, with True=good, False=bad.