Skip to content

Instantly share code, notes, and snippets.

@bmorris3
Last active December 17, 2015 16:18
Show Gist options
  • Save bmorris3/5637418 to your computer and use it in GitHub Desktop.
Save bmorris3/5637418 to your computer and use it in GitHub Desktop.
Model transit light curve of Earth using OSCAAR.
import numpy as np
from matplotlib import pyplot as plt
import oscaar
## Define system parameters for planet Earth, pulled from Wolfram Alpha
## Limb-darkening coeffs loosely based on Sanchez-Bajo et al. (2002) http://iopscience.iop.org/0143-0807/23/3/311
RpOverRs = 6367.5/695500.0 ## R_p/R_s = ratio of planetary radius to stellar radius
aOverRs = 1.49597887e8/695500.0 ## a/R_s = ratio of semimajor axis to stellar radius
period = 365.25 ## Period [days]
inclination = 90.0 ## Inclination [degrees]
gamma1 = 0.7 ## Linear limb-darkening coefficient
gamma2 = 0.0 ## Quadratic limb-darkening coefficient
eccentricity = 0.016710220 ## Eccentricity
longPericenter = 0.0 ## Longitude of pericenter
epoch = 2454954.357463 ## Mid transit time [Julian date]
## Generate times at which to calculate the flux
durationOfObservation = 16./24 ## Elapsed time [days]
times = np.arange(epoch-durationOfObservation/2,epoch+durationOfObservation/2,1e-5)
modelParams = [RpOverRs,aOverRs,period,inclination,gamma1,gamma2,eccentricity,longPericenter,epoch]
## Generate light curve
flux = oscaar.occultquad(times,modelParams)
## Plot light curve
plt.plot(times,flux,linewidth=2)
plt.title('Transit light curve for Earth')
plt.ylabel('Relative Flux')
plt.xlabel('Time (JD)')
plt.ylim([0.999,1.001])
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment