add correction for time of flight to the instrument before rev 1
This PR adds an optional check to determine if the GLM dataset being used does not contain the correction for the time of flight from a particular event/group/flash to the sensor. This results in the dataset containing information of when the signal arrived at the sensor, but not when the signal was produced in the cloud. This issue is described in the GLM Product Performance Guide as issue 3.4.2, which was fixed in ADR 333 (October 18 2018).
When reading in a GLM dataset, the date is checked to see if it was produced before the fix was implemented, calculates the time of flight to each event/group/flash's location to the satellite, and then adds this value to the event_time_offset, event_group_offset, and flash_time_offset_of_first_event and flash_time_offset_of_last_event. The following assumptions are made:
- the height above the WGS84 ellipsoid of each event/group is assumed to be negligible compared to the height of the satellite
- the satellite is located precisely above its expected subpoint and precisely at its height
- the speed of light is precisely 299792458 m/s
This should work well enough in most cases, but the user can override this behavior by specifying fix_bad_time_of_flight=False in the call to GLMDataset.
this is only a draft for now because flash_time_offset_of_first_event and flash_time_offset_of_last_event should really be updated to match their children rather than just using a constant offset based on the flash centroid (and maybe the group_time_offset should be the same?)
Visted about this today in person, lgtm.