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 ^^^^^^^^^^^^^^^ 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", 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): 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): 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(): 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)