ben-cassese / squishyplanet

Transits of non-spherical exoplanets
https://squishyplanet.readthedocs.io/en/latest/
MIT License
4 stars 2 forks source link

Can't re-initialize 'projected_r' in lightcurve function #5

Closed vegajustin26 closed 5 months ago

vegajustin26 commented 5 months ago

Want to quickly create multiple lightcurves with different projected_r values, but throws an error about mismatching array sizes:

MWE:

from squishyplanet import OblateSystem
import jax
jax.config.update("jax_enable_x64", True)
import jax.numpy as jnp

state = {
    "parameterize_with_projected_ellipse" : True,
    "t_peri": 1071.23228*0.75,
    "times" : jnp.linspace(-1, 1, 1000),
    "a" : 560,
    "period" : 1071.23228,
    "projected_r": 0.12, 
    "projected_f": 0.1, 
    "projected_theta": jnp.pi/2, 
    "i" : jnp.pi/2,
    "ld_u_coeffs": jnp.array([0.0, 0.0]),
    "tidally_locked" : False,
}
oblate_planet = OblateSystem(**state)
oblate_lc = oblate_planet.lightcurve({"projected_r": 0.15})

Error: ValueError: All input arrays must have the same shape.

Upon testing, it seems like this error only pops up when I use the "projected_r" in the lightcurve function, all other projected variables can be set just fine.

ben-cassese commented 5 months ago

Thanks! This was fixed in #6, which makes sure projected_r, projected_theta, and projected_f all have the same shape in polynomial_limb_darkened_transit.lightcurve()