Example #1
0
def main():
    args = sys.argv[1:]
    if not args:
        print('usage: deprecations.py (a|b...)')
        sys.exit(2)
    arg = args[0]
    if arg == 'a':
        from skyfield.api import earth, mars, now
        earth(now()).observe(mars).radec()
    elif arg == 'b':
        from skyfield.api import earth
        earth.topos('42.3583 N', '71.0636 W')
    elif arg == 'c':
        from skyfield.api import load
        eph = load('de421.bsp')
        earth = eph['earth']
        earth(100)
    elif arg == 'd':
        from skyfield.api import JulianDate
        JulianDate(utc=(1980, 1, 1))
    elif arg == 'e':
        from skyfield.api import load
        eph = load('de421.bsp')
        earth = eph['earth']
        earth.at(utc=(1980, 1, 1))
def test_iss_altitude(iss_transit):
    dt, their_altitude = iss_transit

    cst = timedelta(hours=-6) #, minutes=1)
    dt = dt - cst
    jd = JulianDate(utc=dt, delta_t=67.2091)

    lines = iss_tle.splitlines()
    s = EarthSatellite(lines, earth)
    lake_zurich = earth.topos('42.2 N', '88.1 W')
    alt, az, d = lake_zurich(jd).observe(s).altaz()
    print(dt, their_altitude, alt.degrees(), their_altitude - alt.degrees())
    assert abs(alt.degrees() - their_altitude) < 2.5  # TODO: tighten this up?
def test_iss_altitude_computed_with_gcrs(iss_transit):
    dt, their_altitude = iss_transit

    cst = timedelta(hours=-6) #, minutes=1)
    dt = dt - cst
    jd = JulianDate(utc=dt, delta_t=67.2091)

    lines = iss_tle.splitlines()
    s = EarthSatellite(lines, earth)
    lake_zurich = earth.topos(latitude_degrees=42.2, longitude_degrees=-88.1)

    alt, az, d = lake_zurich.gcrs(jd).observe(s).altaz()
    print(dt, their_altitude, alt.degrees, their_altitude - alt.degrees)
    assert abs(alt.degrees - their_altitude) < 2.5  # TODO: tighten this up?
def test_iss_altitude_computed_with_gcrs(iss_transit):
    dt, their_altitude = iss_transit

    cst = timedelta(hours=-6)  #, minutes=1)
    dt = dt - cst
    jd = JulianDate(utc=dt, delta_t=67.2091)

    lines = iss_tle.splitlines()
    s = EarthSatellite(lines, earth)
    lake_zurich = earth.topos(latitude_degrees=42.2, longitude_degrees=-88.1)

    alt, az, d = lake_zurich.gcrs(jd).observe(s).altaz()
    print(dt, their_altitude, alt.degrees, their_altitude - alt.degrees)
    assert abs(alt.degrees - their_altitude) < 2.5  # TODO: tighten this up?
Example #5
0
text = """
ISS (ZARYA)
1 25544U 98067A   14020.93268519  .00009878  00000-0  18200-3 0  5082
2 25544  51.6498 109.4756 0003572  55.9686 274.8005 15.49815350868473
"""

from skyfield.api import JulianDate, earth

bluffton = earth.topos('40.8939 N', '83.8917 W')
tup = (2014, 1, 21, 11, 18, 7)

sat = earth.satellite(text)
position = bluffton(utc=tup).observe(sat)
alt, az, distance = position.altaz()

print(alt)
print(az)
print(distance.km)
Example #6
0
#!/usr/local/bin/python3

from skyfield.api import earth
years = range(-9999, 9999, 10)
north_pole = earth.topos('90 N', '0 W')
x, y, z = north_pole.gcrs(utc=(years, 1, 1)).position.km
Example #7
0
''' This package is about holding and calculating information via `skyfield` from
    my location in Columbus, Ohio.
'''
from skyfield.api import earth
import pytz

home = earth.topos('39.995 N', '83.004 W', elevation_m=250)
timezone = pytz.timezone('US/Eastern')