Closed pmaxted closed 1 year ago
Hi @pmaxted!
Thanks for letting me know. This is appears to be a bug introduced by #558.
One slight workaround that works without modification to astroplan is to pass a SkyCoord
rather than a FixedTarget
:
import astroplan as ap
from astropy.time import Time
import astropy.units as u
from astropy.coordinates import SkyCoord
observer = ap.Observer.at_site('lasilla')
targets = SkyCoord.from_name('Sirius')
noon = Time("2023-06-06 12:00:00")
time_grid = ap.time_grid_from_range([noon,noon+1*u.day])
moon_constraint = ap.MoonSeparationConstraint(30*u.degree)
moon_ok_grid = moon_constraint.compute_constraint(time_grid, observer, targets)
I'll get a fix into main
ASAP.
New astroplan v0.9.1 released with this bugfix. Thanks again @pmaxted!
astropy-5.3.3 astroplan-0.9
I can get this working for a single target if I replace line 598 of constraints.py with ...
moon_separation = moon.separation(SkyCoord([target.coord for target in targets]))
... but I'm not sure why, and this does not work if targets is a list of more than one target.
-Pierre