Code Monkey home page Code Monkey logo

pysyzygy's Introduction

py·sy·zy·gy

/ˈpīsizijē/

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:

transit

Installation

Clone the repository and run

python setup.py install

Calling pysyzygy...

... 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()

transit

Notes

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.