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 #34 from cta-sst-1m/warn_missing_ttr
Browse files Browse the repository at this point in the history
warn for empty trigger input / output traces. Based on previous fix
  • Loading branch information
calispac authored May 12, 2018
2 parents 9682115 + f6af367 commit c6f5620
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion protozfits/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0
1.0.1
30 changes: 24 additions & 6 deletions protozfits/digicam.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,30 @@ def __init__(self, event, run_id):
self.pixel_flags = trafo(
self._event.pixels_flags)[Event._sort_ids]
self.adc_samples = self._samples[Event._sort_ids]
self.trigger_output_patch7 = _prepare_trigger_output(
trafo(self._event.trigger_output_patch7))
self.trigger_output_patch19 = _prepare_trigger_output(
trafo(self._event.trigger_output_patch19))
self.trigger_input_traces = _prepare_trigger_input(
trafo(self._event.trigger_input_traces))

try:
self.trigger_output_patch7 = _prepare_trigger_output(
trafo(self._event.trigger_output_patch7))
except ValueError:
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:
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:
warnings.warn('trigger_input_traces does not exist: --> nan')
self.trigger_input_traces = np.zeros(
(432, self.num_samples)) * np.nan

@lazyproperty
def unsorted_baseline(self):
Expand Down

0 comments on commit c6f5620

Please sign in to comment.