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

Container Improvements and Cleanup for DL1 #1301

Merged
merged 27 commits into from
May 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
41a4a78
changed DL1CameraContainer
kosack Apr 28, 2020
a14fba7
added image parameters
kosack Apr 28, 2020
6c4c47b
remove deprecated fields
kosack Apr 28, 2020
6129c2b
Merge branch 'master' of https://github.com/cta-observatory/ctapipe i…
kosack Apr 28, 2020
74504d6
renaming
kosack Apr 28, 2020
36bdcc7
changed order of some container defs to avoid forward refs
kosack Apr 28, 2020
3b63336
change name
kosack Apr 28, 2020
f59b283
use event index in EventSeeker
kosack Apr 28, 2020
63ac8dc
fix EventSeeker to use IndexContainer
kosack Apr 28, 2020
bfaae54
put event_type in Index, and use Enum
kosack Apr 28, 2020
df73ae6
Added dtype, ndim, and allow_none attributes to Field
kosack Apr 28, 2020
f730fbc
description updates
kosack Apr 28, 2020
b66b13f
fix hessioeventsource
kosack Apr 29, 2020
c0eaef1
fix typo
kosack Apr 29, 2020
3ef5701
one more fix for hessioeventsource
kosack Apr 29, 2020
caaadd3
another hessio fix
kosack Apr 29, 2020
3d190d1
use event.index in more places
kosack Apr 29, 2020
2f7fc8a
more fixes for using event.index
kosack Apr 29, 2020
31185b1
Merge branch 'master' of https://github.com/cta-observatory/ctapipe i…
kosack Apr 29, 2020
dc7f950
pulse_time to peak_time everywhere
kosack Apr 29, 2020
2c0b0f2
implement all event types
kosack Apr 29, 2020
463faa5
fixed some accidental refactorings
kosack Apr 29, 2020
a6b691b
fix notebook
kosack Apr 29, 2020
2bf9ec8
ensure containers appears in docs
kosack Apr 29, 2020
9258d1d
update type of unit in docs
kosack Apr 29, 2020
59eec8f
remove duplicate containers api from docs
kosack Apr 30, 2020
21cdfc2
Merge branch 'master' of https://github.com/cta-observatory/ctapipe i…
kosack Apr 30, 2020
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
7 changes: 4 additions & 3 deletions ctapipe/calib/camera/calibrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def _calibrate_dl0(self, event, telid):
waveforms_copy = waveforms.copy()
waveforms_copy[~reduced_waveforms_mask] = 0
event.dl0.tel[telid].waveform = waveforms_copy
event.dl0.tel[telid].selected_gain_channel = selected_gain_channel

def _calibrate_dl1(self, event, telid):
waveforms = event.dl0.tel[telid].waveform
Expand All @@ -120,9 +121,9 @@ def _calibrate_dl1(self, event, telid):
# - Don't do anything if dl1 container already filled
# - Update on SST review decision
charge = waveforms[..., 0]
pulse_time = np.zeros(n_pixels)
peak_time = np.zeros(n_pixels)
else:
charge, pulse_time = self.image_extractor(
charge, peak_time = self.image_extractor(
waveforms, telid=telid, selected_gain_channel=selected_gain_channel
)

Expand All @@ -133,7 +134,7 @@ def _calibrate_dl1(self, event, telid):
charge = (charge - pedestal) * relative / absolute

event.dl1.tel[telid].image = charge
event.dl1.tel[telid].pulse_time = pulse_time
event.dl1.tel[telid].peak_time = peak_time

def __call__(self, event):
"""
Expand Down
6 changes: 3 additions & 3 deletions ctapipe/calib/camera/tests/test_calibrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ def test_camera_calibrator(example_event, example_subarray):
calibrator = CameraCalibrator(subarray=example_subarray)
calibrator(example_event)
image = example_event.dl1.tel[telid].image
pulse_time = example_event.dl1.tel[telid].pulse_time
peak_time = example_event.dl1.tel[telid].peak_time
assert image is not None
assert pulse_time is not None
assert peak_time is not None
assert image.shape == (1764,)
assert pulse_time.shape == (1764,)
assert peak_time.shape == (1764,)


def test_manual_extractor(example_subarray):
Expand Down
Loading