Skip to content

Commit

Permalink
Merge pull request #546 from SultanOrazbayev/patch-2
Browse files Browse the repository at this point in the history
Increase accuracy of Moon separation by including location of the observer
  • Loading branch information
bmorris3 authored Apr 3, 2023
2 parents 7649a29 + 22ffe42 commit cb9517e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions astroplan/constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,11 +590,7 @@ def __init__(self, min=None, max=None, ephemeris=None):
self.ephemeris = ephemeris

def compute_constraint(self, times, observer, targets):
# removed the location argument here, which causes small <1 deg
# innacuracies, but it is needed until astropy PR #5897 is released
# which should be astropy 1.3.2
moon = get_moon(times,
ephemeris=self.ephemeris)
moon = get_moon(times, location=observer.location, ephemeris=self.ephemeris)
# note to future editors - the order matters here
# moon.separation(targets) is NOT the same as targets.separation(moon)
# the former calculates the separation in the frame of the moon coord
Expand Down

0 comments on commit cb9517e

Please sign in to comment.