pint.models.wavex.WaveX
- class pint.models.wavex.WaveX[source]
Bases:
DelayComponent
Implementation of the wave model as a delay correction
Delays are expressed as a sum of sinusoids.
Used for decomposition of timing noise into a series of sine/cosine components with the amplitudes as fitted parameters.
Parameters supported:
Name / Aliases
Description
Kind
WXEPOCH
Reference epoch for Fourier representation of red noise
d
WXFREQ_{number}
Component frequency for Fourier representation of red noise
1 / d
WXSIN_{number}
Sine amplitudes for Fourier representation of red noise
s
WXCOS_{number}
Cosine amplitudes for Fourier representation of red noise
s
This is an extension of the L13 method described in Lentati et al., 2013 doi: 10.1103/PhysRevD.87.104021 This model is similar to the TEMPO2 WAVE model parameters and users can convert a TimingModel with a Wave model to a WaveX model and produce the same results. The main differences are that the WaveX frequencies are explicitly stated, they do not necessarily need to be harmonics of some base frequency, the wave amplitudes are fittable parameters, and the sine and cosine amplutides are reported as separate prefixParameter`s rather than as a single `pairParameter.
Analogous parameters in both models have the same units: WAVEEPOCH is the same as WXEPOCH WAVEOM and WXFREQ_000N have units of 1/d WAVEN and WXSIN_000N/WXCOS_000N have units of seconds
The pint.utils functions translate_wave_to_wavex() and translate_wavex_to_wave() can be used to go back and forth between two model.
WARNING: If the choice of WaveX frequencies in a TimingModel doesn’t correspond to harmonics of some base freqeuncy, it will not be possible to convert it to a Wave model.
To set up a WaveX model, users can use the pint.utils function wavex_setup() with either a list of frequencies or a choice of harmonics of a base frequency determined by 2 * pi /Timespan
Methods
add_param
(param[, deriv_func, setup])Add a parameter to the Component.
add_wavex_component
(wxfreq[, index, wxsin, ...])Add WaveX component
add_wavex_components
(wxfreqs[, indices, ...])Add WaveX components with specified base frequencies
d_wavex_delay_d_WXCOS
(toas, param, delays[, ...])d_wavex_delay_d_WXSIN
(toas, param, delays[, ...])Returns an array of intergers corresponding to WaveX component parameters using WXFREQs
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.
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.
remove_wavex_component
(index)Remove all WaveX components associated with a given index or list of indices
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.
wavex_delay
(toas, delays)Attributes
Return all the aliases and map to the PINT parameter name.
category
component_types
Return the free parameters in the component.
param_prefixs
register
- add_wavex_component(wxfreq, index=None, wxsin=0, wxcos=0, frozen=True)[source]
Add WaveX component
- Parameters:
wxfreq (float or astropy.quantity.Quantity) – Base frequency for WaveX component
index (int, None) – Interger label for WaveX component. If None, will increment largest used index by 1.
wxsin (float or astropy.quantity.Quantity) – Sine amplitude for WaveX component
wxcos (float or astropy.quantity.Quantity) – Cosine amplitude for WaveX component
frozen (iterable of bool or bool) – Indicates whether wavex will be fit
- Returns:
index – Index that has been assigned to new WaveX component
- Return type:
- add_wavex_components(wxfreqs, indices=None, wxsins=0, wxcoses=0, frozens=True)[source]
Add WaveX components with specified base frequencies
- Parameters:
wxfreqs (iterable of float or astropy.quantity.Quantity) – Base frequencies for WaveX components
indices (iterable of int, None) – Interger labels for WaveX components. If None, will increment largest used index by 1.
wxsins (iterable of float or astropy.quantity.Quantity) – Sine amplitudes for WaveX components
wxcoses (iterable of float or astropy.quantity.Quantity) – Cosine amplitudes for WaveX components
frozens (iterable of bool or bool) – Indicates whether sine and cosine amplitudes of wavex components will be fit
- Returns:
indices – Indices that have been assigned to new WaveX components
- Return type:
- remove_wavex_component(index)[source]
Remove all WaveX components associated with a given index or list of indices
- get_indices()[source]
Returns an array of intergers corresponding to WaveX component parameters using WXFREQs
- Returns:
inds (np.ndarray)
Array of WaveX indices in model.
- 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.
- 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:
- 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.
- print_par(format='pint')
- 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