pint.observatory.Observatory

class pint.observatory.Observatory(name, fullname=None, aliases=None, include_gps=True, include_bipm=True, bipm_version='BIPM2021', 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 the pint.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 via pint.observatory.Observatory.names(), or a list of names and aliases can be returned via pint.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.

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()

Clear registry for ground-based observatories.

clock_corrections(t[, limits])

Compute clock corrections for a Time array.

earth_location_itrf([time])

Returns observatory geocentric position as an astropy EarthLocation object.

get(name)

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()

Return the MJD of the last available clock correction.

names()

List all observatories known to PINT.

names_and_aliases()

List all observatories and their aliases

posvel(t, ephem[, group])

Return observatory position and velocity for the given times.

Attributes

aliases

name

timescale

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.

static bipm_correction(t, bipm_version='BIPM2021', limits='warn')[source]

Compute the GPS clock corrections for times t.

classmethod clear_registry()[source]

Clear registry for ground-based observatories.

classmethod names()[source]

List all observatories known to PINT.

classmethod names_and_aliases()[source]

List all observatories and their aliases

classmethod get(name)[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, limits='warn')[source]

Compute clock corrections for a Time array.

Given an array-valued Time, return the clock corrections as a numpy array, with units. These values are to be added to the raw TOAs in order to refer them to the timescale specified by self.timescale.

last_clock_correction_mjd()[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.

posvel(t, ephem, group=None)[source]

Return observatory position and velocity for the given times.

Position is relative to solar system barycenter; times are (astropy array-valued Time objects).