Created
March 13, 2012 05:18
-
-
Save aisipos/2026960 to your computer and use it in GitHub Desktop.
Venus Jupiter Separation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ephem, datetime, math | |
import matplotlib.pyplot as plt | |
venus = ephem.Venus() | |
jupiter = ephem.Jupiter() | |
observer=ephem.city('Los Angeles') | |
dates = [datetime.date(2012,3,1) + datetime.timedelta(days=x) for x in range(180)] | |
sep = [] | |
for date in dates: | |
observer.date=date | |
venus.compute(date) | |
jupiter.compute(date) | |
sep.append(ephem.separation(venus,jupiter) * 360.0 / 2*math.pi) | |
fig=plt.figure() | |
ax=fig.add_subplot(1,1,1) | |
ax.plot(dates, sep) | |
fig.autofmt_xdate() | |
ax.set_title('Angular Separation of Jupiter and Venus') | |
ax.set_xlabel('date') | |
ax.set_ylabel('Separation [degrees]') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment