Skip to content

Commit

Permalink
Fix astropy deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dkirkby committed Nov 16, 2018
1 parent 2707055 commit 075e03d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions py/desisurvey/test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def test_get_airmass_lowest(self):
"""The lowest airmass occurs when dec=latitude"""
t = astropy.time.Time('2020-01-01')
ra = np.arange(360) * u.deg
dec = utils.get_location().latitude
dec = utils.get_location().lat
Xinv = 1 / utils.get_airmass(t, ra, dec)
self.assertTrue(np.max(Xinv) > 0.999)
dec = dec + 30 * u.deg
Expand All @@ -185,8 +185,8 @@ def test_get_airmass_always_visible(self):
def test_get_location(self):
"""Check for sensible coordinates"""
loc = utils.get_location()
self.assertTrue(np.fabs(loc.latitude.to(u.deg).value - 32.0) < 0.1)
self.assertTrue(np.fabs(loc.longitude.to(u.deg).value + 111.6) < 0.1)
self.assertTrue(np.fabs(loc.lat.to(u.deg).value - 32.0) < 0.1)
self.assertTrue(np.fabs(loc.lon.to(u.deg).value + 111.6) < 0.1)
self.assertTrue(np.fabs(loc.height.to(u.m).value - 2120) < 0.1)

def test_get_location_cache(self):
Expand Down
2 changes: 1 addition & 1 deletion py/desisurvey/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def update_iers(save_name='iers_frozen.ecsv', num_avg=1000):

# Save the table. The IERS-B table provided with astropy uses the
# ascii.cds format but astropy cannot write this format.
iers.write(save_name, format='ascii.ecsv')
iers.write(save_name, format='ascii.ecsv', overwrite=True)
log.info('Wrote updated table to {0}.'.format(save_name))


Expand Down

0 comments on commit 075e03d

Please sign in to comment.