Skip to content

Commit

Permalink
Fix bug in BandToFilterDetailer
Browse files Browse the repository at this point in the history
  • Loading branch information
rhiannonlynne committed Feb 21, 2025
1 parent f9f3b1c commit 77ed1f7
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions rubin_scheduler/scheduler/detailers/detailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,10 @@ def __init__(self, band_to_filter_dict=None):
def __call__(self, observation_array, conditions):
u_bands = np.unique(observation_array["band"])
for band in u_bands:
indx = np.where(observation_array["band"] == band)[0]
if band not in self.band_to_filter_dict.keys():
# If the BandToFilterDetailer was set up with an
# empty dictionary (not None), then just copy the configured
# (possibly physical filtername) into band.
observation_array[indx]["filter"] = band
else:
observation_array[indx]["filter"] = self.band_to_filter_dict[band]
indx = np.where(observation_array["band"] == band)
# Fetch the dictionary value or just continue to use band
filtername = self.band_to_filter_dict.get(band, band)
observation_array["filter"][indx] = filtername

return observation_array

Expand Down

0 comments on commit 77ed1f7

Please sign in to comment.