USRA-STI / gdt-fermi

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

Possible bug with GbmDetectorCollection #4

Closed OliverRoberts-USRA closed 1 year ago

OliverRoberts-USRA commented 1 year ago

I tried to convert TTE detector data to a PHAII format so that I can group detectors for spectral fitting using GbmDetectorCollection. I follow the examples in the GBM Data Tools and GDT documentation https://fermi.gsfc.nasa.gov/ssc/data/analysis/rmfit/gbm_data_tools/gdt-docs/notebooks/SpectralFitting.html but get errors when trying to fit a background to a list of detectors. However, working through the error seems to show an empty list after using GbmDetectorCollection. The conversion beforehand from TTE to PHAII seems to work fine, but the collection element does not seem to populate a list after. I could be doing something wrong, but I am struggling to see the issue and would appreciate some feedback. I am using a MacOS (Monterrey 12.6.5). Attached is a screenshot of the executed code.

Screen Shot 2023-05-08 at 12 38 11 PM Screen Shot 2023-05-08 at 12 41 02 PM
AdamGoldstein-USRA commented 1 year ago

I believe the bug is related to this TODO. Essentially, the detector name is not copied over from the TTE when converting to a PHAII. This can be confirmed by creating a collection with native CTIME or CSPEC data.

AdamGoldstein-USRA commented 1 year ago

@OliverRoberts-USRA I have implemented a fix in the fix-tte-to-phaii-detector-name branch. If you would like to test it to make sure it solves your problem, I will merge it into the main branch.

OliverRoberts-USRA commented 1 year ago

@AdamGoldstein-USRA Thanks for implementing a fix. I tested the fix-tte-to-phaii-detector-name branch and found it worked successfully. Consider the bug resolved. Thank you!