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

Why we can not remove data_top or data_start from _temp_event_data_type #1448

Open
dachengx opened this issue Oct 12, 2024 · 0 comments
Open
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@dachengx
Copy link
Collaborator

To Reproduce

If you remove data_top or data_start from _temp_event_data_type in straxen/plugins/events_nv/event_waveform_nv.py. Then run

pytest -xsv ./tests -k test_event_waveform_nv

you will see error like:

FAILED tests/plugins/test_plugins.py::PluginTest::test_event_waveform_nv - KeyError: "Field 'data_start' was not found in record with fields ('Start time since unix epoch [ns]', 'time', 'Length of the interval in samples', 'length', 'Width of one sample [ns]', 'dt', 'Waveform data in PE/sample (not PE/ns!)', 'data', 'Width (in ns) of the central 50% area of the peak', 'range_50p_area', 'Width (in ns) of the central 90% area of the peak', 'range_90p_area', 'Time between 10% and 50% area quantiles [ns]', 'rise_time', 'Dummy, total area of all hitlets in event [pe]', 'area', 'Dummy top waveform data in PE/sample (not PE/ns!)', 'data_top', 'Peak widths in range of central area fraction [ns]', 'width', 'Peak widths: time between nth and 5th area decile [ns]', 'area_decile_from_midpoint')"

This should not happen in principle, because this calling https://github.com/AxFoundation/strax/blob/a528e4b9b7d452c6c0a654692ed6fb688b4e3aae/strax/processing/peak_building.py#L243 should have used default arguments store_in_data_top=False, store_waveform_start=False.

There is an expedient to fix this but we'd better understand why this happens: #1447

@dachengx dachengx added the bug Something isn't working label Oct 12, 2024
@dachengx dachengx changed the title Why we can not remove _temp_event_data_type Why we can not remove data_top or data_start from _temp_event_data_type Oct 12, 2024
@dachengx dachengx added the good first issue Good for newcomers label Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant