pint.models.ifunc.IFunc

class pint.models.ifunc.IFunc[source]

Bases: PhaseComponent

This class implements tabulated delays.

These mimic a tempo2 feature, which supports piecewise, linear, and sinc interpolation. The implementation here currently only supports the first two formulae.

For consistency with tempo2, although the IFuncs represent time series, they are converted to phase simply by multiplication with F0, therefore changing PEPOCH should be done with care.

The format of IFuncs in an ephemeris is:

SIFUNC X 0
IFUNC1 MJD1 DT1 0.0
IFUNC2 MJD2 DT2 0.0
...
IFUNCN MJDN DTN 0.0

X indicates the type of interpolation:

  • 0 == piecewise constant (no interpolation)

  • 1 == sinc (not supported)

  • 2 == linear

NB that the trailing 0.0s are necessary for accurate tempo2 parsing. NB also that tempo2 has a static setting MAX_IFUNC whose default value is 1000.

Note that in tempo2, the interpolants are formed from the sidereal arrival time, which means that different observatories actually see different timing noise processes! Here, we interpret the “x axis” as barycentered times, so that all observatories see the same realization of the interpolated signal. Because the interpolant spacing is typically large (days to weeks), the difference between SAT and BAT of a few minutes should make little difference.

Parameters supported:

Name / Aliases

Description

Kind

SIFUNC

Type of interpolation

number

IFUNC{number}

Interpolation control point pair (MJD, delay)

s

Methods

add_param(param[, deriv_func, setup])

Add a parameter to the Component.

get_params_of_type(param_type)

Get all the parameters in timing model for one specific type.

get_prefix_mapping_component(prefix)

Get the index mapping for the prefix parameters.

ifunc_phase(toas, delays)

is_in_parfile(para_dict)

Check if this subclass included in parfile.

match_param_aliases(alias)

Return the parameter corresponding to this alias.

param_help()

Print help lines for all available parameters in model.

print_par([format])

param format:

Parfile output format. PINT outputs the 'tempo', 'tempo2' and 'pint'

register_deriv_funcs(func, param)

Register the derivative function in to the deriv_func dictionaries.

remove_param(param)

Remove a parameter from the Component.

set_special_params(spcl_params)

setup()

Finalize construction loaded values.

validate()

Validate loaded values.

validate_toas(toas)

Check that this model component has TOAs where needed.

Attributes

aliases_map

Return all the aliases and map to the PINT parameter name.

category

component_types

free_params_component

Return the free parameters in the component.

param_prefixs

register

setup()[source]

Finalize construction loaded values.

validate()[source]

Validate loaded values.

print_par(format='pint')[source]
Parameters:

format (str, optional) – Parfile output format. PINT outputs the ‘tempo’, ‘tempo2’ and ‘pint’ format. The defaul format is pint. Actual formatting done elsewhere.

Returns:

str

Return type:

formatted line for par file

add_param(param, deriv_func=None, setup=False)

Add a parameter to the Component.

The parameter is stored in an attribute on the Component object. Its name is also recorded in a list, self.params.

Parameters:
  • param (pint.models.Parameter) – The parameter to be added.

  • deriv_func (function) – Derivative function for parameter.

property aliases_map

Return all the aliases and map to the PINT parameter name.

This property returns a dictionary from the current in timing model parameters’ aliase to the pint defined parameter names. For the aliases of a prefixed parameter, the aliase with an existing prefix index maps to the PINT defined parameter name with the same index. Behind the scenes, the indexed parameter adds the indexed aliase to its aliase list.

property free_params_component

Return the free parameters in the component.

This function collects the non-frozen parameters.

Return type:

A list of free parameters.

get_params_of_type(param_type)

Get all the parameters in timing model for one specific type.

get_prefix_mapping_component(prefix)

Get the index mapping for the prefix parameters.

Parameters:

prefix (str) – Name of prefix.

Returns:

A dictionary with prefix parameter real index as key and parameter name as value.

Return type:

dict

is_in_parfile(para_dict)

Check if this subclass included in parfile.

Parameters:

para_dict (dictionary) – A dictionary contain all the parameters with values in string from one parfile

Returns:

Whether the subclass is included in the parfile.

Return type:

bool

match_param_aliases(alias)

Return the parameter corresponding to this alias.

Parameters:

alias (str) – Alias name.

Note

This function only searches the parameter aliases within the current component. If one wants to search the aliases in the scope of TimingModel, please use TimingModel.match_param_aliase().

param_help()

Print help lines for all available parameters in model.

register_deriv_funcs(func, param)

Register the derivative function in to the deriv_func dictionaries.

Parameters:
  • func (callable) – Calculates the derivative

  • param (str) – Name of parameter the derivative is with respect to

remove_param(param)

Remove a parameter from the Component.

Parameters:

param (str or pint.models.Parameter) – The parameter to remove.

validate_toas(toas)

Check that this model component has TOAs where needed.