Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for calibscale #140

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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