Use builtin=True more consistently for timescales

It looks like http://maia.usno.navy.mil/ is down this morning, which
reminds me that documentation should be more consistent in loading
timescales from internal files unless illustrating explicitly how to
download up-to-date files.
This commit is contained in:
Brandon Rhodes 2020-06-04 05:59:31 -04:00
parent e3f0cdca94
commit 2d1e8b3761
12 changed files with 24 additions and 25 deletions

View File

@ -15,7 +15,7 @@ positions for planets and Earth satellites.
planets = load('de421.bsp')
earth, mars = planets['earth'], planets['mars']
ts = load.timescale()
ts = load.timescale(builtin=True)
t = ts.now()
position = earth.at(t).observe(mars)
ra, dec, distance = position.radec()

View File

@ -14,7 +14,7 @@ an ephemeris file that provides positions from the planets:
from skyfield import api
ts = api.load.timescale()
ts = api.load.timescale(builtin=True)
eph = api.load('de421.bsp')
Then, load the “almanac” module.

View File

@ -13,7 +13,7 @@ that can be used to express them.
from __future__ import print_function
from skyfield.api import load
from skyfield.positionlib import ICRF
ts = load.timescale()
ts = load.timescale(builtin=True)
de421 = load('de421.bsp')
earth = de421['Earth']
mars = de421['Mars']

View File

@ -30,7 +30,7 @@ between the two libraries:
atime = Time('2010-01-01T00:00:00', scale='utc')
print(atime)
ts = load.timescale()
ts = load.timescale(builtin=True)
t = ts.from_astropy(atime)
print(t.utc_jpl())
@ -55,7 +55,7 @@ between the two libraries:
planets = load('de421.bsp')
earth = planets['earth']
ts = load.timescale()
ts = load.timescale(builtin=True)
t = ts.utc(1980, 1, 1)
barycentric = earth.at(t)

View File

@ -140,7 +140,7 @@ Note that ``ts`` should be a timescale object:
from skyfield.api import EarthSatellite
ts = load.timescale()
ts = load.timescale(builtin=True)
line1 = '1 25544U 98067A 14020.93268519 .00009878 00000-0 18200-3 0 5082'
line2 = '2 25544 51.6498 109.4756 0003572 55.9686 274.8005 15.49815350868473'
satellite = EarthSatellite(line1, line2, 'ISS (ZARYA)', ts)
@ -691,8 +691,7 @@ that builds a satellite model directly from numeric orbital parameters:
)
If you need any more details,
this ``sgp4init`` constructor
is documented in the
this ``sgp4init`` method is documented in the
`Providing your own elements <https://pypi.org/project/sgp4/#providing-your-own-elements>`_
section of the sgp4 librarys documentation on the Python Packaging Index.

View File

@ -14,8 +14,8 @@ Generating Elements
===================
Call :func:`~skyfield.elementslib.osculating_elements_of()` to generate
an :class:`~skyfield.elementslib.OsculatingElements` object. For
example, here is how to find the osculating elements of the moon
an :class:`~skyfield.elementslib.OsculatingElements` object. For
example, here is how to find the osculating elements of the moon
orbiting earth:
.. testcode::
@ -23,7 +23,7 @@ orbiting earth:
from skyfield.api import load
from skyfield.elementslib import osculating_elements_of
ts = load.timescale()
ts = load.timescale(builtin=True)
t = ts.utc(2018, 4, 22, range(0, 25))
planets = load('de421.bsp')

View File

