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:
parent
e3f0cdca94
commit
2d1e8b3761
|
@ -15,7 +15,7 @@ positions for planets and Earth satellites.
|
||||||
planets = load('de421.bsp')
|
planets = load('de421.bsp')
|
||||||
earth, mars = planets['earth'], planets['mars']
|
earth, mars = planets['earth'], planets['mars']
|
||||||
|
|
||||||
ts = load.timescale()
|
ts = load.timescale(builtin=True)
|
||||||
t = ts.now()
|
t = ts.now()
|
||||||
position = earth.at(t).observe(mars)
|
position = earth.at(t).observe(mars)
|
||||||
ra, dec, distance = position.radec()
|
ra, dec, distance = position.radec()
|
||||||
|
|
|
@ -14,7 +14,7 @@ an ephemeris file that provides positions from the planets:
|
||||||
|
|
||||||
from skyfield import api
|
from skyfield import api
|
||||||
|
|
||||||
ts = api.load.timescale()
|
ts = api.load.timescale(builtin=True)
|
||||||
eph = api.load('de421.bsp')
|
eph = api.load('de421.bsp')
|
||||||
|
|
||||||
Then, load the “almanac” module.
|
Then, load the “almanac” module.
|
||||||
|
|
|
@ -13,7 +13,7 @@ that can be used to express them.
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
from skyfield.api import load
|
from skyfield.api import load
|
||||||
from skyfield.positionlib import ICRF
|
from skyfield.positionlib import ICRF
|
||||||
ts = load.timescale()
|
ts = load.timescale(builtin=True)
|
||||||
de421 = load('de421.bsp')
|
de421 = load('de421.bsp')
|
||||||
earth = de421['Earth']
|
earth = de421['Earth']
|
||||||
mars = de421['Mars']
|
mars = de421['Mars']
|
||||||
|
|
|
@ -30,7 +30,7 @@ between the two libraries:
|
||||||
atime = Time('2010-01-01T00:00:00', scale='utc')
|
atime = Time('2010-01-01T00:00:00', scale='utc')
|
||||||
print(atime)
|
print(atime)
|
||||||
|
|
||||||
ts = load.timescale()
|
ts = load.timescale(builtin=True)
|
||||||
t = ts.from_astropy(atime)
|
t = ts.from_astropy(atime)
|
||||||
print(t.utc_jpl())
|
print(t.utc_jpl())
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ between the two libraries:
|
||||||
planets = load('de421.bsp')
|
planets = load('de421.bsp')
|
||||||
earth = planets['earth']
|
earth = planets['earth']
|
||||||
|
|
||||||
ts = load.timescale()
|
ts = load.timescale(builtin=True)
|
||||||
t = ts.utc(1980, 1, 1)
|
t = ts.utc(1980, 1, 1)
|
||||||
barycentric = earth.at(t)
|
barycentric = earth.at(t)
|
||||||
|
|
||||||
|
|
|
@ -140,7 +140,7 @@ Note that ``ts`` should be a timescale object:
|
||||||
|
|
||||||
from skyfield.api import EarthSatellite
|
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'
|
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'
|
line2 = '2 25544 51.6498 109.4756 0003572 55.9686 274.8005 15.49815350868473'
|
||||||
satellite = EarthSatellite(line1, line2, 'ISS (ZARYA)', ts)
|
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,
|
If you need any more details,
|
||||||
this ``sgp4init`` constructor
|
this ``sgp4init`` method is documented in the
|
||||||
is documented in the
|
|
||||||
`Providing your own elements <https://pypi.org/project/sgp4/#providing-your-own-elements>`_
|
`Providing your own elements <https://pypi.org/project/sgp4/#providing-your-own-elements>`_
|
||||||
section of the sgp4 library’s documentation on the Python Packaging Index.
|
section of the sgp4 library’s documentation on the Python Packaging Index.
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,8 @@ Generating Elements
|
||||||
===================
|
===================
|
||||||
|
|
||||||
Call :func:`~skyfield.elementslib.osculating_elements_of()` to generate
|
Call :func:`~skyfield.elementslib.osculating_elements_of()` to generate
|
||||||
an :class:`~skyfield.elementslib.OsculatingElements` object. For
|
an :class:`~skyfield.elementslib.OsculatingElements` object. For
|
||||||
example, here is how to find the osculating elements of the moon
|
example, here is how to find the osculating elements of the moon
|
||||||
orbiting earth:
|
orbiting earth:
|
||||||
|
|
||||||
.. testcode::
|
.. testcode::
|
||||||
|
@ -23,7 +23,7 @@ orbiting earth:
|
||||||
from skyfield.api import load
|
from skyfield.api import load
|
||||||
from skyfield.elementslib import osculating_elements_of
|
from skyfield.elementslib import osculating_elements_of
|
||||||
|
|
||||||
ts = load.timescale()
|
ts = load.timescale(builtin=True)
|
||||||
t = ts.utc(2018, 4, 22, range(0, 25))
|
t = ts.utc(2018, 4, 22, range(0, 25))
|
||||||
|
|
||||||
planets = load('de421.bsp')
|
planets = load('de421.bsp')
|
||||||
|
|
|
@ -80,7 +80,7 @@ and 270° at the Last Quarter.
|
||||||
|
|
||||||
from skyfield.api import load
|
from skyfield.api import load
|
||||||
|
|
||||||
ts = load.timescale()
|
ts = load.timescale(builtin=True)
|
||||||
t = ts.utc(2019, 12, 9, 15, 36)
|
t = ts.utc(2019, 12, 9, 15, 36)
|
||||||
|
|
||||||
eph = load('de421.bsp')
|
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.api import load, Topos
|
||||||
from skyfield.trigonometry import position_angle_of
|
from skyfield.trigonometry import position_angle_of
|
||||||
|
|
||||||
ts = load.timescale()
|
ts = load.timescale(builtin=True)
|
||||||
t = ts.utc(2019, 9, 30, 23)
|
t = ts.utc(2019, 9, 30, 23)
|
||||||
|
|
||||||
eph = load('de421.bsp')
|
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 skyfield.almanac import find_discrete, risings_and_settings
|
||||||
from pytz import timezone
|
from pytz import timezone
|
||||||
|
|
||||||
ts = load.timescale()
|
ts = load.timescale(builtin=True)
|
||||||
t0 = ts.utc(2019, 1, 19)
|
t0 = ts.utc(2019, 1, 19)
|
||||||
t1 = ts.utc(2019, 1, 21)
|
t1 = ts.utc(2019, 1, 21)
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ then Skyfield can return its right ascension and declination.
|
||||||
|
|
||||||
from skyfield import api
|
from skyfield import api
|
||||||
|
|
||||||
ts = api.load.timescale()
|
ts = api.load.timescale(builtin=True)
|
||||||
t = ts.utc(2019, 9, 13, 20)
|
t = ts.utc(2019, 9, 13, 20)
|
||||||
topos = api.Topos(latitude_degrees=42, longitude_degrees=-87)
|
topos = api.Topos(latitude_degrees=42, longitude_degrees=-87)
|
||||||
observer = topos.at(t)
|
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.api import Topos, load
|
||||||
from skyfield.functions import length_of
|
from skyfield.functions import length_of
|
||||||
|
|
||||||
ts = load.timescale()
|
ts = load.timescale(builtin=True)
|
||||||
t = ts.utc(2019, 1, 1)
|
t = ts.utc(2019, 1, 1)
|
||||||
|
|
||||||
bierstadt = Topos('39.5828 N', '105.6686 W', elevation_m=4287.012)
|
bierstadt = Topos('39.5828 N', '105.6686 W', elevation_m=4287.012)
|
||||||
|
|
|
@ -37,7 +37,7 @@ Computing the position of Mars in the sky is as easy as:
|
||||||
planets = load('de421.bsp')
|
planets = load('de421.bsp')
|
||||||
earth, mars = planets['earth'], planets['mars']
|
earth, mars = planets['earth'], planets['mars']
|
||||||
|
|
||||||
ts = load.timescale()
|
ts = load.timescale(builtin=True)
|
||||||
t = ts.now()
|
t = ts.now()
|
||||||
astrometric = earth.at(t).observe(mars)
|
astrometric = earth.at(t).observe(mars)
|
||||||
ra, dec, distance = astrometric.radec()
|
ra, dec, distance = astrometric.radec()
|
||||||
|
|
|
@ -119,7 +119,7 @@ or else by generating a whole series of positions.
|
||||||
|
|
||||||
from skyfield.api import Topos, load
|
from skyfield.api import Topos, load
|
||||||
|
|
||||||
ts = load.timescale()
|
ts = load.timescale(builtin=True)
|
||||||
t = ts.now()
|
t = ts.now()
|
||||||
|
|
||||||
planets = load('de421.bsp')
|
planets = load('de421.bsp')
|
||||||
|
@ -155,7 +155,7 @@ or else by generating a whole series of positions.
|
||||||
|
|
||||||
from skyfield.api import Star, Topos, load
|
from skyfield.api import Star, Topos, load
|
||||||
|
|
||||||
ts = load.timescale()
|
ts = load.timescale(builtin=True)
|
||||||
t = ts.now()
|
t = ts.now()
|
||||||
|
|
||||||
boston = earth + Topos('42.3583 N', '71.0603 W')
|
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
|
from skyfield.api import EarthSatellite, Topos, load
|
||||||
|
|
||||||
ts = load.timescale()
|
ts = load.timescale(builtin=True)
|
||||||
t = ts.now()
|
t = ts.now()
|
||||||
|
|
||||||
line1 = '1 25544U 98067A 14020.93268519 .00009878 00000-0 18200-3 0 5082'
|
line1 = '1 25544U 98067A 14020.93268519 .00009878 00000-0 18200-3 0 5082'
|
||||||
|
|
|
@ -51,7 +51,7 @@ and then the angle between those positions:
|
||||||
|
|
||||||
from skyfield import api
|
from skyfield import api
|
||||||
|
|
||||||
ts = api.load.timescale()
|
ts = api.load.timescale(builtin=True)
|
||||||
t = ts.utc(2020, 6, 2)
|
t = ts.utc(2020, 6, 2)
|
||||||
|
|
||||||
eph = api.load('de421.bsp')
|
eph = api.load('de421.bsp')
|
||||||
|
|
|
@ -64,7 +64,7 @@ the star:
|
||||||
planets = load('de421.bsp')
|
planets = load('de421.bsp')
|
||||||
earth = planets['earth']
|
earth = planets['earth']
|
||||||
|
|
||||||
ts = load.timescale()
|
ts = load.timescale(builtin=True)
|
||||||
t = ts.now()
|
t = ts.now()
|
||||||
astrometric = earth.at(t).observe(barnards_star)
|
astrometric = earth.at(t).observe(barnards_star)
|
||||||
ra, dec, distance = astrometric.radec()
|
ra, dec, distance = astrometric.radec()
|
||||||
|
@ -187,7 +187,7 @@ pass tuples instead of floats:
|
||||||
barnard = Star(ra_hours=(17, 57, 48.49803),
|
barnard = Star(ra_hours=(17, 57, 48.49803),
|
||||||
dec_degrees=(4, 41, 36.2072))
|
dec_degrees=(4, 41, 36.2072))
|
||||||
|
|
||||||
ts = load.timescale()
|
ts = load.timescale(builtin=True)
|
||||||
t = ts.now()
|
t = ts.now()
|
||||||
astrometric = earth.at(t).observe(barnard)
|
astrometric = earth.at(t).observe(barnard)
|
||||||
ra, dec, distance = astrometric.radec()
|
ra, dec, distance = astrometric.radec()
|
||||||
|
|
|
@ -316,7 +316,7 @@ class Time(object):
|
||||||
You will typically not instantiate this class yourself, but will
|
You will typically not instantiate this class yourself, but will
|
||||||
rely on a Skyfield ``Timescale`` object to build dates for you:
|
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))
|
>>> print(ts.utc(1980, 1, 1))
|
||||||
<Time tt=2444239.5005924073>
|
<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:
|
supply a raw Julian date value with the "jd" keyword:
|
||||||
|
|
||||||
from skyfield.api import load
|
from skyfield.api import load
|
||||||
ts = load.timescale()
|
ts = load.timescale(builtin=True)
|
||||||
t = ts.utc(1980, 4, 20) # the new way
|
t = ts.utc(1980, 4, 20) # the new way
|
||||||
|
|
||||||
t = ts.tt(jd=2444349.500592) # jd is also supported for tai, tt, tdb
|
t = ts.tt(jd=2444349.500592) # jd is also supported for tai, tt, tdb
|
||||||
|
|
Loading…
Reference in New Issue