Skip to content

Commit

Permalink
Add filter backwards-compatibility to models
Browse files Browse the repository at this point in the history
  • Loading branch information
rhiannonlynne committed Jan 24, 2025
1 parent 3f9cfbb commit 30257e1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions rubin_scheduler/site_models/seeing_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class SeeingModel:
efd_seeing : `str`, opt
The name of the DIMM FWHM measurements in the efd /
conditions object. Default `FWHM_500`
filter_list : `list` [`str`], opt
Deprecated version of band_list
"""

def __init__(
Expand All @@ -53,7 +55,12 @@ def __init__(
camera_seeing=0.30,
raw_seeing_wavelength=500,
efd_seeing="FWHM_500",
filter_list=None,
):
if filter_list is not None:
warnings.warn("filter_list deprecated in favor of band_list", FutureWarning)
self.filter_list = filter_list
band_list = filter_list
self.band_list = band_list
if eff_wavelens is None:
sev = SysEngVals()
Expand Down
10 changes: 9 additions & 1 deletion rubin_scheduler/skybrightness_pre/sky_model_pre.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ def interp_angle(x_out, xp, anglep, degrees=False):


def simple_daytime(sky_alt, sky_az, sun_alt, sun_az, band_name="r", bright_val=2.0, sky_alt_min=20.0):
"""A simple function to return a sky brightness map when the sun is up
"""A simple function to return a sky brightness map when the sun is up.
The map returned is simply "bright_val" regardless of band or altitude.
Parameters
----------
Expand Down Expand Up @@ -268,6 +270,7 @@ def return_mags(
badval=hp.UNSEEN,
bands=["u", "g", "r", "i", "z", "y"],
extrapolate=False,
filters=None,
):
"""Return a full sky map or individual pixels for the input mjd.
Expand Down Expand Up @@ -295,13 +298,18 @@ def return_mags(
extrapolate : `bool` (False)
In indx is set, extrapolate any masked pixels to be the
same as the nearest non-masked value from the full sky map.
filters : `list`, opt
Deprecated version of bands.
Returns
-------
sbs : `dict`
A dictionary with band names as keys and np.arrays as
values which hold the sky brightness maps in mag/sq arcsec.
"""
if filters is not None:
warnings.warn("filters deprecated in favor of bands", FutureWarning)
bands = filters
if mjd < self.loaded_range.min() or (mjd > self.loaded_range.max()):
self._load_data(mjd)

Expand Down

0 comments on commit 30257e1

Please sign in to comment.