Skip to content

Fermi detector angles are not always returned for the desired time due to data gaps. #129

@aringlis

Description

@aringlis

Describe the bug

In the fermi module of sunkit-instruments, the code get_detector_sun_angles_for_time returns the angle with respect to the Sun of each Fermi/GBM detector. This is done by reading in a Fermi spacecraft weekly file.

However, these files contain gaps due to the South Atlantic Anomaly. If the time requested falls in one of these gaps, the code will return the detector angles for the next available time. This can be several minutes different from the time requested. Currently, the code does not provide any indication that this has happened.

#128 addresses this in the short term by adding a warning. However, there are two other potential fixes for this issue:

  • interpolate the detector angles over the time gap, and warn the user that this has happened.
  • switch to reading the spacecraft location information from GBM poshist files, instead of LAT spacecraft weekly files. GBM poshist files do not contain the data gaps. This would require a more substantial rewrite of the code.

To Reproduce

from sunkit_instruments import fermi
from sunpy.time import parse_time

#download this file from the Fermi data site: https://heasarc.gsfc.nasa.gov/FTP/fermi/data/lat/weekly/spacecraft/
latfile = 'lat_spacecraft_weekly_w759_p310_v001.fits'

fermi.get_detector_sun_angles_for_time(parse_time('2022-12-21 05:58'),latfile)
2022-12-21T06:07:06.669
Out[4]: 
{'n0': <Quantity 64.30501912 deg>,
 'n1': <Quantity 50.44281419 deg>,
 'n2': <Quantity 59.23217787 deg>,
 'n3': <Quantity 50.51352778 deg>,
 'n4': <Quantity 57.74707928 deg>,
 'n5': <Quantity 12.21379982 deg>,
 'n6': <Quantity 92.72340196 deg>,
 'n7': <Quantity 111.03877079 deg>,
 'n8': <Quantity 122.58615099 deg>,
 'n9': <Quantity 110.48942928 deg>,
 'n10': <Quantity 122.98448235 deg>,
 'n11': <Quantity 167.7808395 deg>,
 'time': <Time object: scale='utc' format='isot' value=2022-12-21T06:07:06.669>}

Note that detector angles are returned for 06:07 UT, when the requested time was 05:58 UT.

Screenshots

No response

System Details

No response

Installation method

conda

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions