From 1b89543dfb363f304ef51af138a015d598370b0a Mon Sep 17 00:00:00 2001 From: kvyh Date: Fri, 5 Aug 2016 01:56:30 -0700 Subject: [PATCH] moved moon_altaz to the non-location get_moon --- astroplan/observer.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/astroplan/observer.py b/astroplan/observer.py index 06c511ae..170db79e 100644 --- a/astroplan/observer.py +++ b/astroplan/observer.py @@ -1487,15 +1487,12 @@ def moon_altaz(self, time, ephemeris=None): return moon else: - moon_coords = [] - for t in time: - altaz_frame = AltAz(location=self.location, obstime=t) - moon_coord = get_moon(t, location=self.location, ephemeris=ephemeris).transform_to(altaz_frame) - moon_coords.append(moon_coord) - obstime = [coord.obstime for coord in moon_coords] - alts = u.Quantity([coord.alt for coord in moon_coords]) - azs = u.Quantity([coord.az for coord in moon_coords]) - dists = u.Quantity([coord.distance for coord in moon_coords]) + altaz_frame = AltAz(location=self.location, obstime=time) + moon_coords = get_moon(time, ephemeris=ephemeris).transform_to(altaz_frame) + obstime = time + alts = moon_coords.alt + azs = moon_coords.az + dists = moon_coords.distance return SkyCoord(AltAz(azs, alts, dists, obstime=obstime, location=self.location)) @u.quantity_input(horizon=u.deg)