Events (pyobs.events)

TODO: write doc

BadWeatherEvent

class BadWeatherEvent(**kwargs: Any)

Event to be sent on bad weather.

Event

class Event(**kwargs: Any)

Base class for all events.

Every subclass is registered by its class name (the wire type and the pubsub node id only carry the name), no matter where it is defined, so that plugins can define their own events. Two different classes with the same name are rejected.

ExposureStatusChangedEvent

class ExposureStatusChangedEvent(current: ExposureStatus, last: ExposureStatus | None = None, **kwargs: Any)

Event to be sent, when the exposure status of a device changes.

FilterChangedEvent

class FilterChangedEvent(current: str, **kwargs: Any)

Event to be sent when a filter has been changed.

FocusFoundEvent

class FocusFoundEvent(focus: float, error: float | None = None, filter_name: str | None = None, **kwargs: Any)

Event to be sent when a new best focus has been found, e.g. after a focus series.

GoodWeatherEvent

class GoodWeatherEvent(eta: Time | None = None, **kwargs: Any)

Event to be sent on good weather.

Initializes a new good weather event.

Parameters:

eta – Predicted ETA for when the telescope will be fully operational

LogEvent

class LogEvent(time: str, level: str, filename: str, function: str, line: int, message: str, sender: str = '', **kwargs: Any)

Event for log entries.

ModeChangedEvent

class ModeChangedEvent(group: str, current: str, **kwargs: Any)

Event to be sent when a mode has been changed.

ModuleClosedEvent

class ModuleClosedEvent(**kwargs: Any)

Event to be sent when a module has closed.

ModuleOpenedEvent

class ModuleOpenedEvent(**kwargs: Any)

Event to be sent when a module has opened.

MotionStatusChangedEvent

class MotionStatusChangedEvent(status: MotionStatus, interfaces: dict[str, MotionStatus] | None = None, **kwargs: Any)

Event to be sent when the motion status of a device has changed.

MoveAltAzEvent

class MoveAltAzEvent(alt: float, az: float, **kwargs: Any)

Event to be sent when moving to Alt/Az.

MoveEvent

class MoveEvent(**kwargs: Any)

Event to be sent when moving to a new target.

MoveRaDecEvent

class MoveRaDecEvent(ra: float, dec: float, **kwargs: Any)

Event to be sent when moving to RA/Dec.

NewImageEvent

class NewImageEvent(filename: str, image_type: ImageType | None = None, raw: str | None = None, **kwargs: Any)

Event to be sent on a new image.

Initializes new NewImageEvent.

Parameters:
  • filename – Name of new image file.

  • image_type – Type of image.

  • raw – Only for reduced images, references raw frame.

NewSpectrumEvent

class NewSpectrumEvent(filename: str, **kwargs: Any)

Event to be sent on a new image.

Initializes new NewSpectrumEvent.

Parameters:

filename – Name of new image file.

OffsetsAltAzEvent

class OffsetsAltAzEvent(alt: float, az: float, **kwargs: Any)

Event to be sent when an RA/Dec offset is to be moved.

OffsetsEvent

class OffsetsEvent(**kwargs: Any)

Event to be sent when an offset is to be moved.

OffsetsRaDecEvent

class OffsetsRaDecEvent(ra: float, dec: float, **kwargs: Any)

Event to be sent when an RA/Dec offset is to be moved.

RoofClosingEvent

class RoofClosingEvent(**kwargs: Any)

Event to be sent when the roof starts closing.

RoofOpenedEvent

class RoofOpenedEvent(**kwargs: Any)

Event to be sent when the roof has finished opening.

TaskFailedEvent

class TaskFailedEvent(name: str, id: Any, obsnum: str | None = None, **kwargs: Any)

Event to be sent when a task has failed.

Initializes a new task failed event.

Parameters:
  • name – Name of task that just failed

  • id – Unique identifier for task

  • obsnum – Per-night observation number of the run that just failed, e.g. “20260810-001”

TaskFinishedEvent

class TaskFinishedEvent(name: str, id: Any, obsnum: str | None = None, **kwargs: Any)

Event to be sent when a task has finished.

Initializes a new task finished event.

Parameters:
  • name – Name of task that just finished

  • id – Unique identifier for task

  • obsnum – Per-night observation number of the run that just finished, e.g. “20260810-001”

TaskSkippedEvent

class TaskSkippedEvent(name: str, id: Any, reason: str, **kwargs: Any)

Event to be sent when a scheduled task is skipped without running.

Initializes a new task skipped event.

Parameters:
  • name – Name of task that was skipped

  • id – Unique identifier for task

  • reason – Human-readable reason why the task was skipped

TaskStartedEvent

class TaskStartedEvent(name: str, id: Any, eta: Time | None = None, obsnum: str | None = None, **kwargs: Any)

Event to be sent when a task has started.

Initializes a new task started event.

Parameters:
  • name – Name of task that just started

  • id – Unique identifier for task

  • eta – Predicted ETA for when the task will finish

  • obsnum – Per-night observation number assigned to this run, e.g. “20260810-001”

TestEvent

class TestEvent(message: str | None = None, **kwargs: Any)

Just a test event.