pint.models.parameter.MJDParameter

class pint.models.parameter.MJDParameter(name=None, value=None, description=None, uncertainty=None, frozen=True, continuous=True, aliases=None, time_scale='tdb', **kwargs)[source]

Bases: Parameter

Parameters for MJD quantities.

.quantity stores current parameter information in an astropy.time.Time type in the format of MJD. .value returns the pure long double MJD value. .units is in day as default unit. Note that you can’t make an astropy.time.Time object just by multiplying a number by u.day; there are complexities in constructing times.

Parameters:
  • name (str) – The name of the parameter.

  • value (astropy Time, str, float in mjd, str in mjd.) – The input parameter MJD value.

  • description (str, optional) – A short description of what this parameter means.

  • uncertainty (number) – Current uncertainty of the value.

  • frozen (bool, optional) – A flag specifying whether “fitters” should adjust the value of this parameter or leave it fixed.

  • continuous (bool, optional, default True) – A flag specifying whether phase derivatives with respect to this parameter exist.

  • aliases (list, optional) – An optional list of strings specifying alternate names that can also be accepted for this parameter.

  • time_scale (str, optional, default 'tdb') – MJD parameter time scale.

Example

>>> from parameter import MJDParameter
>>> test = MJDParameter(name='test1', value='54000', time_scale='utc')
>>> print(test)
test1 (d) 54000.000000000000000

Methods

add_alias(alias)

Add a name to the list of aliases for this parameter.

as_latex()

as_parfile_line([format])

Return a parfile line giving the current state of the parameter.

as_ufloat()

Return the parameter as a uncertainties.ufloat value.

as_ufloats()

Return the parameter as a pair of uncertainties.ufloat values representing the integer and fractional Julian dates.

from_parfile_line(line)

Parse a parfile line into the current state of the parameter.

help_line()

Return a help line containing parameter name, description and units.

name_matches(name)

Whether or not the parameter name matches the provided name

prior_pdf([value, logpdf])

Return the prior probability density.

set(value)

Deprecated - just assign to .value.

str_quantity(quan)

Format the argument in an appropriate way as a string.

value_as_latex()

Attributes

prior

prior distribution for this parameter.

quantity

Value including units (if appropriate).

repeatable

time_scale

uncertainty

Parameter uncertainty value with units.

uncertainty_value

Return a pure value from .uncertainty.

units

Units associated with this parameter.

value

Return the value (without units) of a parameter.

str_quantity(quan)[source]

Format the argument in an appropriate way as a string.

property uncertainty_value

Return a pure value from .uncertainty.

The unit will associate with .units

as_ufloats()[source]

Return the parameter as a pair of uncertainties.ufloat values representing the integer and fractional Julian dates. The uncertainty is carried by the latter.

If the uncertainty is not set will be returned as 0

Returns:

  • uncertainties.ufloat

  • uncertainties.ufloat

as_ufloat()[source]

Return the parameter as a uncertainties.ufloat value.

If the uncertainty is not set will be returned as 0

Return type:

uncertainties.ufloat

add_alias(alias)

Add a name to the list of aliases for this parameter.

as_parfile_line(format='pint')

Return a parfile line giving the current state of the parameter.

Parameters:

format (str, optional) – Parfile output format. PINT outputs in ‘tempo’, ‘tempo2’ and ‘pint’ formats. The default format is pint.

Return type:

str

Notes

Format differences between tempo, tempo2, and pint at [1]

from_parfile_line(line)

Parse a parfile line into the current state of the parameter.

Returns True if line was successfully parsed, False otherwise.

Note

The accepted formats:

  • NAME value

  • NAME value fit_flag

  • NAME value fit_flag uncertainty

  • NAME value uncertainty

help_line()

Return a help line containing parameter name, description and units.

name_matches(name)

Whether or not the parameter name matches the provided name

property prior

prior distribution for this parameter.

This should be a Prior object describing the prior distribution of the quantity, for use in Bayesian fitting.

prior_pdf(value=None, logpdf=False)

Return the prior probability density.

Evaluated at the current value of the parameter, or at a proposed value.

Parameters:
  • value (array-like or float, optional) – Where to evaluate the priors; should be a unitless number. If not provided the prior is evaluated at self.value.

  • logpdf (bool) – If True, return the logarithm of the PDF instead of the PDF; this can help with densities too small to represent in floating-point.

property quantity

Value including units (if appropriate).

set(value)

Deprecated - just assign to .value.

property uncertainty

Parameter uncertainty value with units.

property units

Units associated with this parameter.

Should be a astropy.units.Unit object, or None if never set.

property value

Return the value (without units) of a parameter.

This value is assumed to be in units of self.units. Upon setting, a a Quantity can be provided, which will be converted to self.units.