Skip to content

fix: name FDJUMP parameters by coefficient, not storage slot - #86

Open
vhaasteren wants to merge 1 commit into
vallis:masterfrom
vhaasteren:fix/fdjump
Open

fix: name FDJUMP parameters by coefficient, not storage slot#86
vhaasteren wants to merge 1 commit into
vallis:masterfrom
vhaasteren:fix/fdjump

Conversation

@vhaasteren

@vhaasteren vhaasteren commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Name frequency FDJUMPs from tempo2 fdjumpIdx (the frequency power), not from the insertion-order slot.
  • Keep FDJUMPDM{k} as an occurrence count among DM jumps; repeated masks of the same coefficient become FDJUMP{p}_{q}.
  • Leave subct as the tempo2 array slot so fitting / design-matrix derivatives stay pointed at the right term.

Why

Tempo2 stores the physical identity of each fdjump in fdjumpIdx (p for the frequency power, -2 for FDJUMPDM) and only uses the array index as file order. Residuals, the fitter, and tempo2’s own writer already use fdjumpIdx.

libstempo named frequency terms FDJUMP{slot}. That is harmless when slot equals coefficient (the common FDJUMP1, FDJUMP2, FDJUMPDM order). It is wrong when FDJUMPDM is stored first, when coefficients are sparse (FDJUMP3 only), or when FD1JUMP / FD2JUMP are appended after a DM term. In those cases coefficient 1 was published as FDJUMP2.

Details

Input order Old names New names
FDJUMP1, FDJUMP2, FDJUMPDM FDJUMP1, FDJUMP2, FDJUMPDM1 unchanged
FDJUMPDM, FDJUMP1, FDJUMP2 FDJUMPDM1, FDJUMP2, FDJUMP3 FDJUMPDM1, FDJUMP1, FDJUMP2
only FDJUMP3 FDJUMP1 FDJUMP3
two FDJUMP1 masks FDJUMP1, FDJUMP2 FDJUMP1, FDJUMP1_2

FDJUMP1_2 is an in-memory suffix. Tempo2 par syntax does not encode the mask occurrence. A duplicate generated name now raises RuntimeError instead of silently overwriting pardict.

Not changed: ordinary JUMP{ct} naming, subct, tempo2 fdjumpIdx assignment, and emitting FDxJUMP from fdjump_pint_format (that flag is file-global and is set by FDJUMPLOG even on FDJUMPn files).

CI

These tests need tempo2 >= 2024.02.1 (FDJUMPDM / FDJUMP_SCALE; added 2024-02-15, first tag 2024.02.1).

GitHub Actions uses install_tempo2.sh, which still installs 2021.07.1-correct. That build parses FDJUMPn and fdjumpIdx, but it does not recognize FDJUMPDM (the DM suffix fails sscanf and the line is dropped). That is the ('FDJUMP3', 'FDJUMP1') vs ('FDJUMPDM1', 'FDJUMP3', 'FDJUMP1') failure.

Tempo2 keeps the frequency power in fdjumpIdx and only uses the array
index as insertion order. Naming FDJUMP{slot} made DM-first or sparse
models expose the wrong public labels, so MetaPulsar could not match
chart identities such as FDJUMP1_1.
@vhaasteren vhaasteren added the bug label Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant