Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

Commit

Permalink
hotfix for missing values in digicampipe
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Neise committed May 14, 2018
1 parent fb61de9 commit 2986740
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion protozfits/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.1a
1.0.1a0
25 changes: 12 additions & 13 deletions protozfits/digicam.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,26 +78,26 @@ def __init__(self, event, run_id):
self._event.pixels_flags)[Event._sort_ids]
self.adc_samples = self._samples[Event._sort_ids]

try:
self.trigger_output_patch7 = _prepare_trigger_output(
trafo(self._event.trigger_output_patch7))
except ValueError:
top7 = trafo(self._event.trigger_output_patch7)
if len(top7) > 0:
self.trigger_output_patch7 = _prepare_trigger_output(top7)
else:
warnings.warn('trigger_output_patch7 does not exist: --> nan')
self.trigger_output_patch7 = np.zeros(
(432, self.num_samples)) * np.nan

try:
self.trigger_output_patch19 = _prepare_trigger_output(
trafo(self._event.trigger_output_patch19))
except ValueError:
top19 = trafo(self._event.trigger_output_patch19)
if len(top19) > 0:
self.trigger_output_patch19 = _prepare_trigger_output(top19)
else:
warnings.warn('trigger_output_patch19 does not exist: --> nan')
self.trigger_output_patch19 = np.zeros(
(432, self.num_samples)) * np.nan

try:
self.trigger_input_traces = _prepare_trigger_input(
trafo(self._event.trigger_input_traces))
except ValueError:
tit = trafo(self._event.trigger_input_traces)
if len(tit) > 0:
self.trigger_input_traces = _prepare_trigger_input(tit)
else:
warnings.warn('trigger_input_traces does not exist: --> nan')
self.trigger_input_traces = np.zeros(
(432, self.num_samples)) * np.nan
Expand Down Expand Up @@ -128,7 +128,6 @@ def _prepare_trigger_input(_a):

def _prepare_trigger_output(_a):
A, B, C = 3, 18, 8

_a = np.unpackbits(_a.reshape(-1, A, B, 1), axis=-1)
_a = _a[..., ::-1]
_a = _a.reshape(-1, A*B*C).T
Expand Down

0 comments on commit 2986740

Please sign in to comment.