From 2a642690cdc8a36edec0cbb81149441ee614157d Mon Sep 17 00:00:00 2001 From: Altair Gomes Date: Thu, 26 Aug 2021 10:27:17 -0300 Subject: [PATCH 1/6] Complement change in the name of the image as proposed by 6c9015cb to avoid possible conflict. --- sora/prediction/table.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sora/prediction/table.py b/sora/prediction/table.py index d4ea6c6..dc2e3e4 100644 --- a/sora/prediction/table.py +++ b/sora/prediction/table.py @@ -478,7 +478,7 @@ def keep_from_selected_images(self, path='.'): """ itens = [] for i, tca in enumerate(self['Epoch']): - name = '{}_{}'.format(self.meta['name'], tca.isot) + name = '{}_{}'.format(self.meta['name'], tca.isot.replace(':', '_')) if not glob.glob(os.path.join(path, name)+'*'): itens.append(i) self.remove_rows(itens) From 706abc663f182024252eddb7a438f5e8c25d812a Mon Sep 17 00:00:00 2001 From: Altair Gomes Date: Thu, 26 Aug 2021 10:29:34 -0300 Subject: [PATCH 2/6] Update versions of dependencies to avoid conflicts between them and errors of modified features. --- setup.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 4d24ace..ea6de93 100644 --- a/setup.py +++ b/setup.py @@ -19,13 +19,13 @@ url='https://github.com/riogroup/SORA', keywords=['science', 'astronomy', 'occultation'], install_requires=[ - 'numpy>=1.18', + 'numpy>=1.21', 'pyerfa>=2.0', - 'astropy>=4.0', - 'astroquery>=0.4.1', - 'spiceypy>=3.0.2', - 'matplotlib>=3.2', - 'scipy>=1.4.1', + 'astropy>=4.3.1', + 'astroquery>=0.4.3', + 'spiceypy>=4.0.2', + 'matplotlib>=3.4.3', + 'scipy>=1.7.1', 'requests', ], python_requires=">=3.7, <4", From 5838c3da7d83b3f289b848d134da3f50b046e195 Mon Sep 17 00:00:00 2001 From: Altair Gomes Date: Thu, 26 Aug 2021 10:31:58 -0300 Subject: [PATCH 3/6] Fixed bug when plotting the arrow in occultation map if the cartopy version is >=0.18. --- sora/prediction/occmap.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/sora/prediction/occmap.py b/sora/prediction/occmap.py index 98b93ed..ed649d3 100644 --- a/sora/prediction/occmap.py +++ b/sora/prediction/occmap.py @@ -696,11 +696,21 @@ def plot_occ_map(name, radius, coord, time, ca, pa, vel, dist, mag=0, longi=0, * # plots the the direction arrow if arrow: if limits is None: - plt.quiver(5500000, -5500000, (np.sin(paplus+90*u.deg)*np.sign(occs['vel'])).value, - (np.cos(paplus+90*u.deg)*np.sign(occs['vel'])).value, width=0.005) + dx = 1000000*(np.sin(paplus+90*u.deg)*np.sign(occs['vel'])).value + dy = 1000000*(np.cos(paplus+90*u.deg)*np.sign(occs['vel'])).value + plt.annotate('', xy=(5500000+dx, -5500000+dy), xycoords='data', + xytext=(5500000, -5500000), textcoords='data', + arrowprops=dict(facecolor='black', shrink=0.05), + horizontalalignment='right', verticalalignment='top', annotation_clip=False + ) else: - plt.quiver(lx + (ux-lx)*0.9, ly + (uy-ly)*0.1, (np.sin(paplus+90*u.deg)*np.sign(occs['vel'])).value, - (np.cos(paplus+90*u.deg)*np.sign(occs['vel'])).value, width=0.005, zorder=1.3) + dx = (1000000/zoom) * (np.sin(paplus + 90 * u.deg) * np.sign(occs['vel'])).value + dy = (1000000/zoom) * (np.cos(paplus + 90 * u.deg) * np.sign(occs['vel'])).value + plt.annotate('', xy=(lx + (ux-lx)*0.9 + dx, ly + (uy-ly)*0.1 + dy), xycoords='data', + xytext=(lx + (ux-lx)*0.9, ly + (uy-ly)*0.1), textcoords='data', + arrowprops=dict(facecolor='black', shrink=0.05), + horizontalalignment='right', verticalalignment='top', annotation_clip=False + ) # plots the countries names for country in countries.keys(): From e1ac554f5784b2ca4fd49483ed2c860d7458c82b Mon Sep 17 00:00:00 2001 From: Altair Gomes Date: Sun, 29 Aug 2021 22:50:00 -0300 Subject: [PATCH 4/6] Fixed bug that prevented Occultation instantiation if the size of the star can not be determined. --- sora/occultation/core.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sora/occultation/core.py b/sora/occultation/core.py index a0f2d32..50b0225 100644 --- a/sora/occultation/core.py +++ b/sora/occultation/core.py @@ -97,7 +97,10 @@ def __init__(self, star, body=None, ephem=None, time=None, reference_center='geo self.vel = vel # Shadow velocity at CA self.dist = dist # object distance at CA self.tca = tca # Instant of CA - self.star_diam = self.star.apparent_diameter(self.dist, verbose=False) + try: + self.star_diam = self.star.apparent_diameter(self.dist, verbose=False) + except ValueError: + self.star_diam = 0*u.km meta = { 'name': self.body.name, 'radius': self.body.radius.to(u.km).value, @@ -111,7 +114,7 @@ def __init__(self, star, body=None, ephem=None, time=None, reference_center='geo self.__observations = [] self._chords = ChordList(star=self.star, body=self._body, time=self.tca) self._chords._shared_with['occultation'] = {"vel": np.absolute(self.vel), "dist": float(self.dist.AU), - "star_diam": float(self.star_diam.km)} + "star_diam": float(self.star_diam.to(u.km).value)} @property def star(self): From a1626f85d3b62bf23fb03bd7cb467dc406631828 Mon Sep 17 00:00:00 2001 From: Altair Gomes Date: Sun, 29 Aug 2021 22:57:15 -0300 Subject: [PATCH 5/6] Fixed error when radius is inputted in the ephem classes. --- sora/ephem/meta.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sora/ephem/meta.py b/sora/ephem/meta.py index 26d8138..26b9d3c 100644 --- a/sora/ephem/meta.py +++ b/sora/ephem/meta.py @@ -69,7 +69,7 @@ def radius(self, value): if 'radius' in self._shared_with['body']: raise AttributeError('When {} is associated to a Body object, radius must be given to the Body' ' object.'.format(self.__class__.__name__)) - self._radius = float(value) + self._radius = u.Quantity(value, unit=u.km) @property def H(self): From a4e177329324ccf0b7c13b239ab854d6532acead Mon Sep 17 00:00:00 2001 From: Altair Gomes Date: Sun, 29 Aug 2021 23:06:35 -0300 Subject: [PATCH 6/6] Updated Changelog for PR #67 --- Releases.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Releases.rst b/Releases.rst index 0c3e423..c8cf337 100644 --- a/Releases.rst +++ b/Releases.rst @@ -91,6 +91,8 @@ documentation Bug Fixes --------- +- Updated versions of dependencies to avoid bug caused by conflict between them [:issue:`67`] + sora.body ^^^^^^^^^^^ @@ -104,6 +106,8 @@ sora.ephem - Added argument "meta" in "EphemHorizons". [:issue:`65`] +- Fixed bug when radius is inputted in the ephem classes. [:issue:`67`] + sora.extra ^^^^^^^^^^ @@ -127,6 +131,9 @@ sora.occultation - Fixed bug that prevented the user to ignore the chord name as labels when plotting the chords. [:issue:`66`] +- Fixed bug that prevented Occultation instantiation if the size of the star + can not be determined [:issue:`67`] + sora.prediction ^^^^^^^^^^^^^^^ @@ -134,6 +141,9 @@ sora.prediction - Fixed MAJOR bug that inverted the shadow velocity in some cases. [:issue:`66`] +- Fixed bug in the occultation map that did not plot the direction arrow in some + cases when cartopy>=0.18. [:issue:`67`] + sora.star ^^^^^^^^^^^^^^^