pint.models.noise_model.TimeDomainSWNoise
- class pint.models.noise_model.TimeDomainSWNoise[source]
Bases:
NoiseComponentTime-domain solar wind noise model with a selectable GP kernel.
Solar wind electron number density fluctuations produce dispersive delays that vary in time. This component models those fluctuations as a Gaussian Process (GP) in the time domain, using a linear interpolation basis (controlled by
TDSWDTor explicitTDSWNODE_*parameters) and a kernel covariance function selected viaTDSWKERNEL.The basis matrix projects the GP onto each TOA using a solar-wind geometry factor so that the effective delay at frequency \(f\) is
\[\delta t(f) = \frac{\mathrm{DM}_{\odot}(t)}{f^2} \cdot K_{\mathrm{DM}}\]where \(\mathrm{DM}_{\odot}(t)\) is the line-of-sight integral of the solar wind electron density evaluated at each epoch by the parent
SolarWindDispersioncomponent.Kernel definitions
Let \(\tau = |t_i - t_j|\) (in seconds at the interpolation nodes), \(\sigma = 10^{\mathtt{TDSWLOGSIG}}\) in \(\mathrm{cm}^{-3}\), \(\ell = 10^{\mathtt{TDSWLOGELL}}\) days, \(p = 10^{\mathtt{TDSWLOGP}}\) years.
Note
TDSWLOGELLis in log10(days) andTDSWLOGPis in log10(years) in both PINT and discovery, matching the enterprise convention for the quasi-periodic kernel. The kernel functions internally convert to seconds.TDSWLOGSIG, however, does not follow the enterprise convention. The basis returned byget_noise_basis()already contains the solar wind geometry factor and the \(\nu^{-2}\) dispersion law, so the GP coefficients are an electron density referenced to 1 AU and \(\sigma\) is in \(\mathrm{cm}^{-3}\). In enterprise the equivalent process acts directly on the residuals and the amplitude is in seconds. Physically sensible values here are of order unity.RIDGE (white-noise / diagonal)
\[K(t_i, t_j) = \sigma^2 \,\delta_{ij}\]Only
TDSWLOGSIGis required.SQEXP (squared-exponential / RBF)
\[K(\tau) = \sigma^2 \exp\!\left(-\frac{\tau^2}{2\ell^2}\right)\]Requires
TDSWLOGSIG,TDSWLOGELL.MATERN (Matérn with half-integer smoothness \(\nu\))
For \(\nu = 1/2\):
\[K(\tau) = \sigma^2 \exp\!\left(-\frac{\tau}{\ell}\right)\]For \(\nu = 3/2\):
\[K(\tau) = \sigma^2 \left(1 + \frac{\sqrt{3}\,\tau}{\ell}\right) \exp\!\left(-\frac{\sqrt{3}\,\tau}{\ell}\right)\]For \(\nu = 5/2\):
\[K(\tau) = \sigma^2 \left(1 + \frac{\sqrt{5}\,\tau}{\ell} + \frac{5\tau^2}{3\ell^2}\right) \exp\!\left(-\frac{\sqrt{5}\,\tau}{\ell}\right)\]Requires
TDSWLOGSIG,TDSWLOGELL.TDSWNU(default 1.5) selects \(\nu \in \{0.5, 1.5, 2.5\}\).QUASI_PERIODIC (squared-exponential × periodic envelope)
Let \(\Gamma_p = 10^{\mathtt{TDSWLOGGAMP}}\) and \(P = 10^{\mathtt{TDSWLOGP}}\) years:
\[K(\tau) = \sigma^2 \exp\!\left(-\frac{\tau^2}{2\ell^2} - \Gamma_p \sin^2\!\frac{\pi\tau}{P}\right)\]Requires
TDSWLOGSIG,TDSWLOGELL,TDSWLOGGAMP,TDSWLOGP.The kernel is evaluated at the interpolation nodes and the resulting weight matrix is projected back onto the TOA residuals via the linear interpolation basis, yielding the full \(N_{\mathrm{TOA}} \times N_{\mathrm{TOA}}\) covariance contribution.
Parameters supported:
Name / Aliases
Description
Kind
TDSWKERNEL
Kernel for time-domain SW noise GP. Allowed values: ‘RIDGE’, ‘SQEXP’, ‘MATERN’, ‘QUASI_PERIODIC’.
string
TDSWDT
Linear interpolation time step for time-domain SW noise.
d
TDSWLOGSIG
Log10 amplitude of time-domain SW noise kernel. The GP coefficients are a solar wind electron density referenced to 1 AU, so sigma is in cm^-3 (not seconds).
number
TDSWLOGELL
Log10 characteristic length scale for SQEXP / MATERN / QUASI_PERIODIC time-domain SW noise (days).
number
TDSWNU
Matern smoothness parameter (supported: 0.5, 1.5, 2.5).
number
TDSWLOGGAMP
Log10 mixing parameter for quasi-periodic time-domain SW noise.
number
TDSWLOGP
Log10 periodicity of quasi-periodic time-domain SW noise (years).
number
TDSWINTERP_KIND
Interpolation kind passed to scipy.interpolate.interp1d (upper case in the par file, lower-cased before the call).
string
TDSWNODE_{number}
Interpolation node for time-domain SW noise basis (MJD).
d
Notes
TimeDomainSWNoiserequires aSolarWindDispersioncomponent in the timing model so that the solar wind geometry factor is available.The interpolation basis is built from either a uniform grid with spacing
TDSWDT(days) or an explicit set ofTDSWNODE_NNNNparameters (MJD). The two modes are mutually exclusive.The component is selected automatically when a par file contains any of its
TDSW*parameters. It can also be attached to an existing model withadd_component().
Examples
Add a time-domain solar wind GP with a Matérn-3/2 kernel to an existing timing model, using a 14-day interpolation grid:
>>> from pint.models.timing_model import Component >>> from pint.models.noise_model import TimeDomainSWNoise >>> all_components = Component.component_types >>> if "SolarWindDispersion" not in model.components: ... sw_det = all_components["SolarWindDispersion"]() ... model.add_component(sw_det, validate=False) ... model["NE_SW"].quantity = 4.0 ... model["SWM"] = 1 ... model["SWP"] = 2.0 >>> sw_comp = TimeDomainSWNoise() >>> model.add_component(sw_comp, validate=False) >>> model["TDSWKERNEL"].value = "MATERN" >>> model["TDSWLOGSIG"].value = 0.0 >>> model["TDSWLOGELL"].value = 1.5 >>> model["TDSWNU"].value = 1.5 >>> model["TDSWDT"].value = 14.0 >>> model["TDSWINTERP_KIND"].value = "LINEAR" >>> model.validate()
Notes
The above example will appear in the par file as:
TDSWKERNEL MATERN TDSWDT 14.0 TDSWLOGSIG 0.0 TDSWLOGELL 1.5 TDSWNU 1.5 TDSWINTERP_KIND LINEAR
To use explicit interpolation nodes instead of a uniform grid, set
TDSWNODE_NNNNparameters (MJD) viaadd_tdsw_node_component(). Kernel-specific parameters must be configured before adding nodes becauseadd_tdsw_node_component()callsvalidate()internally once two or more nodes are present:>>> sw_comp = TimeDomainSWNoise() >>> model.add_component(sw_comp, validate=False) >>> model["TDSWKERNEL"].value = "RIDGE" >>> model["TDSWLOGSIG"].value = 0.0 >>> for i, mjd in enumerate(node_mjd_array, start=1):
… sw_comp.add_tdsw_node_component(mjd, index=i) >>> model.validate()
References
Stochastic solar wind modeling is introduced in PTA literature by Hazboun et al. 2022. Time-domain Gaussian processes are introduced to the PTA literature in Hazboun et al. 2026. - Hazboun et al. 2022 [1] - Hazboun et al. 2026 [2]
Methods
add_param(param[, deriv_func, setup])Add a parameter to the Component.
add_tdsw_node_component(node[, index])Add one TDSWNODE_ prefix parameter to a time-domain SW noise component.
get_noise_basis(toas)Return chromatic linear interpolation matrix for time-domain SW noise.
get_noise_weights(toas)Return GP prior weights for the selected kernel.
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.
set_special_params(spcl_params)setup()Finalize construction loaded values.
sw_basis_weight_pair(toas)Return
(basis, weights)for the time-domain SW noise GP.sw_cov_matrix(toas)Return the covariance matrix for the time-domain SW noise GP.
validate()Validate loaded values.
validate_toas(toas)Check that this model component has TOAs where needed.
Attributes
ALLOWED_KERNELSMapping from kernel name to required and optional parameter names.
Return all the aliases and map to the PINT parameter name.
categorycomponent_typesReturn the free parameters in the component.
introduces_correlated_errorsintroduces_dm_errorsis_time_correlatedparam_prefixsregister- KERNEL_PARAMS: dict = {'MATERN': {'optional': ['TDSWNU'], 'required': ['TDSWLOGSIG', 'TDSWLOGELL']}, 'QUASI_PERIODIC': {'optional': [], 'required': ['TDSWLOGSIG', 'TDSWLOGELL', 'TDSWLOGGAMP', 'TDSWLOGP']}, 'RIDGE': {'optional': [], 'required': ['TDSWLOGSIG']}, 'SQEXP': {'optional': [], 'required': ['TDSWLOGSIG', 'TDSWLOGELL']}}
Mapping from kernel name to required and optional parameter names.
- add_tdsw_node_component(node, index=None)[source]
Add one TDSWNODE_ prefix parameter to a time-domain SW noise component.
- get_noise_basis(toas: TOAs) ndarray[source]
Return chromatic linear interpolation matrix for time-domain SW noise.
- get_noise_weights(toas: TOAs) ndarray[source]
Return GP prior weights for the selected kernel.
The kernel is controlled by
TDSWKERNEL:RIDGE \(K(t_i, t_j) = \sigma^2 \delta(t_i - t_j)\)
SQEXP \(K(t_i, t_j) = \sigma^2 \exp\!\left(-\frac{(t_i-t_j)^2}{2\ell^2}\right)\)
MATERN Matern kernel with smoothness \(\nu \in \{0.5, 1.5, 2.5\}\)
QUASI_PERIODIC \(K_{SE}(t_i,t_j) \cdot \exp\!\left(-\Gamma_p \sin^2\!\frac{\pi(t_i-t_j)}{p}\right)\)
- sw_basis_weight_pair(toas: TOAs) Tuple[ndarray, ndarray][source]
Return
(basis, weights)for the time-domain SW noise GP.
- sw_cov_matrix(toas: TOAs) ndarray[source]
Return the covariance matrix for the time-domain SW noise GP.
- 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
- register_deriv_funcs(func: Callable, param: str) None
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