Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deps #67

Merged
merged 6 commits into from Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions Releases.rst
Expand Up @@ -91,6 +91,8 @@ documentation
Bug Fixes
---------

- Updated versions of dependencies to avoid bug caused by conflict between them [:issue:`67`]

sora.body
^^^^^^^^^^^

Expand All @@ -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
^^^^^^^^^^

Expand All @@ -127,13 +131,19 @@ 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
^^^^^^^^^^^^^^^

- Added white "facecolor" to occultation maps. [:issue:`65`]

- 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
^^^^^^^^^^^^^^^

Expand Down
12 changes: 6 additions & 6 deletions setup.py
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion sora/ephem/meta.py
Expand Up @@ -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):
Expand Down
7 changes: 5 additions & 2 deletions sora/occultation/core.py
Expand Up @@ -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,
Expand All @@ -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):
Expand Down
18 changes: 14 additions & 4 deletions sora/prediction/occmap.py
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion sora/prediction/table.py
Expand Up @@ -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)