Skip to content

Commit 03d3de0

Browse files
committed
Add tiers for scheduler configuration
1 parent 21ae163 commit 03d3de0

File tree

1 file changed

+29
-9
lines changed

1 file changed

+29
-9
lines changed

python/lsst/ts/fbs/utils/maintel/make_fieldsurvey_scheduler.py

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,30 @@
2525

2626
from rubin_scheduler.scheduler.schedulers import CoreScheduler
2727
from rubin_scheduler.scheduler.surveys import FieldSurvey
28+
from rubin_scheduler.scheduler.basis_functions import BaseBasisFunction
2829

2930
from ..data import field_survey_centers
3031

3132

3233
class MakeFieldSurveyScheduler:
33-
"""Class to construct Feature Based Schedulers consisting of an ensemble of field surveys."""
34+
"""Construct Feature Based Scheduler configuration consisting of an
35+
ensemble of field surveys.
36+
"""
3437

3538
def __init__(
3639
self,
3740
nside: int = 32,
41+
ntiers: int = 1,
3842
) -> None:
3943

4044
self.nside = 32
41-
self.surveys = []
45+
self.surveys = [
46+
[] for _ in range(0, ntiers)
47+
]
4248

4349

4450
def _load_candidate_fields(self) -> typing.Dict:
45-
"""Docstring."""
51+
"""Load pointing center data for field surveys."""
4652
name_fields, ra_fields, dec_fields = zip(*field_survey_centers.fields)
4753
fields = {}
4854
for name, ra, dec in zip(name_fields, ra_fields, dec_fields):
@@ -52,14 +58,28 @@ def _load_candidate_fields(self) -> typing.Dict:
5258

5359
def add_field_surveys(
5460
self,
61+
tier: int,
62+
program: str,
5563
field_names: typing.List[str],
64+
basis_functions: typing.List[BaseBasisFunction] = [],
5665
**kwargs,
5766
) -> None:
58-
"""Add a set of field surveys to the scheduler configuration."""
59-
60-
# Assert that survey_name is not included among the kwargs
67+
"""Add a list of field surveys to the scheduler configuration.
6168
62-
basis_functions = []
69+
Parameters
70+
----------
71+
tier: `int`
72+
Tier index used to control prioritization of surveys.
73+
program_name: `str`
74+
Program name of BLOCK to be executed.
75+
field_names: `list` of `str`
76+
List of names to specify the pointing center of each field survey.
77+
basis_functions: `list` of `BaseBasisFunction`
78+
Basis functions provided to each field survey.
79+
"""
80+
81+
if "survey_name" in kwargs:
82+
raise ValueError("Use program_name rather than survey_name.")
6383

6484
fields = self._load_candidate_fields()
6585

@@ -70,12 +90,12 @@ def add_field_surveys(
7090
# Consider adding flexibility to add a prefix or suffix
7191
survey_name = field_name
7292

73-
self.surveys.append(
93+
self.surveys[tier].append(
7494
FieldSurvey(
7595
basis_functions,
7696
RA,
7797
dec,
78-
survey_name=survey_name,
98+
survey_name=program,
7999
**kwargs,
80100
)
81101
)

0 commit comments

Comments
 (0)