lsst.sims.ocs.kernel.simulator module¶
-
class
lsst.sims.ocs.kernel.simulator.Simulator(options, configuration, database)[source]¶ Bases:
future.types.newobject.newobjectMain class for the survey simulation.
This class is responsible for setting up, running and shutting down the LSST survey simulation.
-
opts¶ argparse.Namespace – The options returned by the ArgumentParser instance.
-
conf¶ SimulationConfig– The simulation configuration instance.
-
db¶ SocsDatabase– The simulation database instance.
-
fractional_duration¶ float – The length in years for the simulated survey.
-
time_handler¶ TimeHandler– The simulation time handling instance.
-
log¶ logging.Logger – The logging instance.
-
sal¶ SalManager– The instance that manages interactions with the SAL.
-
dh¶ DowntimeHandler– The downtime handler instance.
-
conf_comm¶ ConfigurationCommunicator– The configuration communicator instance.
-
cloud_model¶ CloudModel– The cloud model instance.
-
seeing_model¶ SeeingModel– The seeing model instance.
-
field_database¶ lsst.sims.survey.fields.FieldsDatabase – The instance of the fields database.
-
field_selection¶ lsst.sims.survey.fields.FieldSelection – The instance of the field selector.
Initialize the class.
Parameters: - options (argparse.Namespace) – The instance returned by ArgumentParser containing the command-line options.
- configuration (
SimulationConfig) – The simulation configuration instance. - database (
SocsDatabase) – The simulation database instance.
-
finalize()[source]¶ Perform finalization steps.
This function handles finalization of the
SalManagerandSequencerinstances.
-
gather_proposal_history(phtype, topic)[source]¶ Gather the proposal history from the current target.
Parameters: - phtype (str) – The type of the proposal history (target or observation).
- topic (
scheduler_targetCorscheduler_interestedProposalC) – The topic instance to gather the observation proposal information from.
-
get_target_from_scheduler()[source]¶ Get target from scheduler.
This function provides the mechanism for getting the target from the Scheduler. Currently, a while loop is required to do this.
-
initialize()[source]¶ Perform initialization steps.
This function handles initialization of the
SalManagerandSequencerinstances and gathering the necessary telemetry topics.
-
start_day()[source]¶ Perform actions at the start of day.
This function performs all actions at the start of day. This involves:
- Sending a timestamp to the Scheduler
- Checking if the Scheduler requests a filter swap
- Peforming the filter swap if requested
-
start_night(night)[source]¶ Perform actions at the start of the night.
Parameters: night (int) – The current night.
-
write_proposal_fields(prop_fields)[source]¶ Transform the proposal field information and write to the survey database.
Parameters: prop_fields (dict) – The set of proposal fields information.
-
duration¶ int – The duration of the simulation in days.
-