i4Ds / STIXCore

STIX Core functionalities
BSD 3-Clause "New" or "Revised" License
3 stars 3 forks source link

Bug processing some TM applying the calibration from raw to engineering it seems #124

Closed samaloney closed 3 years ago

samaloney commented 3 years ago

Trace

2021-06-21T12:12:19Z ERROR __main__ 35: Error processing file /home/shane/fits_210617/L0/21/6/20/solo_L0_stix-sci-xray-rpd-1269828352_0659319036f58983-0659319134f06553_V01_52227.fits
2021-06-21T12:12:19Z ERROR __main__ 36: unhashable type: 'list'
Traceback (most recent call last):
  File "/home/shane/stixcore_env/lib/python3.8/site-packages/ipdb/__main__.py", line 303, in main
    pdb._runmodule(mainpyfile)
  File "/usr/lib/python3.8/pdb.py", line 1547, in _runmodule
    self.run(code)
  File "/usr/lib/python3.8/bdb.py", line 580, in run
    exec(cmd, globals, locals)
  File "/home/shane/stixcore/stixcore/processing/L0toL1.py", line 49, in <module>
    all_files = l1processor.process_fits_files()
  File "/home/shane/stixcore/stixcore/processing/L0toL1.py", line 37, in process_fits_files
    raise e
  File "/home/shane/stixcore/stixcore/processing/L0toL1.py", line 29, in process_fits_files
    l1 = tmp.from_level0(l0)
  File "/home/shane/stixcore/stixcore/products/level1/science.py", line 45, in from_level0
    raw_to_engineering_product(l1, idbm)
  File "/home/shane/stixcore/stixcore/processing/engineering.py", line 139, in raw_to_engineering_product
    calib_param = idb.get_params_for_calibration(
  File "/home/shane/stixcore/stixcore/idb/idb.py", line 1048, in get_params_for_calibration
    if key in self.calibration:
TypeError: unhashable type: 'list'

Variables

ipdb> key
(21, 21, 6, 20, ['NIX00408', 'NIX00409', 'NIX00410', 'NIX00411', 'NIX00412', 'NIX00413', 'NIX00414', 'NIX00415', 'NIX00416', 'NIX00417', 'NIX00418', 'NIX00419', 'NIX00420', 'NIX00421', 'NIX00422', 'NIX00423'], [None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None])
ipdb> self.calibration.items()
dict_items([((21, 21, 6, 20, 'NIX00401', 'CIXT0401TM'), [IDBCalibrationParameter(PCF_CATEG='S', PCF_CURTX='CIXT0401TM', PCF_DESCR='Rate control regime', PCF_NAME='NIX00401', PCF_PFC=4, PCF_PTC=3, PCF_UNIT=None, PCF_WIDTH=8, PID_DESCR='STIX Science Data Transfer - X-ray L0 user', PID_SPID=54114, PID_TPSD=54114, S2K_TYPE='U', bin_format='')])])

File on pub099

PosixPath('/home/shane/fits_210617/L0/21/6/20/solo_L0_stix-sci-xray-rpd-1269828352_0659319036f58983-0659319134f06553_V01_52227.fits')

samaloney commented 3 years ago

@nicHoch any ideas?

samaloney commented 3 years ago

Ok so it seems it happens for raw pixel data because

https://github.com/i4Ds/STIXCore/blob/5d713152465fb37fd6251dd40516cf0981c50e08/stixcore/products/level0/science.py#L133-L138

vs

https://github.com/i4Ds/STIXCore/blob/5d713152465fb37fd6251dd40516cf0981c50e08/stixcore/products/level0/science.py#L267-L269

I guess even though there is a PCF_CURTX we don't want to or need to calibrate the triggers?

samaloney commented 3 years ago

Fixed in #130