@ -80,7 +80,7 @@ and 270° at the Last Quarter.
from skyfield.api import load
ts = load.timescale()
ts = load.timescale(builtin=True)
t = ts.utc(2019, 12, 9, 15, 36)
eph = load('de421.bsp')
@ -121,7 +121,7 @@ and 270° if the Sun is to the right of the Moon.
from skyfield.api import load, Topos
from skyfield.trigonometry import position_angle_of
ts = load.timescale()
ts = load.timescale(builtin=True)
t = ts.utc(2019, 9, 30, 23)
eph = load('de421.bsp')
@ -177,7 +177,7 @@ like the Sun, Moon, or one of the planets.
from skyfield.almanac import find_discrete, risings_and_settings
from pytz import timezone
ts = load.timescale()
ts = load.timescale(builtin=True)
t0 = ts.utc(2019, 1, 19)
t1 = ts.utc(2019, 1, 21)
@ -212,7 +212,7 @@ then Skyfield can return its right ascension and declination.
from skyfield import api
ts = api.load.timescale()
ts = api.load.timescale(builtin=True)
t = ts.utc(2019, 9, 13, 20)
topos = api.Topos(latitude_degrees=42, longitude_degrees=-87)
observer = topos.at(t)
@ -296,7 +296,7 @@ to both Accra, Ghana, and the top of Mount Bierstadt in Colorado.
from skyfield.api import Topos, load
from skyfield.functions import length_of
ts = load.timescale()
ts = load.timescale(builtin=True)
t = ts.utc(2019, 1, 1)
bierstadt = Topos('39.5828 N', '105.6686 W', elevation_m=4287.012)

View File

@ -37,7 +37,7 @@ Computing the position of Mars in the sky is as easy as:
planets = load('de421.bsp')
earth, mars = planets['earth'], planets['mars']
ts = load.timescale()
ts = load.timescale(builtin=True)
t = ts.now()
astrometric = earth.at(t).observe(mars)
ra, dec, distance = astrometric.radec()

View File

@ -119,7 +119,7 @@ or else by generating a whole series of positions.
from skyfield.api import Topos, load
ts = load.timescale()
ts = load.timescale(builtin=True)
t = ts.now()
planets = load('de421.bsp')
@ -155,7 +155,7 @@ or else by generating a whole series of positions.
from skyfield.api import Star, Topos, load
ts = load.timescale()
ts = load.timescale(builtin=True)
t = ts.now()
boston = earth + Topos('42.3583 N', '71.0603 W')
@ -181,7 +181,7 @@ or else by generating a whole series of positions.
from skyfield.api import EarthSatellite, Topos, load
ts = load.timescale()
ts = load.timescale(builtin=True)
t = ts.now()
line1 = '1 25544U 98067A 14020.93268519 .00009878 00000-0 18200-3 0 5082'

View File

@ -51,7 +51,7 @@ and then the angle between those positions:
from skyfield import api
ts = api.load.timescale()
ts = api.load.timescale(builtin=True)
t = ts.utc(2020, 6, 2)
eph = api.load('de421.bsp')

View File

@ -64,7 +64,7 @@ the star:
planets = load('de421.bsp')
earth = planets['earth']
ts = load.timescale()
ts = load.timescale(builtin=True)
t = ts.now()
astrometric = earth.at(t).observe(barnards_star)
ra, dec, distance = astrometric.radec()
@ -187,7 +187,7 @@ pass tuples instead of floats:
barnard = Star(ra_hours=(17, 57, 48.49803),
dec_degrees=(4, 41, 36.2072))
ts = load.timescale()
ts = load.timescale(builtin=True)
t = ts.now()
astrometric = earth.at(t).observe(barnard)
ra, dec, distance = astrometric.radec()

View File

@ -316,7 +316,7 @@ class Time(object):
You will typically not instantiate this class yourself, but will
rely on a Skyfield ``Timescale`` object to build dates for you:
>>> ts = load.timescale()
>>> ts = load.timescale(builtin=True)
>>> print(ts.utc(1980, 1, 1))
<Time tt=2444239.5005924073>
@ -908,7 +908,7 @@ using its methods, which let you either specify a calendar date or else
supply a raw Julian date value with the "jd" keyword:
from skyfield.api import load
ts = load.timescale()
ts = load.timescale(builtin=True)
t = ts.utc(1980, 4, 20) # the new way
t = ts.tt(jd=2444349.500592) # jd is also supported for tai, tt, tdb