Skip to content

Commit

Permalink
Merge pull request #146 from cta-observatory/add_integration_correcti…
Browse files Browse the repository at this point in the history
…on_option

Add option to enable/disable charge integration integration correction
  • Loading branch information
HealthyPear committed Jul 7, 2021
2 parents 283bd23 + 6d2d7a8 commit 89e65c4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
14 changes: 8 additions & 6 deletions protopipe/aux/example_config_files/analysis.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# General informations
# WARNING: the settings recorded here are unstable and used here only to give an example
# NOTE: only Prod3b simulations are currently supported.
General:
config_name: 'v0.4.0_dev1'
config_name: 'test'
site: 'north' # 'north' or 'south'
# array can be either
# - 'subarray_LSTs', 'subarray_MSTs', 'subarray_SSTs' or 'full_array'
Expand All @@ -16,6 +17,7 @@ Calibration:
# photoelectrons
# the pixel-wise one calculated by simtelarray is 0.92
calibscale: 0.92
apply_integration_correction: false

# Cleaning for reconstruction
ImageCleaning:
Expand All @@ -24,8 +26,8 @@ ImageCleaning:
biggest:
tail: #
thresholds: # picture, boundary
- LSTCam: [6.61, 3.30]
- NectarCam: [5.75, 2.88]
- LSTCam: [5.0, 2.5]
- NectarCam: [5.0, 2.5]
- FlashCam: [4,2] # dummy values for reliable unit-testing
- ASTRICam: [4,2] # dummy values for reliable unit-testing
- DigiCam: [0,0] # values left unset for future studies
Expand Down Expand Up @@ -58,8 +60,8 @@ ImageCleaning:
extended:
tail: #
thresholds: # picture, boundary
- LSTCam: [6.61, 3.30]
- NectarCam: [5.75, 2.88]
- LSTCam: [5.0, 2.5]
- NectarCam: [5.0, 2.5]
- FlashCam: [4,2] # dummy values for reliable unit-testing
- ASTRICam: [4,2] # dummy values for reliable unit-testing
- DigiCam: [0,0] # values left unset for future studies
Expand Down Expand Up @@ -91,7 +93,7 @@ ImageCleaning:
# Cut for image selection
ImageSelection:
source: "extended" # biggest or extended
charge: [50., 1e10]
charge: [55., 1e10]
pixel: [3, 1e10]
ellipticity: [0.1, 0.6]
nominal_distance: [0., 0.8] # in camera radius
Expand Down
15 changes: 9 additions & 6 deletions protopipe/pipeline/event_preparer.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ def __init__(
debug=False,
):
"""Initiliaze an EventPreparer object."""

# Readout window integration correction
try:
self.apply_integration_correction = config["Calibration"]["apply_integration_correction"]
except KeyError:
# defaults to enabled
self.apply_integration_correction = True

# Calibscale
try:
Expand Down Expand Up @@ -239,17 +246,13 @@ def __init__(
)
)

# Configuration for the camera calibrator

cfg = Config()

extractor = TwoPassWindowSum(config=cfg, subarray=subarray)
extractor = TwoPassWindowSum(subarray=subarray, apply_integration_correction=self.apply_integration_correction)
# Get the name of the image extractor in order to adapt some options
# specific to TwoPassWindowSum later on
self.extractorName = list(extractor.get_current_config().items())[0][0]

self.calib = CameraCalibrator(
config=cfg, image_extractor=extractor, subarray=subarray,
image_extractor=extractor, subarray=subarray,
)

# Reconstruction
Expand Down

0 comments on commit 89e65c4

Please sign in to comment.