Skyfield: HomeTable of ContentsAPI Reference

API Reference — Topocentric Locations

class skyfield.toposlib.Topos(latitude=None, longitude=None, latitude_degrees=None, longitude_degrees=None, elevation_m=0.0, x=0.0, y=0.0)

A vector function that knows the position of a place on Earth.

The constructor needs:

  • Either an Angle for the latitude or else a plain float latitude_degrees providing the angle in degrees.
  • Either an Angle for the longitude or else a plain float longitude_degrees providing the angle in degrees.
  • Optionally, the elevation_m of the location, in meters above mean sea level on a WGS-84 globe. If not specified, the location will be assumed to sit at exactly sea level.

The center of a topos object is always 399, the center of gravity of the Earth, so every call to the at(t) method of a topos object returns a Geocentric position.

Once the object has been created, here are its attributes and methods:

latitude

An Angle object specifying the latitude of the topocentric position.

longitude

An Angle object specifying the longitude of the topocentric position.

elevation

A Distance object specifying the elevation of the topocentric position above mean sea level on a WGS-84 globe.

center

The integer 399, which identifies this topocentric position’s vector as having its origin at the center of the Earth.

itrf_xyz()

Return this location as an (x,y,z) vector in the ITRF frame.

Returns a 3-element Distance object.

refract(altitude_degrees, temperature_C, pressure_mbar)

Predict how the atmosphere will refract a position.

Given a body that is standing altitude_degrees above the true horizon, return an Angle predicting its apparent altitude given the supplied temperature and pressure, either of which can be the string 'standard' to use 10°C and a pressure of 1010 mbar adjusted for the elevation of this geographic location.

rotation_at(t)

Compute the altazimuth rotation matrix for this location’s sky.