pint.models.fdjump.FDJump

class pint.models.fdjump.FDJump[source]

Bases: DelayComponent

A timing model for system-dependent frequency evolution of pulsar profiles.

This model expresses the delay as a polynomial function of the observing frequency/logarithm of observing frequency in the SSB frame. This is intended to compensate for the delays introduced by frequency-dependent profile structure when a different profiles are used for different systems.

The default behavior is to have FDJUMPs as polynomials of the observing frequency (rather than log-frequency). This is different from the convention used for global FD parameters. This choice is made to be compatible with tempo2. This is controlled using the FDJUMPLOG parameter. “FDJUMPLOG Y” may not be tempo2-compatible.

Note

FDJUMPs have two indices: the polynomial/FD/prefix index and the system/mask index. i.e., they have properties of both maskParameters such as JUMPs and prefixParameters such as FDs. There is currently no elegant way in PINT to implement such parameters due to the way parameter indexing is implemented; there is no way to distinguish between mask and prefix indices.

Hence, they are implemented here as maskParameters as a stopgap measure. This means that there must be an upper limit for the FD indices. This is controlled using the pint.models.fdjump.fdjump_max_index variable, and is 20 by default. Note that this is strictly a limitation of the implementation and not a property of FDJUMPs themselves.

FDJUMPs appear in tempo2-format par files as “FDJUMPp”, where p is the FD index. The mask index is not explicitly mentioned in par files similar to JUMPs. PINT understands both “FDJUMPp” and “FDpJUMP” as the same parameter in par files, but the internal representation is always “FDpJUMPq”, where q is the mask index.

PINT understands ‘q’ as the mask parameter just fine, but the identification of ‘p’ as the prefix parameter is done in a hacky way.

This implementation may be overhauled in the future.

Parameters supported:

Name / Aliases

Description

Kind

FDJUMPLOG

Whether to use log-frequency (Y) or linear-frequency (N) for computing FDJUMPs.

boolean

FD1JUMP {flag} {value}

System-dependent FD parameter of polynomial index 1

s

FD2JUMP {flag} {value}

System-dependent FD parameter of polynomial index 2

s

FD3JUMP {flag} {value}

System-dependent FD parameter of polynomial index 3

s

FD4JUMP {flag} {value}

System-dependent FD parameter of polynomial index 4

s

FD5JUMP {flag} {value}

System-dependent FD parameter of polynomial index 5

s

FD6JUMP {flag} {value}

System-dependent FD parameter of polynomial index 6

s

FD7JUMP {flag} {value}

System-dependent FD parameter of polynomial index 7

s

FD8JUMP {flag} {value}

System-dependent FD parameter of polynomial index 8

s

FD9JUMP {flag} {value}

System-dependent FD parameter of polynomial index 9

s

FD10JUMP {flag} {value}

System-dependent FD parameter of polynomial index 10

s

FD11JUMP {flag} {value}

System-dependent FD parameter of polynomial index 11

s

FD12JUMP {flag} {value}

System-dependent FD parameter of polynomial index 12

s

FD13JUMP {flag} {value}

System-dependent FD parameter of polynomial index 13

s

FD14JUMP {flag} {value}

System-dependent FD parameter of polynomial index 14

s

FD15JUMP {flag} {value}

System-dependent FD parameter of polynomial index 15

s

FD16JUMP {flag} {value}

System-dependent FD parameter of polynomial index 16

s

FD17JUMP {flag} {value}

System-dependent FD parameter of polynomial index 17

s

FD18JUMP {flag} {value}

System-dependent FD parameter of polynomial index 18

s

FD19JUMP {flag} {value}

System-dependent FD parameter of polynomial index 19

s

FD20JUMP {flag} {value}

System-dependent FD parameter of polynomial index 20

s

Methods

add_param(param[, deriv_func, setup])

Add a parameter to the Component.

d_delay_d_FDJUMP(toas, param[, acc_delay])

Derivative of delay w.r.t.

fdjump_delay(toas[, acc_delay])

Calculate frequency dependent delay.

get_fd_index(par)

Extract the FD index from an FDJUMP parameter name.

get_freq_y(toas)

Get frequency or log-frequency in GHz based on the FDJUMPLOG value.

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.

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.

get_fd_index(par)[source]

Extract the FD index from an FDJUMP parameter name. In a parameter name “FDpJUMPq”, p is the FD/prefix index and q is the mask index.

Parameters:

par (Parameter name (str)) –

Return type:

FD index (int)

get_freq_y(toas)[source]

Get frequency or log-frequency in GHz based on the FDJUMPLOG value. Returns (freq/1_GHz) if FDJUMPLOG==N and log(freq/1_GHz) if FDJUMPLOG==Y. Any non-finite values are replaced by zero.

Parameters:

toas (pint.toa.TOAs) –

Return type:

(freq/1_GHz) or log(freq/1_GHz) depending on the value of FDJUMPLOG (float).

fdjump_delay(toas, acc_delay=None)[source]

Calculate frequency dependent delay.

If FDJUMPLOG is Y, use the following expression (similar to global FD parameters):

FDJUMP_delay = sum_i(c_i * (log(obs_freq/1GHz))^i)

If FDJUMPLOG is N, use the following expression (same as in tempo2, default):

FDJUMP_delay = sum_i(c_i * (obs_freq/1GHz)^i)

d_delay_d_FDJUMP(toas, param, acc_delay=None)[source]

Derivative of delay w.r.t. FDJUMP parameters.

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()

Validate loaded values.

validate_toas(toas)

Check that this model component has TOAs where needed.