cta-observatory / pyeventio

Python read-only implementation for the EventIO data format used by the CORSIKA 7 IACT extension and sim_telarray
MIT License
10 stars 12 forks source link

Support reading true pe for calibration events (new block type 2028) #250

Closed maxnoe closed 2 years ago

maxnoe commented 2 years ago

Paraphrased from a maul by Konrad:

The structure looks like that:

Type 2034, version 0, length 272684 (id 4 = 0x4)        [Calibration event p.e. list]
  Type 1204, version 0, length 272672 (id 32 = 0x20)    [CORSIKA telescope array]
    Type 1208, version 2, length 272660 (id 32003 = 0x7d03) [CORSIKA photo-electrons]
Type 2028, version 0, length 48592 (id 4 = 0x4) [Calibration event]
  Type 2010, version 0, length 48580 (id 32 = 0x20)     [Event]
    Type 2009, version 2, length 40 (id 32 = 0x20)      [Central trigger]
    Type 2204, version 1, length 48496 (id 32 = 0x20)   [Telescope data]
      Type 2011, version 3, length 36 (id 4 = 0x4)      [Telescope event header]
      Type 2013, version 3, length 48436 (id 16384 = 0x4000) [ADC samples]
    Type 2104, version 0, length 8 (id 260 = 0x104)     [Tracking data]

with the ID in the outer envelop, both the same, standing for the calibration event type (4: second intensity in 'laser' events) and, after running it through extract_calibevent, like:

Type 1204, version 0, length 272672 (id 32 = 0x20)      [CORSIKA telescope array]
  Type 1208, version 2, length 272660 (id 32003 = 0x7d03) [CORSIKA photo-electrons]
Type 2010, version 0, length 48580 (id 32 = 0x20)       [Event]
  Type 2009, version 2, length 40 (id 32 = 0x20)        [Central trigger]
  Type 2204, version 1, length 48496 (id 32 = 0x20)     [Telescope data]
    Type 2011, version 3, length 36 (id 4 = 0x4)        [Telescope event header]
    Type 2013, version 3, length 48436 (id 16384 = 0x4000) [ADC samples]
  Type 2104, version 0, length 8 (id 260 = 0x104)       [Tracking data]