Skip to content

Commit

Permalink
updating tests to test limbdarklightcurve instead of starrylightcurve
Browse files Browse the repository at this point in the history
  • Loading branch information
dfm committed Aug 4, 2019
1 parent e0837a3 commit 592fea0
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions exoplanet/light_curves_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
from packaging import version

from .orbits import KeplerianOrbit
from .light_curves import StarryLightCurve
from .light_curves import LimbDarkLightCurve


def test_light_curve():
u = tt.vector()
b = tt.vector()
r = tt.vector()
lc = StarryLightCurve(u)
lc = LimbDarkLightCurve(u)
f = lc._compute_light_curve(b, r)
func = theano.function([u, b, r], f)

Expand All @@ -46,7 +46,9 @@ def test_light_curve_grad():
b_val = np.linspace(-1.5, 1.5, 20)
r_val = 0.1 + np.zeros_like(b_val)

lc = lambda u, b, r: StarryLightCurve(u)._compute_light_curve(b, r) # NOQA
lc = lambda u, b, r: LimbDarkLightCurve(u)._compute_light_curve(
b, r
) # NOQA
utt.verify_grad(lc, [u_val, b_val, r_val])


Expand All @@ -66,7 +68,7 @@ def test_in_transit():
u = np.array([0.2, 0.3, 0.1, 0.5])
r = np.array([0.1, 0.01])

lc = StarryLightCurve(u)
lc = LimbDarkLightCurve(u)
model1 = lc.get_light_curve(r=r, orbit=orbit, t=t)
model2 = lc.get_light_curve(r=r, orbit=orbit, t=t, use_in_transit=False)
vals = theano.function([], [model1, model2])()
Expand Down Expand Up @@ -97,7 +99,7 @@ def test_variable_texp():
r = np.array([0.1, 0.01])
texp0 = 0.1

lc = StarryLightCurve(u)
lc = LimbDarkLightCurve(u)
model1 = lc.get_light_curve(
r=r, orbit=orbit, t=t, texp=texp0, use_in_transit=False
)
Expand All @@ -124,12 +126,12 @@ def test_contact_bug():
t = np.linspace(-0.1, 0.1, 1000)
u = [0.3, 0.2]
y1 = (
StarryLightCurve(u)
LimbDarkLightCurve(u)
.get_light_curve(orbit=orbit, r=0.1, t=t, texp=0.02)
.eval()
)
y2 = (
StarryLightCurve(u)
LimbDarkLightCurve(u)
.get_light_curve(
orbit=orbit, r=0.1, t=t, texp=0.02, use_in_transit=False
)
Expand Down Expand Up @@ -167,7 +169,7 @@ def test_small_star():
a = orbit.a.eval()
incl = orbit.incl.eval()

lc = StarryLightCurve(u_star)
lc = LimbDarkLightCurve(u_star)

model1 = lc.get_light_curve(r=r_pl, orbit=orbit, t=t)
model2 = lc.get_light_curve(r=r_pl, orbit=orbit, t=t, use_in_transit=False)
Expand All @@ -194,7 +196,7 @@ def test_singular_points():
u = tt.vector()
b = tt.vector()
r = tt.vector()
lc = StarryLightCurve(u)
lc = LimbDarkLightCurve(u)
f = lc._compute_light_curve(b, r)
func = theano.function([u, b, r], f)
u_val = np.array([0.2, 0.3, 0.1, 0.5])
Expand Down

0 comments on commit 592fea0

Please sign in to comment.