Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs found when processing new scaled trigger data. #382

Merged
merged 2 commits into from
Mar 21, 2024

Conversation

samaloney
Copy link
Collaborator

  • Allow for QL files to unscale by packet
  • Fix bug the replicate extra triggers in Spectrogram

* Allow for QL file to unscale by batch
* Fix bug the replicate extra triggers in Spectrogram
@samaloney samaloney requested a review from nicHoch February 15, 2024 15:58
@codecov-commenter
Copy link

codecov-commenter commented Feb 15, 2024

Codecov Report

Attention: Patch coverage is 80.43478% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 77.12%. Comparing base (96fedb6) to head (6041799).

Files Patch % Lines
stixcore/products/level0/quicklookL0.py 70.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #382      +/-   ##
==========================================
+ Coverage   77.10%   77.12%   +0.01%     
==========================================
  Files          66       66              
  Lines        6906     6925      +19     
==========================================
+ Hits         5325     5341      +16     
- Misses       1581     1584       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@samaloney
Copy link
Collaborator Author

Hum I need to check some of the differences in the end2end tests ...

Copy link
Collaborator

@nicHoch nicHoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok looks like a bigger fix
but is looking good to me

Comment on lines +160 to +168
for i, (num, skm) in enumerate(zip(control['num_samples'],
control['compression_scheme_triggers_skm'])):
if skm.tolist() == _SKM_SCALING:
cur_slice = slice(cur_index, cur_index+num)
logger.debug('Unscaling triggers')
triggers[cur_slice], triggers_var[cur_slice] = unscale_triggers(
triggers[cur_slice], integration=duration[cur_slice],
detector_masks=control['detector_mask'][i:i+1], ssid=levelb.ssid)
cur_index += num
Copy link
Collaborator Author

@samaloney samaloney Mar 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible optimisation and could be extended for the other science data is rather than looping over all packets loop over data where skm apply as usually only 1 skm and in the vast majority of cases the number of different skm << num of packets.

@samaloney samaloney merged commit de54821 into i4Ds:master Mar 21, 2024
2 of 3 checks passed
@samaloney samaloney deleted the bugfix-scaling-issues branch March 21, 2024 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants