Support hierarchical triple systems with dual binary components (BINARY + BINARY2) - #2011
Open
vhaasteren wants to merge 18 commits into
Open
Support hierarchical triple systems with dual binary components (BINARY + BINARY2)#2011vhaasteren wants to merge 18 commits into
BINARY + BINARY2)#2011vhaasteren wants to merge 18 commits into
Conversation
Enable a second (outer) binary delay component in a PINT timing model so a pulsar binary can itself orbit a third body. The outer orbit's delay is computed before, and propagated into, the inner binary calculation. - Make PulsarBinary suffix-aware (param_suffix, binary_param_tag, _bp/_hasbp helpers, _apply_param_suffix) so a single implementation serves as both the inner (canonical params) and outer (_2-suffixed params) component. - Route pb() and change_binary_epoch() through _bp()/_hasbp() so the inherited public methods work on suffixed outer components. - Add BinaryDD2 and BinaryBT2 outer wrappers (category pulsar_system_outer, param_suffix _2, BINARY2 tag). - Register BINARY2, order pulsar_system_outer before pulsar_system, and handle BINARY2 selection / validation in TimingModel and ModelBuilder. - Add triple-system par file and tests.
Select the primary binary component by binary_param_tag so orbital phase, pulsar radial velocity, and conjunction computations follow the inner BINARY orbit when BINARY2 is also present. Add a triple-system regression test that validates these utilities match the inner-only model and differ from the outer-orbit phase.
vhaasteren
marked this pull request as draft
June 30, 2026 09:03
A hierarchical triple's outer orbit imposes a slowly varying Doppler
factor on the inner orbit; over a short data span this appears as
secular changes of the inner A1 beyond the linear A1DOT term. A1DOT2
parameterizes the quadratic term:
a1(t) = A1 + A1DOT * (t - T0) + 0.5 * A1DOT2 * (t - T0)**2
Changes:
- new A1DOT2 floatParameter (lsec/s^2) on PulsarBinary, frozen at 0
when unset (BinaryDD.validate, like the other *DOT parameters)
- a1(), d_a1_d_T0, d_a1_d_A1DOT2 and d_Pobs_d_A1DOT2 in the standalone
PSR_BINARY (d_a1_d_T0 now includes the A1DOT2 chain term)
- d_beta_d_A1DOT2 in DDmodel for symmetry with d_beta_d_A1DOT (the
generic d_beta_d_par path chains through d_a1_d_par either way)
- tests: A1DOT2 affects the delay; analytic delay derivatives for
A1DOT2/A1DOT/T0 and outer parameters match finite differences
…t/triple Keep A1DOT2 with the X2DOT alias and retain local A1DOT2 tests.
Complete BINARY2 support for BT and ELL1 so A1DOT2 and the outer→inner prev-delay chain rule match finite-difference tests for all three families.
Chain-ruled d_delay_d_param requires SWX ahead of the binary; without solar_windx in DEFAULT_ORDER it sorted last and broke SW↔SWX fits. Also harden A1DOT parfile checks and Fermi observatory overwrite.
Compute parameter-independent acc_delays/chain_factors via delay_deriv_chain and thread them through designmatrix paths, restoring near-master cost while keeping the binary chain rule. Also harden triple-aware convert_binary, derived-param summary, and MissingParameter names.
…t/triple # Conflicts: # src/pint/models/stand_alone_psr_binaries/binary_generic.py # tests/test_triple_binary.py
Satisfy CI black --check, note solar_windx DEFAULT_ORDER in the changelog, and mention BINARY2 in timing-model docs.
Keep MissingParameter/MissingBinaryError/MissingTOAs re-exported from timing_model (listed in __all__) for existing importers. Remove a dead unreachable return in binary_generic.
Stop re-exporting them from timing_model; point remaining call sites at the canonical module.
vhaasteren
marked this pull request as ready for review
July 31, 2026 08:51
Stops collection failure in test_model_manual after Missing* stopped being re-exported from timing_model.
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
BINARYwith standard parameter names (PB,A1,T0, ...)BINARY2with suffixed parameters (PB_2,A1_2,T0_2, ...)BinaryDD2,BinaryBT2) in a newpulsar_system_outercategory, ordered beforepulsar_systemso outer delay is accumulated first.t_bary - (accumulated delays), so the outer light-travel delay propagates into the inner orbit evaluation epoch.BINARY2, enforce one inner + one outer binary maximum, and round-trip_2parameters correctly._bp()/_hasbp()), enabling fitting and derivative support for outer-orbit parameters without changing standalone binary calculators.Scope / Notes
FBn/ORBWAVEparameterizations.Tests
outerbeforeinner)PBvsPB_2, etc.)BINARY2+_2parfile read/write round-tripExample
Note: co-developed by @coclar and Claude Code.