1. A fast and general planet transit (syzygy) code written in C and in Python.
2. pysyzygy
computes fast lightcurves for the most general case of a massive, eccentric planet orbiting a limb-darkened star. Here's a sample output image of an assymetric transit:
Clone the repository and run
python setup.py install
... is super easy.
import pysyzygy as ps
import numpy as np
import matplotlib.pyplot as pl
# Instantiate a transit object
trn = ps.Transit(t0 = 0.5, RpRs = 0.1, per = 1.234)
# Now evaluate the light curve on a grid of observation times
t = np.arange(0., 3.5, ps.transit.KEPSHRTCAD)
flux = trn(t)
# Plot the light curve
fig, ax = pl.subplots(figsize = (12, 5))
fig.subplots_adjust(bottom = 0.15)
ax.plot(t, flux, 'b.')
ax.set_xlabel('Time (days)', fontsize = 18)
ax.set_ylabel('Relative flux', fontsize = 18)
ax.margins(None, 0.5)
pl.show()
More detailed documentation coming soon. For now, check out the examples directory for
some cool things you can do with pysyzygy
.
Feel free to change, adapt, or incorporate this code into your project, but please make sure to cite this repository, as well as Mandel and Agol (2002), the transit model on which pysyzygy
is based.