-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add option to save first samples of peak(lets) waveform #867
Conversation
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @HenningSE . The PR looks good I would add comments about this artificial threshold 6 of downsample_factor
.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @HenningSE . There is one missing argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @HenningSE . If you are sure this PR works well with your proposed change in straxen, please merge it after autotest finishes.
Thanks @dachengx, it looks like I'm not an authorized user and can not merge. |
p["data_start"] = wv_buffer[: len(p["data_start"])] | ||
else: | ||
p["data_start"][: p["length"]] = wv_buffer[: p["length"]] | ||
|
||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe here you should also assign data_start
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @dachengx, I think this case is not needed as we do not downsample the waveform. The data
field contains all needed information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if you look at data_start
, it will be zeros or np.nan. People might misunderstand it.
What is the problem / what does the code in this PR do
This PR adds the option to save the first n (default to 200) samples of the merged peak(lets) waveform without downsampling. In case of very wide S1s or S1s with a lot of afterpulses strax will downsample the peak waveforms to fit into the 200 sample summed waveform that we save with peaklets and peaks. This process removes important information of the S1 waveform. With this PR the first n samples of the waveforms are saved for peaklets that 1. get downsampled and 2. have a downsampling factor smaller 7. This should cover basically all S1s without introducing a large file size overhead.