From ab2831d589432d54035009ede705bede0fef2a3a Mon Sep 17 00:00:00 2001 From: Anthony Romaniello Date: Wed, 6 Mar 2024 11:54:36 -0500 Subject: [PATCH] avoid error due to debug messages when run with no calibration --- scos_actions/hardware/sensor.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scos_actions/hardware/sensor.py b/scos_actions/hardware/sensor.py index 3e7552c0..08dbcd9c 100644 --- a/scos_actions/hardware/sensor.py +++ b/scos_actions/hardware/sensor.py @@ -280,10 +280,14 @@ def acquire_time_domain_samples( logger.debug("***********************************\n") logger.debug("Sensor.acquire_time_domain_samples starting") logger.debug(f"Number of retries = {retries}") - logger.debug( - f"USING DIFF. CAL: {self.differential_calibration.calibration_data}" - ) - logger.debug(f"USING SENSOR CAL: {self.sensor_calibration.calibration_data}") + if self.differential_calibration is not None: + logger.debug( + f"USING DIFF. CAL: {self.differential_calibration.calibration_data}" + ) + if self.sensor_calibration is not None: + logger.debug( + f"USING SENSOR CAL: {self.sensor_calibration.calibration_data}" + ) logger.debug("*************************************\n") max_retries = retries