diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/statistics_collector.py b/tangostationcontrol/tangostationcontrol/devices/sdp/statistics_collector.py index 784750cd0b01a2d7e144858af9f4eca39c6aee14..3a067aa9f6d090c0bdcb0d84f5f9766b6415791c 100644 --- a/tangostationcontrol/tangostationcontrol/devices/sdp/statistics_collector.py +++ b/tangostationcontrol/tangostationcontrol/devices/sdp/statistics_collector.py @@ -235,9 +235,8 @@ class XSTCollector(StatisticsCollector): # log if we're replacing a subband we were once recording previous_subband_in_slot = self.parameters["xst_subbands"][subband_slot] if previous_subband_in_slot != fields.subband_index: - previous_subband_timestamp = datetime.datetime.fromtimestamp(self.parameters["xst_timestamps"][subband_slot]) - - if previous_subband_timestamp.timestamp() > 0: + if self.parameters["xst_timestamps"][subband_slot] > 0: + previous_subband_timestamp = datetime.datetime.fromtimestamp(self.parameters["xst_timestamps"][subband_slot]) logger.info(f"Stopped recording XSTs for subband {previous_subband_in_slot}. Last data for this subband was received at {previous_subband_timestamp}.") def xst_values(self, subband_indices = None):