astropy / astroplan

Observation planning package for astronomers – maintainer @bmorris3
https://astroplan.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
198 stars 109 forks source link

AltitudeConstraint: Adjust max_best_rescale() to prevent unexpected output #551

Closed michaelbaisch closed 1 year ago

michaelbaisch commented 1 year ago

In previous versions, when setting the max parameter for altitude, max_best_rescale() would return 1.0 if the altitude exceeded the maximum limit. This behavior was unexpected.

To rectify this, the greater_than_max argument in max_best_rescale() has been set to 0. This adjustment ensures that the output aligns with expectations when the altitude surpasses the specified maximum constraint.

wtgee commented 1 year ago

Hi @michaelbaisch, thanks for the PR. LGTM, but if you have time to write a specific test that would be even better! :)

bmorris3 commented 1 year ago

Thanks @michaelbaisch!