nibcq.temperature.TemperatureAware ================================== .. py:class:: nibcq.temperature.TemperatureAware Mixin class for measurements that need temperature awareness. This class provides a simple interface for measurements that need access to temperature functionality. It delegates to the device's temperature capability if available. Typical Usage Workflow: 1. Enable temperature capability on device with `device.with_temperature(settings)` 2. Optionally set a temperature delta: `measurement.acceptable_temperature_delta = 2.5` 3. Measure or validate temperature against target: - Measure temperature: `measurement.measure_temperature()` - Validate temperature: `measurement.validate_temperature(target_temperature)` .. rubric:: Examples >>> # Setup device with temperature capability >>> device = Device.create(DeviceFamily.SMU, "PXI1Slot2") >>> settings = ThermocoupleSettings("Dev1/ai0") >>> device.with_temperature(settings) >>> >>> # Use in measurement >>> measurement = EIS(device) >>> compensation = measurement.load_compensation_file("file.json") >>> measurement.acceptable_temperature_delta = 1.5 # Optional override >>> current_temperature = measurement.measure_temperature() >>> print(f"Current Temperature: {current_temperature.center}°C") >>> is_valid = measurement.validate_temperature(compensation.temperature_parameter) .. py:property:: acceptable_temperature_delta :type: float Get the acceptable temperature delta for compensation validation. Returns the maximum allowed temperature difference from the device's temperature capability. This is a pass-through property that delegates to the underlying TemperatureCapability. :returns: The acceptable temperature delta in degrees, or NaN if no temperature capability :rtype: float .. rubric:: Examples >>> measurement = EIS(device) >>> measurement.acceptable_temperature_delta = 2.5 >>> delta = measurement.acceptable_temperature_delta .. py:property:: temperature :type: float Get the latest temperature reading from the device. :returns: The most recent temperature measurement, or NaN if no temperature capability .. py:property:: temperature_range :type: CenteredRange Get the latest temperature reading from the device, coupled with the user-set delta. :returns: A CenteredRange representing the most recent temperature measurement (NaN if not available), along with the acceptable temperature delta (NaN if not set). .. py:method:: measure_temperature() -> CenteredRange Get a new temperature reading from the device. :returns: Current temperature reading, or NaN if no temperature capability .. py:method:: validate_temperature(target_temperature: CenteredRange) -> bool Validate the current temperature against the compensation file's target. Delegates to the device's temperature capability for validation. The capability handles all validation logic including checking if thermocouple is configured, using overridden delta values if set, and printing appropriate warnings. :param target_temperature: The target temperature parameters for validation :returns: True if thermocouple is configured and temperature is within range. False if thermocouple is not configured (capability missing or not set up), or if target temperature/delta is NaN. :rtype: bool :raises ValueError: If the current temperature exceeds the target ± delta range (only raised when capability is configured) .. rubric:: Examples >>> measurement = EIS(device) >>> measurement.measure_temperature() >>> target = compensation.temperature_parameter >>> is_valid = measurement.validate_temperature(target)