25
25
26
26
from rubin_scheduler .scheduler .schedulers import CoreScheduler
27
27
from rubin_scheduler .scheduler .surveys import FieldSurvey
28
+ from rubin_scheduler .scheduler .basis_functions import BaseBasisFunction
28
29
29
30
from ..data import field_survey_centers
30
31
31
32
32
33
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
+ """
34
37
35
38
def __init__ (
36
39
self ,
37
40
nside : int = 32 ,
41
+ ntiers : int = 1 ,
38
42
) -> None :
39
43
40
44
self .nside = 32
41
- self .surveys = []
45
+ self .surveys = [
46
+ [] for _ in range (0 , ntiers )
47
+ ]
42
48
43
49
44
50
def _load_candidate_fields (self ) -> typing .Dict :
45
- """Docstring ."""
51
+ """Load pointing center data for field surveys ."""
46
52
name_fields , ra_fields , dec_fields = zip (* field_survey_centers .fields )
47
53
fields = {}
48
54
for name , ra , dec in zip (name_fields , ra_fields , dec_fields ):
@@ -52,14 +58,28 @@ def _load_candidate_fields(self) -> typing.Dict:
52
58
53
59
def add_field_surveys (
54
60
self ,
61
+ tier : int ,
62
+ program : str ,
55
63
field_names : typing .List [str ],
64
+ basis_functions : typing .List [BaseBasisFunction ] = [],
56
65
** kwargs ,
57
66
) -> 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.
61
68
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." )
63
83
64
84
fields = self ._load_candidate_fields ()
65
85
@@ -70,12 +90,12 @@ def add_field_surveys(
70
90
# Consider adding flexibility to add a prefix or suffix
71
91
survey_name = field_name
72
92
73
- self .surveys .append (
93
+ self .surveys [ tier ] .append (
74
94
FieldSurvey (
75
95
basis_functions ,
76
96
RA ,
77
97
dec ,
78
- survey_name = survey_name ,
98
+ survey_name = program ,
79
99
** kwargs ,
80
100
)
81
101
)
0 commit comments