Skip to content

Commit

Permalink
Fix regressions in unscaling function
Browse files Browse the repository at this point in the history
  • Loading branch information
samaloney committed Dec 7, 2023
1 parent fa604ba commit c93db4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion stixcore/products/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def unscale_triggers(scaled_triggers, *, integration, detector_masks, ssid, fact
n_int = integration.as_float().to_value(u.ds) # units of 0.1s

# Scaled to ints onboard, so bins have scaled width of 1, so error is 0.5 times the total factor
scaling_error = np.full_like(scaled_triggers, 0.5) * n_group.T * n_int * factor
scaling_error = np.full_like(scaled_triggers, 0.5, dtype=float) * n_group.T * n_int * factor
# The FSW essential floors the value so add 0.5 so trigger is the centre of range +/- error
unscaled_triggers = (scaled_triggers * n_group.T * n_int * factor) + scaling_error

Expand Down
2 changes: 1 addition & 1 deletion stixcore/products/level0/quicklookL0.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def from_levelb(cls, levelb, parent=''):

triggers = packets.get_value('NIX00274').T
triggers_var = packets.get_value('NIX00274', attr="error").T
if control['compression_scheme_triggers_skm'] == [0, 0, 7]:
if control['compression_scheme_triggers_skm'].tolist() == [[0, 0, 7]]:
logger.debug('Unscaling trigger ')
triggers, triggers_var = unscale_triggers(
triggers, integration=duration, detector_masks=control['detector_mask'],
Expand Down

0 comments on commit c93db4c

Please sign in to comment.