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

Commit

Permalink
Merge pull request #37 from cta-sst-1m/hotfix_missing_fields_in_digic…
Browse files Browse the repository at this point in the history
…ampipe_file

Hotfix missing fields in digicampipe file
  • Loading branch information
Dominik Neise authored May 14, 2018
2 parents 9b64c50 + 2986740 commit ef5bd2c
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.1
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 ef5bd2c

Please sign in to comment.