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

moved moon_altaz to the non-location get_moon #223

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions astroplan/observer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down