pint.models.solar_wind_dispersion.SolarWindDispersion
- class pint.models.solar_wind_dispersion.SolarWindDispersion[source]
Bases:
SolarWindDispersionBaseDispersion due to the solar wind (basic model).
The model is a simple spherically-symmetric model that is fit in its constant amplitude.
For
SWM==0it assumes a power-law index of 2 (Edwards et al.)For
SWM==1it can have any power-law index (You et al., Hazboun et al.), which can also be fitParameters supported:
Name / Aliases
Description
Kind
NE_SW / NE1AU, SOLARN0
Solar Wind density at 1 AU
1 / cm3
NE_SW{number}
1’th time derivative of the Solar Wind density at 1 AU
1 / (yr cm3)
SWEPOCH
Epoch of NE_SW measurement
d
SWP
Solar Wind Model radial power-law index (only for SWM=1)
number
SWM
Solar Wind Model (0 is from Edwards+ 2006, 1 is from You+2007,2012/Hazboun+ 2022)
integer
References
Edwards et al. 2006, MNRAS, 372, 1549; Setion 2.5.4
Madison et al. 2019, ApJ, 872, 150; Section 3.1.
Hazboun et al. (2022, ApJ, 929, 39)
You et al. (2012, MNRAS, 422, 1160)
Methods
NE_SW_derivative_description(n)NE_SW_derivative_unit(n)add_param(param[, deriv_func, setup])Add a parameter to the Component.
d_delay_d_dmparam(toas, param_name[, acc_delay])Derivative of delay wrt to DM parameter.
d_delay_d_ne_sw(toas, param_name[, acc_delay])d_delay_d_swp(toas, param_name[, acc_delay])d_dm_d_ne_sw(toas, param_name[, acc_delay])Derivative of of DM wrt the solar wind ne amplitude.
d_dm_d_swp(toas, param_name[, acc_delay])d_solar_wind_geometry_d_swp(toas, param_name)Derivative of solar_wind_geometry (path length) wrt power-law index p
dispersion_slope_value(toas)dispersion_time_delay(DM, freq)Return the dispersion time delay for a set of frequencies.
dispersion_type_delay(toas)dm_value(toas)Compute modeled DM value at given TOAs.
Return a list of the NE_SW term values in the model: [NE_SW, NE_SW1, ..., NE_SWn]
Return approximate maximum DM from the Solar Wind (at conjunction)
Return approximate minimum DM from the Solar Wind (180deg away from conjunction)
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.
register_dm_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.
solar_wind_delay(toas[, acc_delay])This is a wrapper function to compute solar wind dispersion delay.
solar_wind_dm(toas)Return the solar wind dispersion measure.
solar_wind_geometry(toas)Return the geometry of solar wind dispersion.
validate()Validate loaded values.
validate_toas(toas)Check that this model component has TOAs where needed.
Attributes
Return all the aliases and map to the PINT parameter name.
categorycomponent_typesReturn the free parameters in the component.
param_prefixsregister- solar_wind_geometry(toas)[source]
Return the geometry of solar wind dispersion.
- For SWM==0:
Implements the geometry part of equations 29, 30 of Edwards et al. 2006, (i.e., without the n0, the solar wind DM amplitude part.) Their rho is given as theta here.
rvec: radial vector from observatory to the center of the Sun pos: pulsar position
- For SWM==1:
Implements Eqn. 11 of Hazboun et al. (2022)
- Parameters:
toas (pint.toa.TOAs) –
- Return type:
astropy.quantity.Quantity
- solar_wind_dm(toas)[source]
Return the solar wind dispersion measure.
- SWM==0:
Uses equations 29, 30 of Edwards et al. 2006.
- SWM==1:
Hazboun et al. 2022
- solar_wind_delay(toas, acc_delay=None)[source]
This is a wrapper function to compute solar wind dispersion delay.
- get_NE_SW_terms()[source]
Return a list of the NE_SW term values in the model: [NE_SW, NE_SW1, …, NE_SWn]
- d_dm_d_ne_sw(toas, param_name, acc_delay=None)[source]
Derivative of of DM wrt the solar wind ne amplitude.
- d_solar_wind_geometry_d_swp(toas, param_name, acc_delay=None)[source]
Derivative of solar_wind_geometry (path length) wrt power-law index p
The evaluation is done using Eqn. 12 in Hazboun et al. (2022). The first term involving hypergeometric functions (
_hypergeom_function()) has the derivative computed approximately using a Pade expansion (_d_hypergeom_function_dp()). The second uses gamma functions (_gamma_function()) and has the derivative computed using polygamma functions (_d_gamma_function_dp()).
- 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_max_dm()[source]
Return approximate maximum DM from the Solar Wind (at conjunction)
Simplified model that assumes a circular orbit
- Return type:
astropy.quantity.Quantity
- get_min_dm()[source]
Return approximate minimum DM from the Solar Wind (180deg away from conjunction)
Simplified model that assumes a circular orbit
- Return type:
astropy.quantity.Quantity
- 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.
- d_delay_d_dmparam(toas, param_name, acc_delay=None)
Derivative of delay wrt to DM parameter.
- Parameters:
toas (pint.TOAs object.) – Input toas.
param_name (str) – Derivative parameter name
acc_delay (astropy.quantity or numpy.ndarray) – Accumulated delay values. This parameter is to keep the unified API, but not used in this function.
- dispersion_time_delay(DM, freq)
Return the dispersion time delay for a set of frequencies.
This equation is taken from Duncan Lorimer, Michael Kramer, Handbook of Pulsar Astronomy, Second edition, Page 86, Equation [4.7] Here we assume the reference frequency is at infinity and the EM wave frequency is much larger than plasma frequency.
- dm_value(toas)
Compute modeled DM value at given TOAs.
- Parameters:
toas (TOAs object or TOA table(TOAs.table)) –
- If given a TOAs object, it will use the whole TOA table in the
TOAs object.
- Return type:
DM values at given TOAs in the unit of DM.
- 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().
- 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
- register_dm_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