FeatureScheduler¶
- class lsst.ts.scheduler.driver.FeatureScheduler(models, raw_telemetry, observing_blocks, parameters=None, log=None)¶
Bases:
DriverFeature scheduler driver.
Attributes Summary
Methods Summary
assert_survey_observing_script(survey_name)Assert that the input survey name has a dedicated observing script.
cold_start(observations)Rebuilds the internal state of the scheduler from a list of Targets.
configure_scheduler([config])This method is responsible for running the scheduler configuration and returning the survey topology, which specifies the number, name and type of projects running by the scheduler.
Convert EFD dataframe into list of driver targets.
Return the mapping between feature scheduler observation parameter keywords and the
Observationparameter name keywordsget_state_as_file_object(targets_queue)Get the current state of the scheduling algorithm as a file object.
get_survey_observing_block(survey_name)Return the appropriate survey observing block.
get_survey_topology(config)Get the survey topology.
load(config)Load a new set of targets.
parse_observation_database(filename)Parse an observation database into a list of observations.
register_observation(target)Register observation.
register_observed_target(target)Validates observation and returns a list of successfully completed observations.
reset_from_state(filename)Load the state from a file.
Save the current state of the scheduling algorithm to a file.
Pick a target and return it as a target object.
Pick a target and return it as a list of target objects.
Update conditions on the scheduler.
Attributes Documentation
- default_observation_database_name = PosixPath('/home/saluser/fbs_observation_database.sql')¶
Methods Documentation
- assert_survey_observing_script(survey_name: str) None¶
Assert that the input survey name has a dedicated observing script.
- Parameters:
- survey_name
str Name of the survey.
- survey_name
- Raises:
- AssertError:
If
survey_nameis not in the list of valid survey observing scripts.
- cold_start(observations: List[DriverTarget]) None¶
Rebuilds the internal state of the scheduler from a list of Targets.
- Parameters:
- observations
listofDriverTarget
- observations
- configure_scheduler(config=None)¶
This method is responsible for running the scheduler configuration and returning the survey topology, which specifies the number, name and type of projects running by the scheduler.
By default it will just return a test survey topology.
- Parameters:
- config
types.SimpleNamespace Configuration, as described by
schema/Scheduler.yaml
- config
- Returns:
- survey_topology:
lsst.ts.scheduler.kernel.SurveyTopology
- survey_topology:
- Raises:
- RuntimeError:
If
configdoes not have ascheduler_configattribute or if it points to a non-existing file.- NoSchedulerError:
If scheduler configuration does not define
schedulerattribute.- NoNsideError:
If scheduler configuration does not define
nsideattribute.
- convert_efd_observations_to_targets(efd_observations: DataFrame) List[DriverTarget]¶
Convert EFD dataframe into list of driver targets.
- Parameters:
- efd_observations
pandas.DataFrame Data frame returned from a query to the EFD for observations.
- efd_observations
- static fbs_observation_named_parameter_map() Dict[str, str]¶
Return the mapping between feature scheduler observation parameter keywords and the
Observationparameter name keywords- Returns:
dictMapping between fbs observations keywords and
Observationkeywords.
- get_state_as_file_object(targets_queue: list[lsst.ts.scheduler.driver.feature_scheduler_target.FeatureSchedulerTarget])¶
Get the current state of the scheduling algorithm as a file object.
- Parameters:
- targets_queue
list`[`DriverTarget] A List of targets in the queue to be observed.
- targets_queue
- Returns:
- file_object
io.BytesIO File object with the current.
- file_object
- get_stop_tracking_target() DriverTarget¶
- get_survey_observing_block(survey_name: str) ObservingBlock¶
Return the appropriate survey observing block.
- Parameters:
- survey_name
str Name of the survey.
- survey_name
- Returns:
- observing.ObservingBlock
Survey observing block.
- get_survey_topology(config: SimpleNamespace) SurveyTopology¶
Get the survey topology.
- Parameters:
- config
types.SimpleNamespace Configuration, as described by
schema/Scheduler.yaml
- config
- Returns:
- survey_topology
SurveyTopology Survey topology.
- survey_topology
- load(config)¶
Load a new set of targets.
- parse_observation_database(filename: str) None¶
Parse an observation database into a list of observations.
- register_observation(target: FeatureSchedulerTarget) None¶
Register observation.
Write the target observation into the observation database.
- Parameters:
- target
FeatureSchedulerTarget Target to register.
- target
- register_observed_target(target: DriverTarget) Observation¶
Validates observation and returns a list of successfully completed observations.
Add target observation to the feature based scheduler.
- Parameters:
- observation
listofTarget Python list of Targets observed.
- observation
- Returns:
- Observation
- reset_from_state(filename)¶
Load the state from a file.
- Parameters:
- filename
str Name of the file with the state.
- filename
- save_state()¶
Save the current state of the scheduling algorithm to a file.
- Returns:
- filename
str Name of the file with the state.
- filename
- select_next_target() FeatureSchedulerTarget¶
Pick a target and return it as a target object.
- Returns:
- Target
- select_next_targets() list[lsst.ts.scheduler.driver.feature_scheduler_target.FeatureSchedulerTarget]¶
Pick a target and return it as a list of target objects.
Instead of requesting a single target like
select_next_target, this method will inquire the scheduling algorithm for a list of potential next targets.- Returns:
- desired_observations:
list`[`FeatureSchedulerTarget] List of desired observations.
- desired_observations:
- update_conditions()¶
Update conditions on the scheduler.