jaxpint.phase#

Phase components for JaxPINT timing models.

class jaxpint.phase.Glitch(n_glitches, glep_names, glph_names, glf0_names, glf1_names, glf2_names, glf0d_names, gltd_names)[source]#

Bases: PhaseComponent

Pulsar glitch phase component.

Parameters:
  • n_glitches (int) – Number of glitches in the model.

  • glep_names (tuple[str, ]) – MJD epoch parameter names, one per glitch (e.g. ("GLEP_1",)).

  • glph_names (tuple[str, ]) – Phase jump, frequency, frequency-derivative, and second frequency-derivative parameter names.

  • glf0_names (tuple[str, ]) – Phase jump, frequency, frequency-derivative, and second frequency-derivative parameter names.

  • glf1_names (tuple[str, ]) – Phase jump, frequency, frequency-derivative, and second frequency-derivative parameter names.

  • glf2_names (tuple[str, ]) – Phase jump, frequency, frequency-derivative, and second frequency-derivative parameter names.

  • glf0d_names (tuple[str, ]) – Decaying-frequency and decay-time-constant parameter names.

  • gltd_names (tuple[str, ]) – Decaying-frequency and decay-time-constant parameter names.

Raises:
  • ValueError – If n_glitches is less than 1.

  • ValueError – If the length of any glitch parameter name tuple does not match n_glitches.

n_glitches: int#
glep_names: tuple[str, ...]#
glph_names: tuple[str, ...]#
glf0_names: tuple[str, ...]#
glf1_names: tuple[str, ...]#
glf2_names: tuple[str, ...]#
glf0d_names: tuple[str, ...]#
gltd_names: tuple[str, ...]#
class jaxpint.phase.IFunc(interp_type, control_mjds, control_delays, f0_name='F0')[source]#

Bases: PhaseComponent

Interpolation function model.

Parameters:
  • interp_type (int) – Interpolation type: 0 = piecewise constant, 2 = linear.

  • control_mjds (array, shape (n_points,)) – MJD control-point times (sorted, ascending).

  • control_delays (array, shape (n_points,)) – Delay values at control points (seconds).

  • f0_name (str) – Name of the spin frequency parameter (default "F0").

Raises:
  • ValueError – If interp_type is not 0 or 2.

  • ValueError – If fewer than one control point is provided.

interp_type: int#
control_mjds: tuple[float, ...]#
control_delays: tuple[float, ...]#
f0_name: str = 'F0'#
class jaxpint.phase.PhaseJump(jump_param_names, f0_name='F0')[source]#

Bases: PhaseComponent

Arbitrary phase jumps applied to TOA subsets.

Each jump parameter value is in seconds and is converted to phase (cycles) by multiplying by F0. The boolean mask for each jump is looked up from toa_data.flag_masks[jump_name].

Parameters:
  • jump_param_names (tuple[str, ]) – Names of the JUMP parameters in the ParameterVector, e.g. ("JUMP1", "JUMP2", "JUMP3").

  • f0_name (str) – Name of the spin frequency parameter (default "F0").

Raises:

ValueError – If no JUMP parameters are provided (jump_param_names is empty).

jump_param_names: tuple[str, ...]#
f0_name: str = 'F0'#
class jaxpint.phase.PiecewiseSpindown(n_pieces, pwstart_names, pwstop_names, pwep_names, pwph_names, pwf0_names, pwf1_names, pwf2_names)[source]#

Bases: PhaseComponent

Piecewise Taylor-expansion spindown model.

Parameters:
  • n_pieces (int) – Number of piecewise segments.

  • pwstart_names (tuple[str, ]) – Names of segment start epoch parameters (MJD).

  • pwstop_names (tuple[str, ]) – Names of segment stop epoch parameters (MJD).

  • pwep_names (tuple[str, ]) – Names of segment reference epoch parameters (MJD).

  • pwph_names (tuple[str, ]) – Names of segment phase offset parameters (dimensionless cycles).

  • pwf0_names (tuple[str, ]) – Names of segment frequency parameters (Hz).

  • pwf1_names (tuple[str, ]) – Names of segment frequency derivative parameters (Hz/s).

  • pwf2_names (tuple[str, ]) – Names of segment second derivative parameters (Hz/s^2).

Raises:
  • ValueError – If n_pieces is less than 1.

  • ValueError – If the length of any segment parameter name tuple does not match n_pieces.

n_pieces: int#
pwstart_names: tuple[str, ...]#
pwstop_names: tuple[str, ...]#
pwep_names: tuple[str, ...]#
pwph_names: tuple[str, ...]#
pwf0_names: tuple[str, ...]#
pwf1_names: tuple[str, ...]#
pwf2_names: tuple[str, ...]#
class jaxpint.phase.Spindown(spin_param_names, pepoch_name='PEPOCH')[source]#

Bases: PhaseComponent

Polynomial spindown phase component.

Parameters:
  • spin_param_names (tuple[str, ]) – Names of the spin-frequency parameters in the ParameterVector, ordered by derivative index. E.g. ("F0",) or ("F0", "F1", "F2").

  • pepoch_name (str) – Name of the reference-epoch parameter (default "PEPOCH").

Raises:
  • ValueError – If no spin terms are provided (spin_param_names is empty).

  • ValueError – If the first spin term is not 'F0'.

spin_param_names: tuple[str, ...]#
pepoch_name: str = 'PEPOCH'#
change_pepoch(params, new_epoch_int, new_epoch_frac)[source]#

Re-derive spin parameters at a new reference epoch.

The physical prediction is invariant: only the Taylor coefficients and PEPOCH change so that the expansion is centred at the new epoch.

Note

Not JIT-compatible (modifies static epoch_int_values). Intended for model setup, not inner-loop computation.

Parameters:
  • params (ParameterVector) – Current parameter values.

  • new_epoch_int (float) – Integer MJD day of the new epoch.

  • new_epoch_frac (float) – Fractional MJD day of the new epoch.

Returns:

Updated with new PEPOCH and recomputed F-terms.

Return type:

ParameterVector

class jaxpint.phase.Wave(n_terms, wave_sin_names, wave_cos_names, waveepoch_name='WAVEEPOCH', wave_om_name='WAVE_OM', f0_name='F0')[source]#

Bases: PhaseComponent

Legacy WAVE timing noise model.

Parameters:
  • n_terms (int) – Number of WAVE terms (harmonic pairs).

  • waveepoch_name (str) – Name of the reference epoch parameter.

  • wave_om_name (str) – Name of the base angular frequency parameter (rad/day).

  • wave_sin_names (tuple[str, ]) – Names of sine amplitude parameters (seconds). These are the WAVEn_A entries produced by the bridge from PINT’s pairParameter splitting.

  • wave_cos_names (tuple[str, ]) – Names of cosine amplitude parameters (seconds). These are the WAVEn_B entries.

  • f0_name (str) – Name of the spin frequency parameter (default "F0").

Raises:
  • ValueError – If n_terms is less than 1.

  • ValueError – If the length of wave_sin_names or wave_cos_names does not match n_terms.

n_terms: int#
wave_sin_names: tuple[str, ...]#
wave_cos_names: tuple[str, ...]#
waveepoch_name: str = 'WAVEEPOCH'#
wave_om_name: str = 'WAVE_OM'#
f0_name: str = 'F0'#