Weather (pyobs.modules.weather)

Weather modules. TODO: write doc

Weather

class Weather(url: str, system_init_time: int = 300, **kwargs: Any)

Bases: Module, IWeather, IFitsHeaderBefore

Connection to pyobs-weather.

Initialize a new pyobs-weather connector.

Parameters:
  • url – URL to weather station

  • system_init_time – Time in seconds the full system needs to initialize

async get_current_weather(**kwargs: Any) Dict[str, Any][source]

Returns current weather.

Returns:

Dictionary containing entries for time, good, and sensor, with the latter being another dictionary with sensor information, which contain a value and a good flag.

async get_fits_header_before(namespaces: Optional[List[str]] = None, **kwargs: Any) Dict[str, Tuple[Any, str]][source]

Returns FITS header for the current status of this module.

Parameters:

namespaces – If given, only return FITS headers for the given namespaces.

Returns:

Dictionary containing FITS headers.

async get_sensor_value(station: str, sensor: WeatherSensors, **kwargs: Any) Tuple[str, float][source]

Return value for given sensor.

Parameters:
  • station – Name of weather station to get value from.

  • sensor – Name of sensor to get value from.

Returns:

Tuple of current value of given sensor or None and time of measurement or None.

async get_weather_status(**kwargs: Any) Dict[str, Any][source]

Returns status of object in form of a dictionary. See other interfaces for details.

async is_running(**kwargs: Any) bool[source]

Whether a service is running.

async is_weather_good(**kwargs: Any) bool[source]

Whether the weather is good to observe.

async open() None[source]

Open module.

async start(**kwargs: Any) None[source]

Starts a service.

async stop(**kwargs: Any) None[source]

Stops a service.