Skip to content

Commit

Permalink
Merge pull request #308 from gemini-hlsw/HOTFIX-8
Browse files Browse the repository at this point in the history
HOTFIX: Quantity vs numpy array
  • Loading branch information
stroncod authored Sep 7, 2023
2 parents d58e903 + e1b9b9e commit 7d81f55
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scheduler/core/components/selector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,10 @@ def _wind_conditions(variant: Variant,
Calculate the effect of the wind conditions on the score of an observation.
"""
wind = np.ones(len(azimuth))
az_wd = np.abs(azimuth - variant.wind_dir)
az_wd = np.abs(azimuth.to_value() - variant.wind_dir.to_value())
idx = np.where(np.logical_and(variant.wind_spd > Selector._wind_spd_bound, # * u.m / u.s
np.logical_or(az_wd <= Selector._wind_sep,
360. * u.deg - az_wd <= Selector._wind_sep)))[0]
np.logical_or(az_wd <= Selector._wind_sep.to_value(),
360 - az_wd <= Selector._wind_sep.to_value())))[0]

# Adjust down to 0 if the wind conditions are not adequate.
wind[idx] = 0
Expand Down

0 comments on commit 7d81f55

Please sign in to comment.