astra.safety_monitor#

Classes

SafetyMonitor(observatory_config, ...)

class astra.safety_monitor.SafetyMonitor(observatory_config: ObservatoryConfig, database_manager: DatabaseManager, logger: ObservatoryLogger, device_manager: DeviceManager)[source]#

Bases: object

property device#
property weather_safe: bool | None#

Latest evaluated weather safety status.

property time_to_safe: float#

Minutes until conditions become safe again.

check_safety_monitor(max_safe_duration: int)[source]#

Polls the external SafetyMonitor and database history to determine if weather is currently safe.

check_internal_conditions() tuple[bool, float, float][source]#

Monitor internal safety systems and weather conditions.

Evaluates weather conditions against configured safety limits and determines if operations can continue safely. Checks observing conditions parameters against their defined closing limits and calculates time to safe operation.

Returns:

tuple

A tuple containing:
  • bool: True if weather conditions are safe for operation

  • float: Time in seconds until conditions become safe (0 if already safe)

  • float: Maximum safe duration in seconds for current conditions

The method examines each parameter in the closing_limits configuration: - Compares current values against upper and lower thresholds - Calculates time until conditions improve if currently unsafe - Determines maximum safe operating duration under current conditions

Note

  • Returns (True, 0, 0) if no ObservingConditions devices are configured

  • Used by the watchdog to make decisions about observatory operations

  • Critical for autonomous safety management

update_status() bool | None[source]#

Run external + internal checks and update weather_safe + time_to_safe.