pint.observatory.Observatory
- class pint.observatory.Observatory(name, fullname=None, aliases=None, apply_gps2utc=None, overwrite=False)[source]
Bases:
object
Observatory locations and related site-dependent properties
For example, TOA time scales, clock corrections. Any new Observatory that is declared will be automatically added to a registry that is keyed on observatory name. Aside from their initial declaration (for examples, see
pint/data/runtimefile/observatories.json
), Observatory instances should generally be obtained only via thepint.observatory.Observatory.get()
function. This will query the registry based on observatory name (and any defined aliases). A list of all registered names can be returned viapint.observatory.Observatory.names()
, or a list of names and aliases can be returned viapint.observatory.Observatory.names_and_aliases()
.Observatories have names and aliases that are used in
.tim
and.par
files to select them. They also have positions (possibly varying, in the case of satellite observatories) and may have associated clock corrections to relate times observed at the observatory clock to global time scales.An Observatory has a boolean flag called apply_gps2utc. If this is True then the observatory clock (after applying any local clock corrections) is assumed to be in UTC(USNO)_GPS, meaning the value of UTC(USNO) distributed via GPS. To get this to UTC, one needs to apply the corrections (C_0’ = [UTC-UTC(USNO)_GPS]) from BIPM Circular T https://webtai.bipm.org/ftp/pub/tai/other-products/notes/explanatory_supplement_v0.6.pdf
Terrestrial observatories are generally instances of the
pint.observatory.topo_obs.TopoObs
class, which has a fixed position.Methods
bipm_correction
(t[, bipm_version, limits])Compute the GPS clock corrections for times t.
Clear registry for ground-based observatories.
clock_corrections
(t[, include_bipm, ...])Compute clock corrections for a Time array.
earth_location_itrf
([time])Returns observatory geocentric position as an astropy EarthLocation object.
get
(name[, apply_gps2utc, overwrite])Returns the Observatory instance for the specified name/alias.
get_TDBs
(t[, method, ephem, options])This is a high level function for converting TOAs to TDB time scale.
get_gcrs
(t[, ephem])Return position vector of observatory in GCRS t is an astropy.Time or array of astropy.Time objects ephem is a link to an ephemeris file.
gps_correction
(t[, limits])Compute the GPS clock corrections for times t.
last_clock_correction_mjd
([include_bipm, ...])Return the MJD of the last available clock correction.
names
()List all observatories known to PINT.
List all observatories and their aliases
posvel
(t, ephem[, group])Return observatory position and velocity for the given times.
Attributes
aliases
name
Returns the timescale that TOAs from this observatory will be in, once any clock corrections have been applied.
- static gps_correction(t, limits='warn')[source]
Compute the GPS clock corrections for times t.
- Parameters:
t (astropy.time.Time) – An array-valued Time object specifying the times at which to evaluate the GPS clock correction.
- static bipm_correction(t, bipm_version='BIPM2023', limits='warn')[source]
Compute the GPS clock corrections for times t.
- Parameters:
t (astropy.time.Time) – An array-valued Time object specifying the times at which to evaluate the GPS clock correction.
- classmethod get(name, apply_gps2utc=None, overwrite=False)[source]
Returns the Observatory instance for the specified name/alias.
If the name has not been defined, an error will be raised. Aside from the initial observatory definitions, this is in general the only way Observatory objects should be accessed. Name-matching is case-insensitive.
- earth_location_itrf(time=None)[source]
Returns observatory geocentric position as an astropy EarthLocation object. For observatories where this is not relevant, None can be returned.
The location is in the International Terrestrial Reference Frame (ITRF). The realization of the ITRF is determined by astropy, which uses ERFA (IAU SOFA).
The time argument is ignored for observatories with static positions. For moving observatories (e.g. spacecraft), it should be specified (as an astropy Time) and the position at that time will be returned.
- get_gcrs(t, ephem=None)[source]
Return position vector of observatory in GCRS t is an astropy.Time or array of astropy.Time objects ephem is a link to an ephemeris file. Needed for SSB observatory Returns a 3-vector of Quantities representing the position in GCRS coordinates.
- property timescale
Returns the timescale that TOAs from this observatory will be in, once any clock corrections have been applied. This should be a string suitable to be passed directly to the scale argument of astropy.time.Time().
- clock_corrections(t, include_bipm=True, bipm_version='BIPM2023', limits='warn')[source]
Compute clock corrections for a Time array.
- Parameters:
t (astropy.time.Time object) – Array-valued Time to compute corrections for
include_bipm (bool) – Whether to apply TT(TAI)->TT(BIPM) correction
bipm_version (str, optional) – Which version of BIPM to apply (e.g. “BIPM2021”)
limits (str, optional) – Either “warn” or “error” to control behavior when times are outside limits of known corrections.
Time (Given an array-valued) –
corrections (return the clock) –
array (as a numpy) –
the (with units. These values are to be added to) –
by (raw TOAs in order to refer them to the timescale specified) –
self.timescale. –
- last_clock_correction_mjd(include_bipm=True, bipm_version='BIPM2023')[source]
Return the MJD of the last available clock correction.
Returns
np.inf
if no clock corrections are relevant.
- get_TDBs(t, method='default', ephem=None, options=None)[source]
This is a high level function for converting TOAs to TDB time scale.
Different method can be applied to obtain the result. Current supported methods are [‘default’, ‘ephemeris’]
- Parameters:
t (astropy.time.Time object) – The time need for converting toas
method (str or callable, optional) –
Method of computing TDB
- ”default”
Astropy time.Time object built-in converter, uses FB90. SpacecraftObs will include a topocentric correction term.
- ”ephemeris”
JPL ephemeris included TDB-TT correction. Not currently implemented.
- callable
This callable is called with the parameter t as its first parameter; additional keyword arguments can be supplied in the options argument
ephem (str, optional) – The ephemeris to get he TDB-TT correction. Required for the ‘ephemeris’ method.
options (dict or None) – Options to pass to a custom callable.