diff --git a/py/desisurvey/test/test_utils.py b/py/desisurvey/test/test_utils.py index 451012b..dcb4f17 100644 --- a/py/desisurvey/test/test_utils.py +++ b/py/desisurvey/test/test_utils.py @@ -35,12 +35,12 @@ def test_get_observer_to_sky(self): alt, az = self.table['alt'], self.table['az'] when = astropy.time.Time(self.table['jd'], format='jd') obs = utils.get_observer(when, alt * u.deg, az * u.deg) - obs_sky = obs.transform_to(astropy.coordinates.ICRS) + obs_sky = obs.transform_to(astropy.coordinates.ICRS()) true_sky = astropy.coordinates.ICRS(ra=ra * u.deg, dec=dec * u.deg) sep = true_sky.separation(obs_sky).to(u.arcsec).value # Opening angle between true and observed (ra,dec) unit vectors - # must be within 30 arcsec. - self.assertTrue(np.max(np.fabs(sep)) < 30) + # must be within 40 arcsec. + self.assertTrue(np.max(np.fabs(sep)) < 40) def test_get_observer_from_sky(self): """Check (alt,az) -> (ra,dec) against JPL Horizons""" @@ -52,8 +52,8 @@ def test_get_observer_from_sky(self): obs_altaz = sky.transform_to(utils.get_observer(when)) sep = true_altaz.separation(obs_altaz).to(u.arcsec).value # Opening angle between true and observed (alt,az) unit vectors - # must be within 30 arcsec. - self.assertTrue(np.max(np.fabs(sep)) < 30) + # must be within 40 arcsec. + self.assertTrue(np.max(np.fabs(sep)) < 40) def test_get_observer_args(self): """Must provide both alt and az to get_observer()""" diff --git a/py/desisurvey/utils.py b/py/desisurvey/utils.py index 5500d4a..7eb5edc 100644 --- a/py/desisurvey/utils.py +++ b/py/desisurvey/utils.py @@ -131,7 +131,7 @@ def get_airmass(when, ra, dec): """ target = astropy.coordinates.ICRS(ra=ra, dec=dec) zenith = get_observer(when, alt=90 * u.deg, az=0 * u.deg - ).transform_to(astropy.coordinates.ICRS) + ).transform_to(astropy.coordinates.ICRS()) # Calculate zenith angle in degrees. zenith_angle = target.separation(zenith) # Convert to airmass.