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

Commit

Permalink
warn for empty trigger input / output traces. Based on previous fix
Browse files Browse the repository at this point in the history
  • Loading branch information
calispac committed May 11, 2018
1 parent 9682115 commit c43af76
Showing 1 changed file with 24 additions and 6 deletions.
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 c43af76

Please sign in to comment.