lsst.sims.ocs.kernel.sequencer module

class lsst.sims.ocs.kernel.sequencer.Sequencer(obs_site_config, idle_delay)[source]

Bases: future.types.newobject.newobject

Handle the observation of a target.

This class is responsible for taking a target from the Scheduler and performing the necessary steps to make an astronomical observation. It is then responsible for handing that observation back.

targets_received

int – Counter for the number of targets received by the sequencer.

targets_missed

int – Counter for the number of targets that were actually observed due to scheduler rejection.

observations_made

int – Counter for the number of observations made by the sequencer.

observation

SALPY_scheduler.observationC – DDS topic instance for the observation information.

observatory_model

MainObservatory – Instance of the SOCS observatory model.

observatory_state

SALPY_scheduler.observatoryStateC – DDS topic instance for the observatory state information.

idle_delay

float – Time (units=seconds) to wait when a missed target is received.

log

logging.Logger – The logging instance.

Initialize the class.

Parameters:
  • obs_site_config (ObservingSite) – The instance of the observing site configuration.
  • idle_delay (float) – The delay time (seconds) to skip forward when no target is received.
end_night()[source]

Perform end of night functions.

finalize()[source]

Perform finalization steps.

This function logs the number or targets received and observations made.

get_observatory_state(timestamp)[source]

Return the observatory state in a DDS topic instance.

Parameters:timestamp (float) – The current timestamp at the state retrieval request.
Returns:SALPY_scheduler.observatoryStateC
initialize(sal, obs_config)[source]

Perform initialization steps.

This function handles gathering the observation telemetry topic from the given SalManager instance.

Parameters:
  • sal (SalManager) – A SalManager instance.
  • obs_config (Observatory) – The instance of the observatory configuration.
observe_target(target, th)[source]

Observe the given target.

This function performs the necessary steps to observe the given target. The current steps are:

  • Update the simulation time after “slewing”
  • Copy target information to observation
  • Update the simulation time after “visit”

If the targetId is -1, this means a target was not offered by the Scheduler. Time is forwarded by the idle delay time and slew and exposure information are set to None. The observation takes the target’s Id.

Parameters:
  • target (SALPY_scheduler.targetC) – A target telemetry topic containing the current target information.
  • th (TimeHandler) – An instance of the simulation’s TimeHandler.
Returns:

  • SALPY_scheduler.observationC – An observation telemetry topic containing the observed target parameters.
  • dict(SlewHistory, SlewState, SlewState, list[SlewActivity]) – A dictionanry of all the slew information from the visit.
  • dict(list[TargetExposure], list[ObsExposure]) – A dictionary of all the exposure information from the visit.

sky_brightness_config()[source]

Get the configuration from the SkyModelPre files.

Returns:list[tuple(key, value)]
start_day(filter_swap)[source]

Perform start of day functions.

Parameters:filter_swap (scheduler_filterSwapC) – The instance of the filter swap information.
start_night(night, duration)[source]

Perform start of night functions.

Parameters:
  • night (int) – The current survey observing night.
  • duration (int) – The survey duration in days.
observations_made

Get the number of observations made.

Returns:int