Open
Conversation
…feature/test-suite
- codes.py: Fix DispersionCode.DONE value collision with HORIZONTAL - response.py: Replace np.concat with np.concatenate - response_matrix.py: Fix disable_all_outputs_but copy-paste bug, fix MICADO UnboundLocalError - bpm_system.py: Fix reconstruct_true_orbit gain inversion - tune.py: Store tune_response_matrix on self - tuning_core.py: Guard wiggle_last_corrector against UnboundLocalError
- bba.py: Fix reject_bpm_outlier np.abs usage, add total_rejections field - bpm_system_conf.py: Fix config pattern matching - general.py: Prevent scale_error_table from mutating input arrays - rf_conf.py: Fix 'frequncy' typo - injection.py: Fix injection tracking - magnetsettings.py: Fix add_individually_powered indentation logic - rdt.py: Fix fjklm phase wrapping
Tests cover all core modules (configuration, core, tuning, apps, utils) with 53 test files providing structural and behavioral coverage.
Pseudo-orbit averages injection TBT data per-BPM across turns, bridging the gap between raw TBT (beam threading) and closed-orbit (stable operation) reading modes. Needed for ALSU commissioning after stitching achieves multi-turn survival. - BPMSystem.capture_pseudo_orbit(): delegates to capture_injection + nanmean - pySCPseudoOrbitInterface: plugs into orbit_correction with orbit RM - Tuning.correct_orbit(pseudo=True, n_turns=N): one-flag switch - Fix pre-existing np.concat bug in fit_dispersive_orbit - Remove commented-out correct_pseudo_orbit_at_injection prototype
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.
Summary
BPMSystem.capture_pseudo_orbit()— injects, tracks N turns, averages per-BPM across turns viananmean. Returns(n_bpms,)arrays matching orbit interface shape.pySCPseudoOrbitInterfacethat plugs directly intoorbit_correction()using the orbit response matrix.Tuning.correct_orbit()withpseudo=True, n_turns=N— one-flag switch from closed-orbit to pseudo-orbit correction.np.concat→np.concatenatebug infit_dispersive_orbit().correct_pseudo_orbit_at_injectionprototype.Motivation
Pseudo-orbit is the natural reading mode between TBT (beam threading) and closed-orbit (stable operation). After stitching achieves multi-turn survival, pseudo-orbit averages out turn-by-turn jitter to give a smoother correction target. This is needed for ALSU accumulator ring commissioning.
@kparasch — I'm open to alternative implementations of this feature, but pseudo-orbit as a first-class reading mode is something we definitely need for ALSU commissioning. It would be nice to have a convenient high-level function for this in pySC. Happy to iterate on the API if you have preferences.
Usage
Test plan
correct_orbit(pseudo=True))