-
Notifications
You must be signed in to change notification settings - Fork 0
Restricted window in matching #72
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
Conversation
Introduces a configurable time window (match_window_ms) around waveform maxima for matching hits and truth events in the Match plugin. Updates the plugin to restrict matching to this window if set, adds related configuration for sampling frequency, and provides a test to verify the new option's behavior.
* Use robust std estimate for hit threshold calculation Replaces standard deviation with a robust estimate based on the central 68% (16th-84th percentiles) of the signal distribution when calculating the hit threshold. This change makes the threshold calculation more resistant to extreme values. * Version bump * Fix hit length calculation in DxHits plugin Updated the calculation of 'hit["length"]' to use the number of samples in the record (right_i - left_i) instead of the waveform array size (target_end - target_start), ensuring consistency when endtime is clamped to record boundaries. * Use exact dt for endtime calculations in plugins Updated endtime calculations in QUALIPHIDETHzReader and NX3LikeReader to use the more precise dt_exact value instead of the integer-cast dt. Also clarified the calculation of hit length in DxHits for consistency. * Revert changes on online readout plugin
Pull Request Test Coverage Report for Build 20685140006Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Replaces use of self.dt with self.dt_exact when calculating the chunk end time to ensure more accurate timing based on the exact data type.
Enhanced the _check_endtime_consistency function to use the sampling frequency (fs) for more accurate endtime calculation when available, with a fallback to dt and a tolerance for rounding errors. Updated test_records_data_consistency to pass fs from the context config.
Added a 60-minute timeout to the test job in the GitHub Actions pytest workflow to prevent jobs from running indefinitely.
Updated endtime consistency checks in test_baseline_monitor.py and test_records.py to use dt_exact calculated from sampling frequency (fs) and SECOND_TO_NANOSECOND, ensuring accurate endtime computation in tests.
Introduces a new config option for specifying the template interpolation file path and updates the Match plugin to use an interpolated template for accurate pulse maximum alignment. The calculation of the pulse template argmax is now based on the interpolated template, improving matching precision for different sampling frequencies.
Updated the __version__ attribute of the Match plugin from 0.0.3 to 0.0.4.
Replaces the previous approximation of hit maximum times with a calculation that finds the actual maximum position in each hit's waveform, accounting for waveform padding. This increases the accuracy of hit timing in the plugin.
|
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on February 16. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
Introduces a .cursorrules file outlining mandatory usage of the 'straxion' conda environment for all Python commands and scripts. Provides examples and rationale to prevent dependency issues.
Introduces a new TestMatchRestrictWindow class with comprehensive unit tests for the _restrict_to_maximum_window method in the Match plugin. Tests cover window restriction logic for both hits and truth data, including cases with and without waveform padding, boundary conditions, and behavior with different sampling frequencies.
Before you submit this PR: make sure to put all operations-related information in a wiki-note, a PR should be about code and is publicly accessible
What does the code in this PR do / what does it improve?
Previously, the matching is based on the overlap of the truth and hit. However, that window is a bit too generous, which leads to fake non-zero efficiency at low-energy (due to pile up) and fake non-unitary efficiency at high energy (due to splitting). Now we introduce functionality to reduce the window range. I think 2 ms should be a reasonable window length for this purpose.
Can you briefly describe how it works?
Can you give a minimal working example (or illustrate with a figure)?
Please include the following if applicable:
Notes on testing
All italic comments can be removed from this template.