validate¶
- sofia_redux.scan.custom.hawc_plus.frames.hawc_plus_frame_numba_functions.validate(valid, validated, status, chop_length, chopping, use_between_scans, normal_observing_flag, between_scan_flag, transit_tolerance, chopper_amplitude, check_coordinates, non_sidereal, equatorial_null, equatorial_nan, object_null, horizontal_nan, chopper_nan, lst, site_lon, site_lat, telescope_vpa, instrument_vpa)[source]¶
Utility function to validate HAWC+ frames following a data read.
Checks the frame attributes specific to HAWC+ observations for validity.
- Parameters:
- validnumpy.ndarray (bool)
The validity array where
False
marks an invalid frame that should not be included in any subsequent operations of shape (n_frames,). Will be updated in-place. AFalse
value on entry overrides any further analysis and will remain so.- validatednumpy.ndarray (bool)
A boolean array of shape (n_frames,) where
True
indicates that a frame has already gone through the validation process and should not be re-validated.- statusnumpy.ndarray (int)
A status array in which values correspond to an observation type. Those that do not correspond to FITS_FLAG_NORMAL_OBSERVING will be flagged as invalid. If
use_between_scans
isTrue
and the status is equal to FITS_FLAG_BETWEEN_SCANS, the frame will also be marked as invalid. Should be an array of shape (n_frames,).- chop_lengthnumpy.ndarray (float)
The chopper offset distance from the nominal (x=0, y=0) position in arcseconds. If |`chop_length` -
chopper_amplitude
| >transit_tolerance
, then the frame will be marked as invalid. Should be an array of shape (n_frames,).- choppingbool
True
if the chopper was used during the observation, andFalse
otherwise.- use_between_scansbool
True
if data was continually taken between scans.- normal_observing_flagint
The integer flag equivalent to the FITS_FLAG_NORMAL_OBSERVING flag. Any
status
value that is not equal to this is flagged as invalid.- between_scan_flagint
The integer flag equivalent to the FITS_FLAG_BETWEEN_SCANS flag. If
use_between_scans
isTrue
, data will be flagged as invalid if it’sstatus
matches this value.- transit_tolerancefloat
The chopper maximum deviation above the chopper amplitude above which a frame will be marked as invalid in arcseconds. Please see
chop_length
for further details.- chopper_amplitudefloat
The expected chopper amplitude in arcseconds. Please see
chop_length
for further details.- check_coordinatesnumpy.ndarray (bool)
If
True
, check the frame coordinates for validity. Should be set toFalse
if this was a lab observation without any real coordinates. IfFalse
, the equatorial, object, horizontal, chopper, lst, site, and vpa type values will not impact the validity of the frames. Should be an array of shape (n_frames,)- non_siderealbool
If
True
, the frames should contain valid object coordinates. If not, they will be marked as invalid.- equatorial_nullnumpy.ndarray (bool)
An array of shape (n_frames,) where
True
indicates that the equatorial coordinates are zero valued. Any such frames will be marked as invalid.- equatorial_nannumpy.ndarray (bool)
An array of shape (n_frames,) where
True
indicates that one or more of the equatorial coordinates for a given frame is NaN. Any such frames will be marked as invalid.- object_nullnumpy.ndarray (bool)
An array of shape (n_frames,) where
True
indicates that the object coordinates for a given frame are zeroed. Any such frames will be marked as invalid.- horizontal_nannumpy.ndarray (bool)
An array of shape (n_frames,) where
True
indicates that the horizontal coordinates for a given frame are NaN. Any such frames will be marked as invalid.- chopper_nannumpy.ndarray (bool)
An array of shape (n_frames,) where
True
indicates that one or more of the chopper coordinates for a given frame is set to NaN. If the chopper is used, then any such frame will be marked as invalid.- lstnumpy.ndarray (float)
The local-sidereal-time values in unix seconds of shape (n_frames,). If any LST value is set to NaN, the associated frame will be marked as invalid.
- site_lonnumpy.ndarray (float)
The site longitude coordinates of shape (n_frames,) in arbitrary units. If any longitude value is NaN, the associated frame will be marked as invalid.
- site_latnumpy.ndarray (float)
The site latitude coordinates of shape (n_frames,) in arbitrary units. If any latitude value is NaN, the associated frame will be marked as invalid.
- telescope_vpanumpy.ndarray (float)
The telescope VPA in arbitrary angle units of shape (n_frames,). If any value is set to NaN, the associated frame will be marked as invalid.
- instrument_vpanumpy.ndarray (float)
The instrument VPA in arbitrary angle units of shape (n_frames,). If any value is set to NaN, the associated frame will be marked as invalid.
- Returns:
- None