Skip to content

Commit

Permalink
Merge pull request #568 from bmorris3/fix-issue-567
Browse files Browse the repository at this point in the history
Convert FixedTargets passed to `get_body` into SkyCoords
  • Loading branch information
bmorris3 committed Sep 20, 2023
2 parents 43a32fc + 158b72a commit 258a88c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
0.9 (unreleased)
0.9.1 (unreleased)
------------------

- Fix bug when ``FixedTarget`` objects are passed to methods that calculate
lunar coordinates. [#568]

0.9 (2023-07-27)
----------------

- Fix time range in ``months_observable`` to not be only in 2014. Function now
Expand Down
2 changes: 2 additions & 0 deletions astroplan/constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ def compute_constraint(self, times, observer, targets):
# by the observer.
# 'get_sun' returns ICRS coords.
sun = get_body('sun', times, location=observer.location)
targets = get_skycoord(targets)
solar_separation = sun.separation(targets)

if self.min is None and self.max is not None:
Expand Down Expand Up @@ -595,6 +596,7 @@ def compute_constraint(self, times, observer, targets):
# moon.separation(targets) is NOT the same as targets.separation(moon)
# the former calculates the separation in the frame of the moon coord
# which is GCRS, and that is what we want.
targets = get_skycoord(targets)
moon_separation = moon.separation(targets)

if self.min is None and self.max is not None:
Expand Down

0 comments on commit 258a88c

Please sign in to comment.