SequentialScheduler¶
- class lsst.ts.scheduler.driver.SequentialScheduler(models: dict[str, Any], raw_telemetry: dict[str, Any], observing_blocks: dict[str, lsst.ts.observing.block.ObservingBlock], parameters: Any = None, log: Logger | None = None)¶
Bases:
DriverA simple scheduler driver that implements a sequential scheduler algorithm.
The driver reads from an input file of targets provided by the user and send one target at a time.
- Parameters:
- models
dict`[`str,typing.Any] Models.
- raw_telemetry
dict`[`str,typing.Any] Raw telemetry
- observing_blocks
dict`[`str,observing.ObservingBlock] Observing blocks.
- parameters
typing.Any, optional Driver parameters, by default None
- log
logging.Logger| None, optional Logger, by default None
- models
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 observations.
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.
get_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 observations.
register_observed_target(target)Validates observed target and returns an observation.
reset_from_state(filename)Load the state from a file.
Save the current state of the scheduling algorithm to a file.
schema()Get schema for the sequential scheduler algorithm configuration files.
Picks a target and returns it as a target object.
Select a list of targets.
Update driver internal conditions.
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[lsst.ts.scheduler.driver.observation.Observation]) None¶
Rebuilds the internal state of the scheduler from a list of observations.
- Parameters:
- observations
list`[`Observation] List of observations.
- 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:
- 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
- get_state_as_file_object(targets_queue: list[lsst.ts.scheduler.driver.driver_target.DriverTarget])¶
Get the current state of the scheduling algorithm as a file object.
- 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.
Format of the input file must be the same as that for the configure method. The targets will be appended to the existing queue.
- Raises:
- RuntimeError:
If driver is not configured.
- parse_observation_database(filename: str) None¶
Parse an observation database into a list of observations.
- register_observation(target: DriverTarget) None¶
Register observations.
This method should store the observation in a way that can be retrieved afterwards by the driver.
The default implementation is not implemented.
- Parameters:
- target
DriverTarget Observation to register.
- target
- register_observed_target(target: DriverTarget) Observation¶
Validates observed target and returns an observation.
- Parameters:
- target
DriverTarget Observed target to register.
- target
- Returns:
ObservationRegistered 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
- schema() dict[str, Any]¶
Get schema for the sequential scheduler algorithm configuration files.
- Returns:
dict`[str, `typing.Any]Schema.
- select_next_target() DriverTarget¶
Picks a target and returns it as a target object.
- Returns:
DriverTargetTarget to observe.