Normalize hybrid/sparse binary FB expansions and allow signed-H3 DDH fits - #2023
Open
vhaasteren wants to merge 3 commits into
Open
Normalize hybrid/sparse binary FB expansions and allow signed-H3 DDH fits#2023vhaasteren wants to merge 3 commits into
vhaasteren wants to merge 3 commits into
Conversation
Make FBX the canonical period parameterization when FB terms are present, reject DDGR+FBX, keep consumer APIs (pb/convert/BT) working with derived PB, and add regression tests.
This was referenced Jul 25, 2026
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.
Description
Two classes of published PTA timing models are mathematically well-defined but
currently rejected or incompletely represented by PINT (issue #2022 ).
1. Canonical orbital-frequency Taylor series
The binary orbital phase can be written as the number of elapsed orbits
where
dt = t - Trefin seconds. The period representation supplies the firsttwo coefficients through
Some published tempo2 par files use
PBfor the constant term while supplyingFB1,FB2, ... directly. PPTA DR2/DR3 J2241−5236, for example, providesPB + FB1...FB17but noFB0. Tempo2 evaluates that file by using1/PBas the constant orbital frequency. PINT previously rejected it becauseits FBX implementation required an explicit
FB0.This PR normalizes every such model to one canonical FBX representation:
PBis converted exactly to the nominalFB0;PBDOTis converted toFB1when no explicitFB1exists;FB1wins over redundantPBDOT, with a warning;PBand, whenFB1is present,PBDOTremain available as read-onlyderived views.
An explicitly valued ordinary
PBtogether with an explicitly valued ordinaryFB0remains an error and is rejected before normalization mutates the model.For an existing pure-FBX model, this canonicalization is an API/output change:
PBand applicablePBDOTvalues become derived views,as_parfile()gains commented# PB/# PBDOTlines, and an unset writablePBDOTthat the FBX orbit would ignore is removed.Treating a missing interior coefficient as zero is important physically. For
example,
means
not “ignore FB2.” PINT's previous
OrbitFBXimplementation could silentlydrop
FB2+after a missing index. This PR fixes that independent bug and addsequation-level phase tests ensuring that every supplied coefficient actually
contributes.
Tempo2 ELL1 currently uses the presence of
FB1as a sentinel for the entirehigher-FB branch, so it ignores
FB2+whenFB1is omitted. PINT intentionallyuses the complete Taylor-series interpretation instead. The published
J2241−5236 model has a contiguous series and therefore remains exactly
tempo2-compatible.
The intentional timing deviations from current tempo2 are limited and
explicit:
PB + FB2andFB0 + FB2: PINT usesFB2with an insertedFB1=0;tempo2 ELL1 currently ignores
FB2;PB + PBDOT + FB2: PINT applies both the equivalentFB1andFB2;tempo2 applies only the PBDOT-equivalent term;
machinery;
PBand ignoresFBn. The companion tempo2 PR should reject thisunsupported combination too.
Conversely,
FB0 + PBDOThas the same nominal phase in tempo2 ELL1 and in thenew PINT representation: PINT now converts it to
FB1instead of silentlyignoring it as current PINT does. A companion tempo2 issue/PR will replace the
FB1sentinel with the same complete-series rule so the sparse cases convergeback to compatibility.
FBX is treated as the complete orbital-phase parameterization for every PINT
binary model that supports it, not as an additive correction to PB/PBDOT.
Accordingly, dynamically derived values such as DDGR's GR prediction for
PBDOTare never evaluated once and copied into an independentFB1; doing sowould become stale when masses change.
This PR explicitly rejects DDGR+FBX. A tempting normalization is to insert
FB1=0and expose FB-derivedPBDOT=0, but that fixes only the phase label:DDGR derives post-Keplerian quantities directly from
PB, and its analyticderivatives are expressed with respect to
PB. A physically correct FBXimplementation must keep those quantities synchronized through
PB=1/(86400 FB0)and addUntil that larger change is implemented and derivative-tested, accepting the
combination would produce an internally inconsistent timing model. A valued
XPBDOTwith FBX is likewise rejected until a dynamic combination rule isexplicitly designed.
The nominal phase transformation is exact. Reported marginal uncertainties are
mapped with the first-order Jacobian:
The nonlinear change also creates
FB0–FB1covariance that a par file cannotrepresent; this PR does not claim lossless covariance transfer.
2. DDH with a signed weak-signal H3 estimate
The DDH orthometric parameters map to the traditional Shapiro quantities as
For finite positive
STIGMA, the Shapiro delay iswhere
Bis the usual DD orbital geometry term. WhereverB>0, the delay islinear and smooth in
H3, including throughH3=0; changing the sign ofH3does not change the logarithm's domain.
For a weak or absent Shapiro signal, an unconstrained amplitude estimate can
legitimately cross zero. MPTA DR2 J1825−0319 has such a best fit:
The corresponding derived
M2is negative. That is not a physical companionmass, but rejecting the model also rejects a finite, differentiable signed
amplitude fit that tempo2 can evaluate. It prevents faithful residual
comparison and can prevent a fitter from crossing the zero-signal point.
This PR therefore allows negative
H3inBinaryDDHand warns that thenegative derived
M2has no physical mass interpretation. The exception isspecific to DDH's smooth signed-
H3extension:M2still raises;SINIvalidation is unchanged;STIGMAmust remain finite and positive;STIGMA=0is rejected because the model contains inverse powers of it;funcParameterexemption.Tempo2 evaluates negative
H3without PINT's derived-mass gate, so the nominalDDH delay remains compatible. PINT intentionally remains stricter for
STIGMA<=0: negative values are outside the adopted physical domain and zerois singular.
With the prototype normalization, the published PPTA DR3 J2241−5236 dataset
loads with finite residuals at approximately 0.821 µs RMS, and the MPTA DR2
J1825−0319 dataset loads as DDH with approximately 5.677 µs RMS, matching the
tempo2/libstempo timing evidence used to motivate the change.
Scope and tests
The implementation is confined to binary-parameter normalization, FBX gap
validation, DDH-native validation, documentation, and tests. Tests cover sparse
series, phase equivalence, uncertainties, fit flags, serialization,
idempotency, TCB conversion, general binary models, DDGR+FBX rejection before
mutation, negative-H3 continuity and fitting, and unchanged free-M2/SINI
validation.
Reported by Wang-Wei Yu @Wang-weiYu during IPTA DR3 / 5-PTA combination testing with
the updated MetaPulsar version.