pint.models.jump.PhaseJump

class pint.models.jump.PhaseJump[source]

Bases: PhaseComponent

Arbitrary jumps in pulse phase.

In spite of the name, the amounts here are specified in seconds and converted to phase using F0.

Parameters supported:

Name / Aliases

Description

Kind

JUMP {flag} {value}

Phase jump for selection.

s

Methods

add_jump_and_flags(toa_table)

Add jump object to PhaseJump and appropriate flags to TOA tables.

add_param(param[, deriv_func, setup])

Add a parameter to the Component.

d_phase_d_jump(toas, jump_param, delay)

delete_not_all_jump_toas(toa_flags, jump_num)

Unjumps the selected TOAs if they are already jumped. This is only called

get_jump_param_objects()

Returns a list of the maskParameter objects representing the jumps in this PhaseJump object.

get_number_of_jumps()

Returns the number of jumps contained in this PhaseJump object.

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.

jump_params_to_flags(toas)

Take jumps created from .par file and add appropriate flags to toa table.

jump_phase(toas, delay)

This method returns the jump phase for each toas section collected by jump parameters.

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.

jump_phase(toas, delay)[source]

This method returns the jump phase for each toas section collected by jump parameters. The phase value is determined by jump parameter times F0.

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

get_number_of_jumps()[source]

Returns the number of jumps contained in this PhaseJump object.

get_jump_param_objects()[source]

Returns a list of the maskParameter objects representing the jumps in this PhaseJump object.

jump_params_to_flags(toas)[source]

Take jumps created from .par file and add appropriate flags to toa table.

This function was made specifically with pintk in mind so as to maintain a -jump flag on each TOA that is affected by any JUMP in the model, listing the numbers of all JUMPs affecting that TOA.

This function wipes all -jump flags and re-initializes them to reflect the actual situation.

Parameters:

toas (TOAs object) – The TOAs which contain the TOA table to be modified

add_jump_and_flags(toa_table)[source]

Add jump object to PhaseJump and appropriate flags to TOA tables.

Helper function for pintk. Primarily to be used when applying a jump through pintk to TOAs - since these jumps don’t have keys that match to preexisting flags in the TOA tables, we must add the flags when adding the jump.

Parameters:

toa_table (astropy.table.column.Column) – The TOA table which must be modified. In pintk (pulsar.py), this will be all_toas.table[“flags”][selected]

delete_not_all_jump_toas(toa_flags, jump_num)[source]
Unjumps the selected TOAs if they are already jumped. This is only called

when the selected TOAs are a subset of jumped TOAs with a particular jump.

Parameters:
  • toa_flags (astropy.table.column.Column) – The TOA table which must be modified. In pintk (pulsar.py), this will be all_toas.table["flags"][selected]

  • jump_num (int) – jump that needs to be deleted from the TOAs

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.