PyTransit is now fixed

PyTransit is now fixed

by ENZO PASCALE -
Number of replies: 0

Hello,

PyTransit has been fixed. You can now either use the version I have previously distributed, or the latest snapshot from GitHub. See email below.

If you find other bugs, please let me know or contact Hannu directly. He would appreciate that.

E.

On Tue, 14 May 2019 at 13:10, Hannu Parviainen <hpparvi@gmail.com> wrote:
Hi Enzo,

Found the bug and fixed it smile It was caused by me translating my old Fortran code into python
and missing to change a couple of indices for interpolation (from Fortran's 1-based to Python's
0-based).

I've pushed the fix to GitHub, please let me know if you're encountering further issues.

Also. The time for the transit model should be given in days. Like:

import numpy as np
import matplotlib.pyplot as plt
import astropy.units as u
from pytransit import QuadraticModel as QM

# HD 21749 b
period = 35.61253 # days
t0     = 0.0      # days
e      = 0.325
omega  = 98.0     # deg
a      = 0.1915   # au
k      = 0.0350
R_star = 0.695    # Rsun
i      = 89.33    # deg
ld     = [0.4, 0.1]
Npt    = 1024*2


tt = np.linspace(-6.0/24, 6/24, Npt) # hours

# normalise quantities
omega = np.deg2rad(omega)
i     = np.deg2rad(i)
a     = a *u.au.to(u.R_sun)/R_star

ma  = QM()
ma.set_data(tt)

par = (k, ld, t0, period, a, i, e, omega)

lc = ma.evaluate_ps(*par)

fig = plt.figure(3123)
ax0 = fig.add_subplot(111)
ax0.plot(24*tt, lc, '-k')


Cheers,
Hannu

On 13/05/2019 16.52, Enzo Pascale wrote:
> Hello Hannu,

> I am teaching a master course on exoplanets in Rome, and run some exercise classes along that, where I am asking students to use PyTransit and attempt 
> some simple light curve modelling.

> When I setup the exercises in late February I git cloned PyTransit (it was on the 20th Feb 2019) and all worked fine.

> Now, students are installing the code on their laptops these days (cloning the latest version on GitHub) and are having some trouble. While I think I 
> have solved the all problems related to the Python part (it seams it is now required Python 3.6 and won't work with Python 3.5 because of the string 
> representation), I am left puzzled with the following example.
> As shown in the plot below, the light curve seams to come out significantly steppy for the case of an exoplanet on an eccentric orbit. Same example 
> (same code) run with the 20th Feb 2019 (but with the at the time available MandelAgol class) gives instead the expected behaviour: a nicely smooth curve.
> I attach the very simple script generating this plot.
> Thank you in advance for any suggestion you might be able to provide.
> Kind regards,
> Enzo

> Figure_3123.png

> -- 
> +-----------------------------------------------------------+
> Prof Enzo Pascale              |   +39 0649914270 (Work)
> Dipartimento di Fisica         |
> La Sapienza Università di Roma |       skype:epascale
> Piazzale Aldo Moro 2           | www.roma1.infn.it/~pascalee <http://www.roma1.infn.it/~pascalee>
> 00185 Roma, Italy              | enzo.pascale@uniroma1.it <mailto:enzo.pascale@uniroma1.it>
> +-----------------------------------------------------------+

> ___________________________________________