From 257679d651ba54fe01ae86f7b68b7b07e342fa69 Mon Sep 17 00:00:00 2001 From: Sultan Orazbayev Date: Mon, 27 Mar 2023 10:13:08 +0600 Subject: [PATCH 1/2] Update constraints.py Increase accuracy of Moon separation --- astroplan/constraints.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/astroplan/constraints.py b/astroplan/constraints.py index 59be070c..2041581e 100644 --- a/astroplan/constraints.py +++ b/astroplan/constraints.py @@ -590,10 +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, + 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) From 22ffe42d4b977c14031f869f32f3ec7ddb1a7c2f Mon Sep 17 00:00:00 2001 From: Sultan Orazbayev Date: Mon, 27 Mar 2023 10:17:16 +0600 Subject: [PATCH 2/2] black made me do it --- astroplan/constraints.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/astroplan/constraints.py b/astroplan/constraints.py index 2041581e..f44f64d3 100644 --- a/astroplan/constraints.py +++ b/astroplan/constraints.py @@ -590,8 +590,7 @@ def __init__(self, min=None, max=None, ephemeris=None): self.ephemeris = ephemeris def compute_constraint(self, times, observer, targets): - moon = get_moon(times, location=observer.location, - 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