USRA-STI / gdt-fermi

Gamma-ray Data Tools - Fermi mission components
Apache License 2.0
2 stars 4 forks source link

Fix for GbmHealpix.write() #23

Closed AdamGoldstein-USRA closed 6 months ago

AdamGoldstein-USRA commented 7 months ago

Creating and writing a GbmHealPix object to a FITS file is inconsistent and faulty depending on the inputs given. If a HealpixHeaders is provided, the values are not always updated, and a default header is not consider in the event one is not specified by the user. This results in the quaternion/position information not being propagated to the header. This also fixes the case where there is no quaternion/position info passed to the creator.

The fix entails defining a default header in case one is not specified, nulling the detector pointing, geocenter location, and sun location. If frame and time information is also provided, those are calculated and the header is populated so that, on write, the file contains the correct updated information. This also includes operations with quaternions to use the Quaternions class and operations with the position information use the CartesianRepresentation class.