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

Peaklets too long #1249

Open
WenzDaniel opened this issue Aug 31, 2023 · 3 comments
Open

Peaklets too long #1249

WenzDaniel opened this issue Aug 31, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@WenzDaniel
Copy link
Collaborator

In about 1% of all peaks, peaks are longer than allowed by the max duration of merged_s2s. The reason is that already the respective peaklets are longer. These peaklets can span up to milliseconds. The reason is the ridiculously long max peaklet duration of 10 ms here:

peaklet_max_duration = straxen.URLConfig(
.

The down sampling of these peaklets will prevent the peak splitting algorithm to find suitable split points in data.

We might want to reduce this setting in the future. However, a new threshold needs a in depth testing.

@WenzDaniel WenzDaniel added the bug Something isn't working label Aug 31, 2023
@WenzDaniel
Copy link
Collaborator Author

Below are some example waveforms of these peaks:

example
example2
example3

@WenzDaniel
Copy link
Collaborator Author

In this context I also found another but. If I change the setting e.g.:

st.set_config({'peaklet_max_duration': 0.5*10**6})
peaks_updated = st.get_array('025423', 'peaklets')

I run into an error:

File ~/mymodules/straxen/straxen/plugins/peaklets/peaklets.py:240, in Peaklets.compute(self, records, start, end)
    238 # If sum_waveform_top_array is false, don't digitize the top array
    239 n_top_pmts_if_digitize_top = self.n_top_pmts if self.sum_waveform_top_array else -1
--> 240 strax.sum_waveform(peaklets, hitlets, r, rlinks, self.to_pe, n_top_channels=n_top_pmts_if_digitize_top)
    242 strax.compute_widths(peaklets)
    244 # Split peaks using low-split natural breaks;
    245 # see https://github.com/XENONnT/straxen/pull/45
    246 # and https://github.com/AxFoundation/strax/pull/225

File /opt/XENONnT/anaconda/envs/XENONnT_development/lib/python3.9/site-packages/numba/np/arraymath.py:624, in array_max_impl()
    622 def array_max_impl(arry):
    623     if arry.size == 0:
--> 624         raise ValueError(MSG)
    626     it = np.nditer(arry)
    627     max_value = next(it).take(0)

ValueError: zero-size array to reduction operation maximum which has no identity

@WenzDaniel
Copy link
Collaborator Author

I did some deeper investigation. The bug seems to be related between the downsampling of peaks, and the start and end of two successive hits. Somehow peaks get assigned a zero length in some cases, but I do not understand the full process yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants