Skip to content

Commit

Permalink
Merge pull request #940 from cta-observatory/correct_calib_pedestal_s…
Browse files Browse the repository at this point in the history
…ubtraction

Correct the R0 baseline subtraction in case of simulation events
  • Loading branch information
rlopezcoto authored Mar 10, 2022
2 parents 3a9f547 + 1e408b4 commit 2271df3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lstchain/tools/lstchain_create_calibration_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ def start(self):

# if simulation use not calibrated and not gain selected R0 waveform
if self.simulation:
event.r1.tel[tel_id].waveform = (
event.r0.tel[tel_id].waveform.astype(float)
- event.mon.tel[tel_id].calibration.pedestal_per_sample[..., np.newaxis]
)
# estimate offset of each channel from the camera median pedestal value
offset = np.median(event.mon.tel[tel_id].calibration.pedestal_per_sample, axis=1).round()
event.r1.tel[tel_id].waveform = event.r0.tel[tel_id].waveform.astype(np.float32) - offset[:, np.newaxis, np.newaxis]


if count % 1000 == 0 and count> self.events_to_skip:
self.log.debug(f"Event {count}")
Expand Down

0 comments on commit 2271df3

Please sign in to comment.