From a2cf62652d3cd3719913f40e9e4c56be214a2f15 Mon Sep 17 00:00:00 2001 From: Ekaterina Ilin Date: Fri, 3 Dec 2021 17:11:13 +0100 Subject: [PATCH 1/5] replaced inplace multiplication to remove bug --- fleck/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fleck/core.py b/fleck/core.py index 04f34d8..e80f574 100644 --- a/fleck/core.py +++ b/fleck/core.py @@ -747,7 +747,7 @@ def generate_spots(min_latitude, max_latitude, spot_radius, n_spots, delta_latitude = max_latitude - min_latitude if n_inclinations is not None and inclinations is None: inc_stellar = np.arccos(np.random.rand(n_inclinations)) - inc_stellar *= np.sign(np.random.uniform(-1, 1, n_inclinations)) * u.deg + inc_stellar = inc_stellar * np.sign(np.random.uniform(-1, 1, n_inclinations)) * u.deg else: n_inclinations = len(inclinations) if not inclinations.isscalar else 1 inc_stellar = inclinations From 1f095177956f881e9225746a3f3cd172fa1d7819 Mon Sep 17 00:00:00 2001 From: ekaterinailin Date: Fri, 3 Dec 2021 17:23:34 +0100 Subject: [PATCH 2/5] python 3.7 >> 3.8 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e18f340..52b469d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ env: # The following versions are the 'default' for tests, unless # overridden underneath. They are defined here in order to save having # to repeat them for all configurations. - - PYTHON_VERSION=3.7 + - PYTHON_VERSION=3.8 - NUMPY_VERSION=stable - ASTROPY_VERSION=stable - MAIN_CMD='python setup.py' From b3d86041080ec6f1334fc337928c3b3b29e02340 Mon Sep 17 00:00:00 2001 From: Ekaterina Ilin Date: Tue, 7 Dec 2021 19:14:40 +0100 Subject: [PATCH 3/5] inclinations were produced in rad, but given deg units --- fleck/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fleck/core.py b/fleck/core.py index e80f574..513efd5 100644 --- a/fleck/core.py +++ b/fleck/core.py @@ -243,7 +243,6 @@ def light_curve(self, spot_lons, spot_lats, spot_radii, inc_stellar, tilted_spots.z.value), mask=tilted_spots.x.value < 0) ld = limb_darkening_normed(self.u_ld, r) - # Compute the out-of-transit flux missing due to each spot f_spots = (np.pi * spot_radii**2 * (1 - self.spot_contrast) * ld * np.sqrt(1 - r**2)) @@ -747,7 +746,8 @@ def generate_spots(min_latitude, max_latitude, spot_radius, n_spots, delta_latitude = max_latitude - min_latitude if n_inclinations is not None and inclinations is None: inc_stellar = np.arccos(np.random.rand(n_inclinations)) - inc_stellar = inc_stellar * np.sign(np.random.uniform(-1, 1, n_inclinations)) * u.deg + inc_stellar = inc_stellar * np.sign(np.random.uniform(-1, 1, n_inclinations)) * u.rad + inc_stellar = inc_stellar.to(u.deg) else: n_inclinations = len(inclinations) if not inclinations.isscalar else 1 inc_stellar = inclinations From a1386e1c931bbc7d306cfb35cf08e9dd81469513 Mon Sep 17 00:00:00 2001 From: Ekaterina Ilin Date: Sat, 25 Dec 2021 17:42:30 +0100 Subject: [PATCH 4/5] changed spherical_to_cartesian to accomodate higher dimensional input before adding two axes for rotation matrix. --- fleck/core.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fleck/core.py b/fleck/core.py index 513efd5..572c8fb 100644 --- a/fleck/core.py +++ b/fleck/core.py @@ -236,13 +236,14 @@ def light_curve(self, spot_lons, spot_lats, spot_radii, inc_stellar, inc_stellar, times=times, planet=planet, time_ref=time_ref) - + # Compute the distance of each spot from the stellar centroid, mask # any spots that are "behind" the star, in other words, x < 0 r = np.ma.masked_array(np.hypot(tilted_spots.y.value, tilted_spots.z.value), mask=tilted_spots.x.value < 0) ld = limb_darkening_normed(self.u_ld, r) + # Compute the out-of-transit flux missing due to each spot f_spots = (np.pi * spot_radii**2 * (1 - self.spot_contrast) * ld * np.sqrt(1 - r**2)) @@ -347,16 +348,17 @@ def spherical_to_cartesian(self, spot_lons, spot_lats, inc_stellar, # Generate array of rotation matrices to rotate the spots about the # stellar rotation axis if times is None or (hasattr(times, '__len__') and times[0] is None): - rotate = rotation_matrix(self.phases[:, np.newaxis, np.newaxis], + rotate = rotation_matrix(self.phases[..., np.newaxis, np.newaxis], axis='z') else: if time_ref is None: time_ref = 0 rotational_phase = 2 * np.pi * ((times - time_ref) / self.rotation_period) * u.rad - rotate = rotation_matrix(rotational_phase[:, np.newaxis, np.newaxis], + rotate = rotation_matrix(rotational_phase[..., np.newaxis, np.newaxis], axis='z') + print(rotate.shape) rotated_spots = cartesian.transform(rotate) if planet is not None and hasattr(planet, 'lam'): From 0bfa1e5a00d093a8e90cb25c4d80a8f607bf1c15 Mon Sep 17 00:00:00 2001 From: Ekaterina Ilin Date: Sat, 25 Dec 2021 18:00:09 +0100 Subject: [PATCH 5/5] removed print statement --- fleck/core.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fleck/core.py b/fleck/core.py index 572c8fb..a71763e 100644 --- a/fleck/core.py +++ b/fleck/core.py @@ -130,7 +130,7 @@ def sort_plot_points(xy_coord, k0=0): n = len(xy_coord) distance_matrix = squareform(pdist(xy_coord, metric='euclidean')) mask = np.ones(n, dtype='bool') - sorted_order = np.zeros(n, dtype=np.int) + sorted_order = np.zeros(n, dtype=np.int32) indices = np.arange(n) i = 0 @@ -358,7 +358,6 @@ def spherical_to_cartesian(self, spot_lons, spot_lats, inc_stellar, rotate = rotation_matrix(rotational_phase[..., np.newaxis, np.newaxis], axis='z') - print(rotate.shape) rotated_spots = cartesian.transform(rotate) if planet is not None and hasattr(planet, 'lam'):