-
Notifications
You must be signed in to change notification settings - Fork 101
Code Architecture
PINT has four basic classes: TOAs Class, Timing Model Class, Residual Class, and Fitter Class. The connection is showed in the figure below.
Raw TOA times are assumed to be UTC as measured by an observatory clock, however they are represented as astropy.Time objects, so it should be OK to specify them in different time systems (TAI, TT, TDB).
Time corrections are then applied to obtain some realization of UTC (is this supposed to be UTC(NIST), UTC(GPS), or what??) in this sense:
UTC = UTC(obs) + CLOCK_CORRECTION
From there, TDB is computed from UTC using the time conversions built in to the astropy.Time class, which proceeds via the following flowchart:
Individual arrival times are represented by a TOA
object, while a collection of them are represented by the TOAs
object. TOA
objects are generally only transitory, since most of the useful functionality for computing with TOAs is implements in the collective TOAs
class
The TOA
class represents a single time of arrival. It has the following instance variables
-
mjd
This is an astropy.time object representing the arrival time. It is generally the UTC time recorded by an observatory clock, but can be in a different time system in certain cases (such as barycentric arrival times). -
obs
This is one of the observatory codes specified in$PINT/datafiles/observatories.txt
. These represent a location in ITRF coordinates and assume an observatory fixed to the rotation Earth. -
error
This is the uncertainty in themjd
as an astropy Quantity with units (typically microseconds) -
freq
This is the observatory-centric frequency of the observed TOA as an astropy Quantity with units (typically in MHz) -
flags
This is any number of keyword=value pairs that provided additional metadata for the TOA (e.g. backend=GUPPI, ...) - (SUGGESTION TOAs should be able to have a position and velocity specified per TOA instead of an observatory. Perhaps this can be implemented as a special
obs
code.)
This class represents a collection of TOAs. Rather than do this as a collection of TOA
objects, the information is kept in an astropy.Table for computational efficiency. A TOAs
object can be instantiated from TEMPO/Tempo2 'tim' files or from a previously pickled TOAs object. (Soon it will also be able to be instantiated from a list of TOA objects, but this is not in the master branch yet)
The instance variables include:
-
toas
a list ofTOA
objects. This only exists until the table is created.
##Introduction PINT model classes are a set of classes which provide the timing model calculation,majorly time delays,phases and delay derivatives. It is an independent module from TOA class module. All the model classes are subclasses of TimingModel class.
##Get your model The easiest way to get your model is using PINT built in models. If you have a .par file, a type of file provides a set of model parameters. To build your model, just simply do:
>>>import pint.models.model_builder as mb
>>>mb.get_model('filename.par')