Skip to content

Commit

Permalink
Merge pull request #140 from HealthyPear/feature-add_support_for_cali…
Browse files Browse the repository at this point in the history
…bscale

Add support for calibscale
  • Loading branch information
HealthyPear authored May 17, 2021
2 parents 57d344a + a6625da commit fd7b693
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
6 changes: 6 additions & 0 deletions protopipe/aux/example_config_files/analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ General:
array: full_array
cam_id_list : ['LSTCam', 'NectarCam'] # Selected cameras (disabled option)

Calibration:
# factor to transform the integrated charges (in ADC counts) into number of
# photoelectrons
# the pixel-wise one calculated by simtelarray is 0.92
calibscale: 0.92

# Cleaning for reconstruction
ImageCleaning:

Expand Down
11 changes: 10 additions & 1 deletion protopipe/pipeline/event_preparer.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ def __init__(
debug=False,
):
"""Initiliaze an EventPreparer object."""

# Calibscale
try:
self.calibscale = config["Calibration"]["calibscale"]
except KeyError:
# defaults for no calibscale applied
self.calibscale = 1.0

# Cleaning for reconstruction
self.cleaner_reco = ImageCleaner( # for reconstruction
config=config["ImageCleaning"]["biggest"],
Expand Down Expand Up @@ -458,7 +466,8 @@ def prepare_event(self, source, return_stub=True, save_images=False, debug=False
n_tels[tel_type] += 1

# use ctapipe's functionality to get the calibrated image
pmt_signal = event.dl1.tel[tel_id].image
# and scale the reconstructed values if required
pmt_signal = event.dl1.tel[tel_id].image / self.calibscale

# If required...
if save_images is True:
Expand Down
6 changes: 6 additions & 0 deletions protopipe/scripts/tests/test_config_analysis_north.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ General:
array: full_array
cam_id_list : ['LSTCam', 'NectarCam'] # Selected cameras (disabled option)

Calibration:
# factor to transform the integrated charges (in ADC counts) into number of
# photoelectrons
# the pixel-wise one calculated by simtelarray is 0.92
calibscale: 0.92

# Cleaning for reconstruction
ImageCleaning:

Expand Down
6 changes: 6 additions & 0 deletions protopipe/scripts/tests/test_config_analysis_south.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ General:
array: full_array
cam_id_list : ['LSTCam', 'FlashCam', 'CHEC'] # Selected cameras (disabled option)

Calibration:
# factor to transform the integrated charges (in ADC counts) into number of
# photoelectrons
# the pixel-wise one calculated by simtelarray is 0.92
calibscale: 0.92

# Cleaning for reconstruction
ImageCleaning:

Expand Down

0 comments on commit fd7b693

Please sign in to comment.