pint.models.chromatic_model.ChromaticCM
- class pint.models.chromatic_model.ChromaticCM[source]
Bases:
ChromaticSimple chromatic delay model with a constant chromatic index.
This model uses Taylor expansion to model CM variation over time. It can also be used for a constant CM.
Fitting for the chromatic index is not supported because the fit is too unstable when fit simultaneously with the DM.
Parameters supported:
Name / Aliases
Description
Kind
CM
Chromatic measure
pc / (MHz2 cm3)
CM{number}
1’th time derivative of the chromatic measure
pc / (yr MHz2 cm3)
CMEPOCH
Epoch of CM measurement
d
TNCHROMIDX
Chromatic measure index
number
Methods
CM_derivative_description(n)CM_derivative_unit(n)add_param(param[, deriv_func, setup])Add a parameter to the Component.
alpha_value(toas)base_cm(toas)change_cmepoch(new_epoch)Change CMEPOCH to a new value and update CM accordingly.
chromatic_time_delay(cm, alpha, freq)Return the chromatic time delay for a set of frequencies.
chromatic_type_delay(toas)cm_value(toas)Compute modeled CM value at given TOAs.
constant_chromatic_delay(toas[, acc_delay])This is a wrapper function for interacting with the TimingModel class
d_cm_d_CMs(toas, param_name[, acc_delay])Derivatives of CM wrt the CM taylor expansion coefficients.
d_delay_d_cmparam(toas, param_name[, acc_delay])Derivative of delay wrt to CM parameter.
Return a list of CM term values in the model: [CM, CM1, ..., CMn]
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_cm_deriv_funcs(func, param)Register the derivative function in to the deriv_func dictionaries.
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.
validate()Validate the CM parameters input.
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- constant_chromatic_delay(toas, acc_delay=None)[source]
This is a wrapper function for interacting with the TimingModel class
- 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
- d_cm_d_CMs(toas, param_name, acc_delay=None)[source]
Derivatives of CM wrt the CM taylor expansion coefficients.
- change_cmepoch(new_epoch)[source]
Change CMEPOCH to a new value and update CM accordingly.
- Parameters:
new_epoch (float MJD (in TDB) or astropy.Time object) – The new CMEPOCH value.
- 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.
- chromatic_time_delay(cm, alpha, freq)
Return the chromatic time delay for a set of frequencies.
delay_chrom = cm * DMconst * (freq / 1 MHz)**alpha
- cm_value(toas)
Compute modeled CM 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:
CM values at given TOAs in the unit of CM.
- d_delay_d_cmparam(toas, param_name, acc_delay=None)
Derivative of delay wrt to CM 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.
- 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_cm_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
- 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