pint.models.model_builder.get_model

pint.models.model_builder.get_model(parfile, allow_name_mixing=False, allow_tcb=False, allow_T2=False, force_binary_model=None, toas_for_tzr=None, **kwargs)[source]

A one step function to build model from a parfile.

Parameters:
  • parfile (str) – The parfile name, or a file-like object to read the parfile contents from

  • allow_name_mixing (bool, optional) – Flag for allowing the input to have mixing aliases names for the same parameter. For example, if this flag is true, one can have T2EFAC and EFAC, both of them maps to PINT parameter EFAC, present in the parfile at the same time.

  • allow_tcb (True, False, or "raw", optional) – Whether to read TCB par files. Default is False, and will throw an error upon encountering TCB par files. If True, the par file will be converted to TDB upon read. If “raw”, an unconverted malformed TCB TimingModel object will be returned.

  • allow_T2 (bool, optional) – Whether to convert a T2 binary model to an appropriate underlying binary model. Default is False, and will throw an error upon encountering the T2 binary model. If True, the binary model will be converted to the most appropriate PINT-compatible binary model.

  • force_binary_model (str, optional) – When set to some binary model, like force_binary_model=”DD”, this will override the binary model set in the parfile. Defaults to None

  • toas_for_tzr (TOAs or None, optional) – If this is not None, a TZR TOA (AbsPhase) will be created using the given TOAs object.

  • kwargs (dict) – Any additional parameter/value pairs that will add to or override those in the parfile.

Return type:

Model instance get from parfile.