Utilities¶
gripspy.util.checksum
¶
Adapted from the C implmentation written by Lammert Bies
-
gripspy.util.checksum.
crc16
(__Pyx_memviewslice data) → unsigned short¶ Compute the CRC16 checksum of a bytearray or equivalent. Because of Cython limitations, the input must be writeable (e.g., not a string)
gripspy.util.coincidence
¶
-
gripspy.util.coincidence.
find_nearest_in
¶ For two sorted arrays a and b, returns a list of the indices of the nearest element in b for each element in a. The two arrays must be of the same numeric type.
gripspy.util.time
¶
Module for time conversion
-
gripspy.util.time.
oeb2utc
(systime_array, seconds_of_gps_delay=6)[source]¶ Converts 6-byte system time (AKA gondola time) to UTC during the flight. Note that the detectors report a higher-precision “event” time that must first be divided by 10 to convert to system time.
Parameters: Returns: utc_array – Array of UTC times
datetime64
Return type: Notes
This conversion function works as intended for only system times during the flight. The flight computer was restarted on 2016 Jan 25, which leads to a discontinuity in system times, and this discontinuity is taken into account by the function.