Skip to main content

A semi-analytic model for transits of spotted stars

Project description

spotrod: transit lightcurves of spotted stars

This repository contains spotrod, a semi-analytic model to calculate lightcurves of planetary transits of spotted stars. The model is implemented in pure Python.

Installation

Install the latest version of spotrod using pip:

pip install spotrod

Usage

import matplotlib.pyplot as plt
import numpy as np
import spotrod

time = np.linspace(-0.1, 0.1, 200)
eta, xi = spotrod.elements(time, period=5, a=14, k=0.0, h=0.0)

planetx = np.zeros(time.size)
planety = -xi

r = np.linspace(0.0005, 0.9995, 1000)
p = 0.05
z = np.sqrt(planetx * planetx + planety * planety)
planetangle = np.array([spotrod.circleangle(r, p, z[i]) for i in range(z.size)])

f = np.ones(r.size)
spotx = np.array([0.05])
spoty = np.array([0.35])
spotradius = np.array([0.2])
spotcontrast = np.array([0.5])
prediction = spotrod.integratetransit(
    planetx, planety, z, p, r, f, spotx, spoty, spotradius, spotcontrast, planetangle
)

plt.plot(time, prediction)

See examples directory for more examples.

Citation

If you use spotrod in a publication, please cite the publication Béky, Kipping, and Holman, 2014, MNRAS, 442, 3686.

License

Copyright 2013, 2014 Bence Béky

This file is part of Spotrod.

Spotrod is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Spotrod is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Spotrod.  If not, see <http://www.gnu.org/licenses/>.

Project details


Release history Release notifications | RSS feed

This version

3.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spotrod-3.1.tar.gz (64.0 kB view details)

Uploaded Source

File details

Details for the file spotrod-3.1.tar.gz.

File metadata

  • Download URL: spotrod-3.1.tar.gz
  • Upload date:
  • Size: 64.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for spotrod-3.1.tar.gz
Algorithm Hash digest
SHA256 3bb36c37edb6e495a7ba681cfa7af0139f0e8046ce44607d343d562e4adaa8df
MD5 01b5c737f095424b44bed282f80320a5
BLAKE2b-256 86c9f263c6f479921be47cf4743468638d5635a94aed41bda594169b1cb2c87a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page