pint.models.expdip.SimpleExponentialDip
- class pint.models.expdip.SimpleExponentialDip[source]
Bases:
DelayComponentSimple chromatic exponential dip model for events like the profile changes in J1713+0747.
The dip is modeled as a logistic function multiplied by an exponential decay. This is different from the tempo2 implementation where the exponential decay is multiplied by a Heaviside step function. We cannot fit for the event epoch while using the latter because it is not differentiable at the event epoch. This implementation approaches the tempo2 version in the limit EXPDIPEPS -> 0. The parameter names are also different between this implementation and tempo2. The tempo2 parameter names have been added here as aliases so that tempo2 par files can be read.
The explicit mathematical form of the dips is as follows.
\[\Delta_{\text{dip}}(t)=-\sum_{i}A_{i}\left(\frac{f}{f_{\text{ref}}}\right)^{\gamma_{i}}\left(\frac{\tau_{i}}{\epsilon}\right)^{\epsilon/\tau_{i}}\left(\frac{\tau_{i}}{\tau_{i}-\epsilon}\right)^{\frac{\tau_{i}-\epsilon}{\tau_{i}}}\frac{\exp\left[-\frac{t-T_{i}}{\tau_{i}}\right]}{1+\exp\left[-\frac{t-T_{i}}{\epsilon}\right]}\]An exponential dip event is normalized such that the EXPDIPAMP_ is its extremum value. Note that the extremum occurs slightly after the event epoch.
Parameters supported:
Name / Aliases
Description
Kind
EXPDIPEPS
Chromatic exponential dip step timescale
d
EXPDIPFREF
Chromatic exponential dip reference frequency
MHz
EXPDIPEP_{number} / EXPEP_{number}
Chromatic exponential dip epoch
d
EXPDIPAMP_{number} / EXPPH_{number}
Chromatic exponential dip amplitude
s
EXPDIPIDX_{number} / EXPINDEX_{number}
Chromatic exponential dip index
number
EXPDIPTAU_{number} / EXPTAU_{number}
Chromatic exponential dip decay timescale
d
Methods
add_exp_dip(epoch, ampl, gamma, tau[, ...])Add an exponential dip to the model.
add_param(param[, deriv_func, setup])Add a parameter to the Component.
d_delay_d_A(toas, param[, acc_delay])Derivative of delay w.r.t.
d_delay_d_T(toas, param[, acc_delay])Derivative of delay w.r.t.
d_delay_d_gamma(toas, param[, acc_delay])Derivative of delay w.r.t.
d_delay_d_tau(toas, param[, acc_delay])Derivative of delay w.r.t.
expdip_delay(toas[, acc_delay])Total exponential dip delay.
expdip_delay_term(t_mjd, ffac, ii)Compute the delay for a single exponential dip event.
get_ffac(toas)Compute f/fref where f is the observing frequency.
Returns an array of integers corresponding to exp dip parameters.
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_exp_dip(index)Removes all exp dip parameters associated with a given index/list of indices.
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
Return all the aliases and map to the PINT parameter name.
categorycomponent_typesReturn the free parameters in the component.
param_prefixsregister- add_exp_dip(epoch: float | Quantity | Time, ampl: float | Quantity, gamma: float | Quantity, tau: float | Quantity, index: int | None = None, frozen: bool = True) int[source]
Add an exponential dip to the model.
- remove_exp_dip(index: float | int | List[int] | ndarray) None[source]
Removes all exp dip parameters associated with a given index/list of indices.
- get_indices() ndarray[source]
Returns an array of integers corresponding to exp dip parameters.
- Returns:
inds – Array of exp dip indices in model.
- Return type:
np.ndarray
- expdip_delay_term(t_mjd: ndarray, ffac: ndarray, ii: int) Quantity[source]
Compute the delay for a single exponential dip event.
- d_delay_d_A(toas: TOAs, param: str, acc_delay=None) Quantity[source]
Derivative of delay w.r.t. exponential dip amplitude.
- d_delay_d_gamma(toas: TOAs, param: str, acc_delay=None) Quantity[source]
Derivative of delay w.r.t. exponential dip chromatic index.
- d_delay_d_tau(toas: TOAs, param: str, acc_delay=None) Quantity[source]
Derivative of delay w.r.t. exponential dip decay timescale.
- d_delay_d_T(toas: TOAs, param: str, acc_delay=None) Quantity[source]
Derivative of delay w.r.t. exponential dip epoch.
- 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