Skyfield: HomeTable of ContentsAPI Reference

API Reference — Planetary reference frames

class skyfield.planetarylib.PlanetaryConstants

Planetary constants manager.

You can use this class to build working models of Solar System bodies by loading text planetary constant files and binary orientation kernels. For a full description of how to use this, see Planetary Reference Frames.

read_text(file)

Read frame assignments from a KPL/FK file.

Appropriate files will typically have the extension .tf or .tpc and will define a series of names and values that will be loaded into this object’s .assignments dictionary.

>>> from skyfield.api import load
>>> pc = PlanetaryConstants()
>>> pc.read_text(load('moon_080317.tf'))
>>> pc.assignments['FRAME_31006_NAME']
'MOON_PA_DE421'
read_binary(file)

Read binary segments descriptions from a DAF/PCK file.

Binary segments live in .bpc files and predict how a body like a planet or moon will be oriented on a given date.

build_frame_named(name)

Given a frame name, return a Frame object.

build_frame(integer, _segment=None)

Given a frame integer code, return a Frame object.

build_latlon_degrees(frame, latitude_degrees, longitude_degrees, elevation_m=0.0)

Build an object representing a location on a body’s surface.

class skyfield.planetarylib.Frame(center, segment, matrix)

Planetary constants frame, for building rotation matrices.

rotation_at(t)

Return the rotation matrix for this frame at time t.

rotation_and_rate_at(t)

Return rotation and rate matrices for this frame at time t.