From 1bb32d0e1a08be38938de4c0bee61da5fd239aee Mon Sep 17 00:00:00 2001 From: Christina Hedges Date: Mon, 1 Feb 2021 14:43:37 -0800 Subject: [PATCH 1/3] added a silly reflected light approximation to secondary WIP --- src/exoplanet/light_curves/secondary_eclipse.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/exoplanet/light_curves/secondary_eclipse.py b/src/exoplanet/light_curves/secondary_eclipse.py index c1d1da75a..da5e89255 100644 --- a/src/exoplanet/light_curves/secondary_eclipse.py +++ b/src/exoplanet/light_curves/secondary_eclipse.py @@ -4,6 +4,8 @@ from ..utils import as_tensor_variable from .limb_dark import LimbDarkLightCurve +import numpy as np +from theano.tensor import cos, arcsin class SecondaryEclipseLightCurve: @@ -38,6 +40,8 @@ def get_light_curve( order=0, use_in_transit=None, light_delay=False, + reflected=False, + lag=0 ): r = as_tensor_variable(r) orbit2 = orbit._flip(r) @@ -64,5 +68,10 @@ def get_light_curve( k = r / orbit.r_star flux_ratio = self.surface_brightness_ratio * k ** 2 + if reflected: + phase = (t - orbit2.t0)/orbit2.period % 1 + phase_curve = cos(2 * phase * np.pi + lag)[:, None] + lc_2_w_phase_curve = (lc2) + phase_curve * 0**(-lc2) + return (lc1 + lc_2_w_phase_curve * flux_ratio + flux_ratio)/(1 + flux_ratio) return (lc1 + flux_ratio * lc2) / (1 + flux_ratio) From 69a42a560ecadd11a51d71e4da80f5eec1efadfe Mon Sep 17 00:00:00 2001 From: Christina Hedges Date: Mon, 1 Feb 2021 14:51:34 -0800 Subject: [PATCH 2/3] added a silly reflected light approximation to secondary WIP --- src/exoplanet/light_curves/secondary_eclipse.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/exoplanet/light_curves/secondary_eclipse.py b/src/exoplanet/light_curves/secondary_eclipse.py index da5e89255..2fe8f29c2 100644 --- a/src/exoplanet/light_curves/secondary_eclipse.py +++ b/src/exoplanet/light_curves/secondary_eclipse.py @@ -5,7 +5,7 @@ from ..utils import as_tensor_variable from .limb_dark import LimbDarkLightCurve import numpy as np -from theano.tensor import cos, arcsin +from theano.tensor import cos class SecondaryEclipseLightCurve: @@ -71,7 +71,7 @@ def get_light_curve( if reflected: phase = (t - orbit2.t0)/orbit2.period % 1 phase_curve = cos(2 * phase * np.pi + lag)[:, None] - lc_2_w_phase_curve = (lc2) + phase_curve * 0**(-lc2) - return (lc1 + lc_2_w_phase_curve * flux_ratio + flux_ratio)/(1 + flux_ratio) + lc2_w_phase_curve = (lc2) + phase_curve * 0**(-lc2) + return (lc1 + lc2_w_phase_curve * flux_ratio + flux_ratio)/(1 + flux_ratio) return (lc1 + flux_ratio * lc2) / (1 + flux_ratio) From 7bf5e2cb29be74e36f5dfde1760212656daf1410 Mon Sep 17 00:00:00 2001 From: Christina Hedges Date: Mon, 1 Feb 2021 14:56:16 -0800 Subject: [PATCH 3/3] complying with style --- src/exoplanet/light_curves/secondary_eclipse.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/exoplanet/light_curves/secondary_eclipse.py b/src/exoplanet/light_curves/secondary_eclipse.py index 2fe8f29c2..3b208fa98 100644 --- a/src/exoplanet/light_curves/secondary_eclipse.py +++ b/src/exoplanet/light_curves/secondary_eclipse.py @@ -2,11 +2,12 @@ __all__ = ["SecondaryEclipseLightCurve"] -from ..utils import as_tensor_variable -from .limb_dark import LimbDarkLightCurve import numpy as np from theano.tensor import cos +from ..utils import as_tensor_variable +from .limb_dark import LimbDarkLightCurve + class SecondaryEclipseLightCurve: """The light curve for a secondary eclipse model computed using starry @@ -41,7 +42,7 @@ def get_light_curve( use_in_transit=None, light_delay=False, reflected=False, - lag=0 + lag=0, ): r = as_tensor_variable(r) orbit2 = orbit._flip(r) @@ -69,9 +70,11 @@ def get_light_curve( k = r / orbit.r_star flux_ratio = self.surface_brightness_ratio * k ** 2 if reflected: - phase = (t - orbit2.t0)/orbit2.period % 1 + phase = (t - orbit2.t0) / orbit2.period % 1 phase_curve = cos(2 * phase * np.pi + lag)[:, None] - lc2_w_phase_curve = (lc2) + phase_curve * 0**(-lc2) - return (lc1 + lc2_w_phase_curve * flux_ratio + flux_ratio)/(1 + flux_ratio) + lc2_w_phase_curve = (lc2) + phase_curve * 0 ** (-lc2) + return (lc1 + lc2_w_phase_curve * flux_ratio + flux_ratio) / ( + 1 + flux_ratio + ) return (lc1 + flux_ratio * lc2) / (1 + flux_ratio)