pint.models.spindown.Spindown

class pint.models.spindown.Spindown[source]

Bases: SpindownBase

A simple timing model for an isolated pulsar.

This represents the pulsar’s spin as a Taylor series, given its derivatives at time PEPOCH. Using more than about twelve derivatives leads to hopeless numerical instability, and probably has no physical significance. It is probably worth investigating timing noise models if this many derivatives are needed.

Parameters supported:

Name / Aliases

Description

Kind

F{number}

Spin-frequency

Hz

PEPOCH

Reference epoch for spin-down

d

Methods

F_description(n)

Template function for description

F_unit(n)

Template function for unit

add_param(param[, deriv_func, setup])

Add a parameter to the Component.

change_pepoch(new_epoch[, toas, delay])

Move PEPOCH to a new time and change the related parameters.

d_phase_d_F(toas, param, delay)

Calculate the derivative wrt to an spin term.

d_spindown_phase_d_delay(toas, delay)

get_dt(toas, delay)

Return dt, the time from the phase 0 epoch to each TOA.

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.

get_spin_terms()

Return a list of the spin term values in the model: [F0, F1, ..., FN].

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.

spindown_phase(toas, delay)

Spindown phase function.

validate()

Validate loaded values.

validate_toas(toas)

Check that this model component has TOAs where needed.

Attributes

F_terms

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.

F_description(n)[source]

Template function for description

F_unit(n)[source]

Template function for unit

get_spin_terms()[source]

Return a list of the spin term values in the model: [F0, F1, …, FN].

get_dt(toas, delay)[source]

Return dt, the time from the phase 0 epoch to each TOA. The phase 0 epoch is assumed to be PEPOCH. If PEPOCH is not set, the first TOA in the table is used instead.

Note, the phase 0 epoch as used here is only intended for computation internal to the Spindown class. The “traditional” tempo-style TZRMJD and related parameters for specifying absolute pulse phase will be handled at a higher level in the code.

spindown_phase(toas, delay)[source]

Spindown phase function.

delay is the time delay from the TOA to time of pulse emission

at the pulsar, in seconds.

This routine should implement Eq 120 of the Tempo2 Paper II (2006, MNRAS 372, 1549)

returns an array of phases in long double

change_pepoch(new_epoch, toas=None, delay=None)[source]

Move PEPOCH to a new time and change the related parameters.

Parameters:
  • new_epoch (float or astropy.Time object) – The new PEPOCH value.

  • toas (toa object, optional.) – If current PEPOCH is not provided, the first pulsar frame toa will be treated as PEPOCH.

  • delay (numpy.array object) – If current PEPOCH is not provided, it is required for computing the first pulsar frame toa.

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

d_phase_d_F(toas, param, delay)[source]

Calculate the derivative wrt to an spin term.

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.