Injection Auditing, T1 Candidate Dumping, Updated Trigger Logic, Offline T2 Script, and Bug Fixes#21
Conversation
… if candidate is an injection
caseyjlaw
reviewed
Dec 5, 2025
Contributor
caseyjlaw
left a comment
There was a problem hiding this comment.
Great set of changes. Very happy to have your eyes on this and fixing the tests is much appreciated!
Contributor
|
@vishnubk I've made one more commit to get it to merge. Be sure to merge main back into your development branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces new optional features, updates the trigger logic of T2 for injections, adds an offline T2 replay script, and some bug fixes.
New Features
1. Injection Auditing
Enabled with
--audit_injections.When active, the system tracks each injected FRB as it passes (or fails) through the major T2 gates. It maintains:
audit_log_<date>.csv)injections.csv)state/<inj_id>.json) when--audit_dump_jsonis setEach injection is evaluated through the T2 decision path using a simple state model:
Gates tracked:
This provides a clear diagnostic trail for injection testing and is useful for validating different parts of the T2 pipeline.
2. T1 Candidate Dumping
Enabled with
--dump_t1.Raw T1 candidates can now be written to disk for offline debugging and replay. Appends a single file for each day
t1_candidates_<date>.csv.--t1_dump_dircontrols the output location (default is/operations/T2/cluster_output/).3. Offline T2 Script (
offline_t2.py)Added
offline_t2.py, a standalone tool for evaluating any version of T2 entirely offline:It reads previously dumped T1 candidate files and runs them through the T2 decision logic, producing a record of what T2 would have triggered.
This is very useful for:
Improvements
Updated Injection Script
The injection service should now use
new_injection_script.py, replacing the olderdsa_injection.py.The new script:
Trigger Handling During Injections
Suppresses voltage triggers for injected events. This logic has also been implemented for flush triggers.
Bug Fixes
Empty Gulp Handling
A gulp with zero candidates now appends
0tonbeams_queue.This prevents long cooldown stalls after RFI storms and improves overall T2 up-time.
Single-arm SNR logic has been corrected.
Previously, the single-arm SNR check inside
filter_clusteredwas applied at a global level, which would produce incorrect behavior in some edge cases.The updated implementation applies the SNR thresholds per candidate using boolean masks, and the two-arm and one-arm logic is now evaluated consistently on a row-by-row basis.
Fixed pytests not building
Additional small support files were added to allow all existing and new
pytesttests to pass given the new module layout and options.Future Work
Consolidate logging across modules. There are still redundant
printandlogger.infostatements that should be replaced with justlogger.info/logger.debugcalls. Before doing this, need to revisit howDsaSysloggerattaches handlers to avoid duplication.Extend the injection script so NS and EW arms use different scale factors, and tie those scale factors more directly to the requested SNR.