Skip to content

dummy_temperature_monitor

frog.hardware.plugins.temperature.dummy_temperature_monitor ¤

This module provides an interface to dummy DP9800 temperature readers.

Attributes¤

Classes¤

DummyTemperatureMonitor(hot_bb_channel, cold_bb_channel, temperature_params=_DEFAULT_TEMP_PARAMS) ¤

Bases: TemperatureMonitorBase

A dummy temperature monitor for GUI testing.

Create a new DummyTemperatureMonitor.

Parameters:

Name Type Description Default
hot_bb_channel str

Channel name for hot black body

required
cold_bb_channel str

Channel name for cold black body

required
temperature_params Sequence[NoiseParameters]

Parameters for generating temperatures

_DEFAULT_TEMP_PARAMS
Source code in src/frog/hardware/plugins/temperature/dummy_temperature_monitor.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
def __init__(
    self,
    hot_bb_channel: str,
    cold_bb_channel: str,
    temperature_params: Sequence[NoiseParameters] = _DEFAULT_TEMP_PARAMS,
) -> None:
    """Create a new DummyTemperatureMonitor.

    Args:
        hot_bb_channel: Channel name for hot black body
        cold_bb_channel: Channel name for cold black body
        temperature_params: Parameters for generating temperatures
    """
    if len(temperature_params) != NUM_TEMPERATURE_MONITOR_CHANNELS:
        raise ValueError(
            f"Must provide {NUM_TEMPERATURE_MONITOR_CHANNELS} parameters"
        )

    self._temperature_producers = [
        NoiseProducer.from_parameters(params, type=Decimal)
        for params in temperature_params
    ]

    super().__init__(hot_bb_channel=hot_bb_channel, cold_bb_channel=cold_bb_channel)
Functions¤
get_temperatures() ¤

Get current temperatures.

Source code in src/frog/hardware/plugins/temperature/dummy_temperature_monitor.py
54
55
56
def get_temperatures(self) -> Sequence:
    """Get current temperatures."""
    return [producer() for producer in self._temperature_producers]