Closed derekocallaghan closed 4 months ago
Hi @AdamGoldstein-USRA,
Just wanted to check whether the suggested fix/workaround is okay with you? If so, I'll create a PR.
Thanks
I've confirmed that this issue has been fixed with this recent gdt-core
PR that displays a warning for missing headers: https://github.com/USRA-STI/gdt-core/pull/25
In [1]: from gdt.missions.fermi.gbm.tcat import Tcat
In [2]: tcat = Tcat.open("./glg_tcat_all_bn180112842_v00.fit")
/home/derek/gitrepos/gifts-6u/gdt-fermi/src/gdt/missions/fermi/gbm/tcat.py:88: RuntimeWarning: INFILE01 not found in header PRIMARY
obj._headers = TcatHeaders.from_headers(hdrs)
/home/derek/gitrepos/gifts-6u/gdt-fermi/src/gdt/missions/fermi/gbm/tcat.py:88: RuntimeWarning: HISTORY not found in header PRIMARY
obj._headers = TcatHeaders.from_headers(hdrs)
In [3]: tcat.headers[0]
Out[3]: WARNING: VerifyWarning: Card is too long, comment will be truncated. [astropy.io.fits.card]
CREATOR = 'DOL+GBM_TRIGDAT_Reader v1.28' / Software and version creating file
FILETYPE= 'TRIGGER ENTRY' / Name for this type of FITS file
TELESCOP= 'GLAST ' / Name of mission/satellite
INSTRUME= 'GBM ' / Specific instrument used for observation
OBSERVER= 'Meegan ' / GLAST Burst Monitor P.I.
ORIGIN = 'GIOC ' / Name of organization making file
DATE = '2018-01-12T20:22:25' / file creation date (YYYY-MM-DDThh:mm:ss UT)
DATE-OBS= '2018-01-12 20:11:18.386' / Date of start of observation
DATE-END= '2018-01-12 20:21:32.797' / Date of end of observation
TIMESYS = 'TT ' / Time system used in time keywords
TIMEUNIT= 's ' / Time since MJDREF, used in TSTART and TSTOP
MJDREFI = 51910 / MJD of GLAST reference epoch, integer part
MJDREFF = '0.0007428703703703703' / MJD of GLAST reference epoch, fractional par
TSTART = 537480614.201896 / [GLAST MET] Observation start time
TSTOP = 537481228.613448 / [GLAST MET] Observation stop time
FILENAME= 'glg_tcat_all_bn180112842_v00.fit' / Name of this file
TRIGTIME= 537480753.340436 / Trigger time relative to MJDREF, double precisi
OBJECT = 'GRB180112842' / Burst name in standard format, yymmddfff
RADECSYS= 'FK5 ' / Stellar reference frame
EQUINOX = 2000.0 / Equinox for RA and Dec
RA_OBJ = 173.92 / Calculated RA of burst
DEC_OBJ = 23.06 / Calculated Dec of burst
ERR_RAD = 6.67 / Calculated Location Error Radius
THETA = 65.0 / [deg] Angle from spacecraft zenith
PHI = 243.0 / [deg] Angle from spacecraft +X axis toward +Y
LOC_SRC = 'Fermi, GBM' / Mission/Instrument providing the localization
CLASS = 'GRB ' / Classification of trigger
OBJ_CLAS= 'GRB ' / Classification of trigger
TRIGSCAL= 256 / [ms] Triggered timescale
TRIG_ALG= 9 / Triggered algorithm number
CHAN_LO = 3 / Trigger channel: low
CHAN_HI = 4 / Trigger channel: high
ADC_LO = 259 / Trigger channel: low (ADC: 0 - 4095)
ADC_HI = 1352 / Trigger channel: high (ADC: 0 - 4095)
TRIG_SIG= 4.9 / Trigger significance (sigma)
GEO_LONG= 45.65 / [deg] Spacecraft geographical east longitude
GEO_LAT = 25.4833 / [deg] Spacecraft geographical north latitude
DET_MASK= '00000011000000' / Triggered detectors: (0-13)
RA_SCX = 298.1209 / [deg] Pointing of spacecraft x-axis: RA
DEC_SCX = 13.4377 / [deg] Pointing of spacecraft x-axis: Dec
RA_SCZ = 94.5567 / [deg] Pointing of spacecraft z-axis: RA
DEC_SCZ = 75.3901 / [deg] Pointing of spacecraft z-axis: Dec
INFILE01= '' / Level 0 input data file
LOC_VER = '3 ' / Version string of localizing software
LOC_ENRG= '(50.0,300.0)' / Energy range used for localization
RELIABLT= 0.9529 / Reliability of classification
GCN_FLAG= 'No '
HISTORY ()
HISTORY BKG_POLY_ORDER=
HISTORY BKGINT1 = ()
HISTORY BKGINT2 = ()
I've noticed that certain triggers/burst FITS files don't contain all
GbmHeader
subclass keywords, preventing the subclass from opening the file. This can be illustrated withTcat.open()
and a local copy of glg_tcat_all_bn180112842_v00.fit, but it also happens in other situations e.g.GbmTte.open()
:The FITS file can be opened directly, where it can be seen that
INFILE01
isn't in the header:I'm currently using a local
gdt-core
workaround as follows, where any expected keywords missing from the header are ignored. Although I can create a PR with this modification, I'm unsure whether you always want to reject any FITS files with missing keywords, so I've held off for now and am logging this issue instead.