Skip to content
Discussion options

You must be logged in to vote

Made a few changes...

#!/usr/bin/env python3

import skyfield
print( skyfield.__version__ )

from skyfield.api import N,S,E,W, wgs84, load
planets = load('de421.bsp')
earth, mars = planets['earth'], planets['mars barycenter']
ts = load.timescale()
# Altitude and azimuth in the sky of a
# specific geographic location

boston = earth + wgs84.latlon(42.3583 * N, 71.0603 * W, elevation_m=43) #AttributeError: 'Geocentric' object has no attribute 'observe'
astro = boston.at(ts.utc(1980, 3, 1)).observe( mars )
app = astro.apparent()

alt, az, distance = app.altaz()
print(alt.dstr())
print(az.dstr())
print(distance)

and got the results

1.46
24deg 30' 27.2"
93deg 04' 29.5"
0.678874 au

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Cannikev
Comment options

Answer selected by Cannikev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants