-
Notifications
You must be signed in to change notification settings - Fork 101
How To
The data files (par and tim) associated with the tutorials and other examples can be located via pint.config.examplefile()
(available via the pint.config
module):
import pint.config
fullfilename = pint.config.examplefile(filename)
For example, the file NGC6440E.par
from the Time a Pulsar notebook can be found via:
import pint
fullfilename = pint.config.examplefile("NGC6440E.par")
from pint.models import get_model
m = get_model(parfile)
from pint.toa import get_TOAs
t = get_TOAs(timfile)
m, t = get_model_and_toas(parfile, timfile)
You can index by column name into the TOAs object, so you can do toas["observatory"]
or whatever the column is called; and that's an array, so you can do toas["observatory"]=="arecibo"
to get a Boolean array; and you can index with boolean arrays, so you can do toas[toas["observatory"]=="arecibo"]
to get a new TOAs object referencing a subset.
You need to have the TOAs object compute the positions of the planets and add them to the table.
ts.compute_posvels(ephem,planets=True)
This should be done automatically if you load your TOAs with the get_TOAs()
or get_model_and_TOAs()
model.as_ICRS(epoch=epoch)
which will give it to you as a model with AstrometryEquatorial
components at the requested epoch. Similarly,
model.as_ECL(epoch=epoch)
does the same for AstrometryEcliptic
(with an optional specification of the obliquity).