pint.models.wavex.WaveX
- class pint.models.wavex.WaveX[source]
Bases:
DelayComponentImplementation of the wave model as a delay correction, with 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 method described in Lentati et al. (2013). This model is similar to the TEMPO2 WAVE model parameters and users can convert a
TimingModelwith aWavemodel to aWaveXmodel and produce the same results. The main differences are that theWaveXfrequencies 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 separateprefixParameterrather than as a singlepint.models.parameter.pairParameter.Analogous parameters in both models have the same units:
WAVEEPOCHis the same asWXEPOCHWAVEOMandWXFREQ_000Nhave units of 1/dWAVENandWXSIN_000N/WXCOS_000Nhave units of seconds
The
pint.utilsfunctionstranslate_wave_to_wavex()andtranslate_wavex_to_wave()can be used to go back and forth between two model.WARNING: If the choice of
WaveXfrequencies in aTimingModeldoesn’t correspond to harmonics of some base freqeuncy, it will not be possible to convert it to aWavemodel.To set up a
WaveXmodel, users can use thepint.utilsfunctionwavex_setup()with either a list of frequencies or a choice of harmonics of a base frequency determined by2 * pi /TimespanReferences
Lentati et al. (2013), PRD, 87, 104021 [1]
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 Parameter subtype.
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.
categorycomponent_typesReturn the free parameters in the component.
param_prefixsregister- 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: Parameter, deriv_func: Callable | None = None, setup: bool = 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: Dict[str, str]
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: List[str]
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: str) List[str]
Get all the parameters in timing model for one specific Parameter subtype.
- get_prefix_mapping_component(prefix: str) Dict[int, str]
Get the index mapping for the prefix parameters.
- is_in_parfile(para_dict: Dict) bool
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: str) str
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().
- print_par(format: Literal['tempo', 'tempo2', 'pint'] = 'pint') str
- 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