Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
aringlis opened this issue Aug 14, 2024 · 3 comments

Comments

@aringlis
Copy link
Member

aringlis commented Aug 14, 2024

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

@Abinash-bit
Copy link
Contributor

Where can i find the GBM poshist files?

@nabobalis
Copy link
Contributor

Hi @Abinash-bit, I am not familiar with these files but a quick Google gave me this:https://fermi.gsfc.nasa.gov/ssc/data/analysis/gbm/gbm_data_tools/gdt-docs/notebooks/PositionHistory.html So maybe that will be helpful.

@aringlis
Copy link
Member Author

aringlis commented Dec 1, 2024

They are available at the Fermi Science Support Center, under ‘GBM continuous data’. See here: https://fermi.gsfc.nasa.gov/ssc/data/access/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants