pint.observatory.special_locations.SpecialLocation

class pint.observatory.special_locations.SpecialLocation(name, aliases=None, include_gps=True, include_bipm=True, bipm_version='BIPM2021', overwrite=False)[source]

Bases: Observatory

Special locations that are not really observatories.

Observatory-derived class for special sites that are not really observatories but sometimes are used as TOA locations (eg, solar system barycenter). Currently the only feature of this class is that clock corrections are zero.

Parameters:
  • name (string) – The name of the observatory

  • aliases (str, optional) – List of other aliases for the observatory name.

  • include_gps (bool, optional) – Set False to disable UTC(GPS)->UTC clock correction.

  • include_bipm (bool, optional) – Set False to disable TAI-> TT BIPM clock correction. If False, it only apply TAI->TT correction TT = TAI+32.184s, the same as TEMPO2 TT(TAI) in the parfile. If True, it will apply the correction from BIPM TT=TT(BIPMYYYY). See the link: https://www.bipm.org/en/bipm-services/timescales/time-ftp/ttbipm.html

  • bipm_version (str, optional) – Set the version of TT BIPM clock correction file to use. It has to be in the format like ‘BIPM2015’

  • overwrite (bool, optional) – If True, allow redefinition of an existing observatory; if False, raise an exception.

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.

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

List of aliases for the observatory.

name

Short name of the observatory.

timescale

Returns the timescale that TOAs from this observatory will be in, once any clock corrections have been applied.

fullname

Full human-readable name of the observatory.

include_gps

Whether to include GPS clock corrections.

include_bipm

Whether to include BIPM clock corrections.

bipm_version

Version of the BIPM clock file to use.

property aliases: List[str]

List of aliases for the observatory.

These are short names also used to specify this observatory. Includes ITOA and TEMPO codes, and any other common names.

static bipm_correction(t: Time, bipm_version: str = 'BIPM2021', limits: str = 'warn') Quantity

Compute the GPS clock corrections for times t.

classmethod clear_registry() None

Clear registry for ground-based observatories.

clock_corrections(t: Time, limits: str = 'warn') Quantity

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.

earth_location_itrf(time: Time | None = None) None | ndarray

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.

classmethod get(name: str) Observatory

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.

get_TDBs(t: Time, method: str | Callable = 'default', ephem: str | None = None, options: dict | None = None)

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.

get_gcrs(t: Time, ephem: str | None = None)

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.

static gps_correction(t: Time, limits: str = 'warn') Quantity

Compute the GPS clock corrections for times t.

last_clock_correction_mjd() float

Return the MJD of the last available clock correction.

Returns np.inf if no clock corrections are relevant.

property name: str

Short name of the observatory.

This is the name used in TOA files and in the observatory registry.

classmethod names()

List all observatories known to PINT.

classmethod names_and_aliases() Dict[str, List[str]]

List all observatories and their aliases

posvel(t: Time, ephem: str | None, group=None) PosVel

Return observatory position and velocity for the given times.

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

property timescale: str

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

fullname: str

Full human-readable name of the observatory.

include_gps: bool

Whether to include GPS clock corrections.

include_bipm: bool

Whether to include BIPM clock corrections.

bipm_version: str

Version of the BIPM clock file to use.