Skip to content

Commit

Permalink
Fix time shift corrections code (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
samaloney authored Mar 30, 2023
1 parent 18f294f commit 99e9d1e
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions stixcore/products/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,25 +738,8 @@ def from_level0(cls, l0product, parent=''):
and l1.data['timedel'].as_float().min() == 1*u.s) or \
(l1.utc_timerange.start.datetime >= MIN_INT_TIME_CHANGE
and l1.data['timedel'].as_float().min() == 0.5*u.s):
correct_counts = l1.data['counts'][1:]
correct_triggers = l1.data['triggers'][1:]
# RAW PD does not have compressed counts
if l1.ssid > 20:
correct_trigger_errs = l1.data['triggers_comp_err'][1:]
correct_count_errs = l1.data['counts_comp_err'][1:]
correct_times = l1.data['time'][1:]
correct_durations = l1.data['timedel'][1:]
correct_rcr = l1.data['rcr'][1:]
l1.data = l1.data[0:-1]
l1.data['counts'] = correct_counts
# RAW PD does not have compressed counts
if l1.ssid > 20:
l1.data['counts_comp_err'] = correct_count_errs
l1.data['triggers_comp_err'] = correct_trigger_errs
l1.data['triggers'] = correct_triggers
l1.data['time'] = correct_times
l1.data['timedel'] = correct_durations
l1.data['rcr'] = correct_rcr
l1.data['timedel'][1:-1] = l1.data['timedel'][:-2]
l1.data = l1.data[1:-1]
l1.history.append('Time and count arrays were shifted to fix offset')
else:
l1.comment.append('Time and count arrays offset not fixed'
Expand Down

0 comments on commit 99e9d1e

Please sign in to comment.