diff --git a/tangostationcontrol/tangostationcontrol/statistics/writer/hdf5.py b/tangostationcontrol/tangostationcontrol/statistics/writer/hdf5.py index 274a96081646338d420265ab4287278ffc1aca28..4a3d11adc915f22903a358a7c0a0493d14b98f2e 100644 --- a/tangostationcontrol/tangostationcontrol/statistics/writer/hdf5.py +++ b/tangostationcontrol/tangostationcontrol/statistics/writer/hdf5.py @@ -312,43 +312,49 @@ class SstHdf5Writer(HDF5Writer): ) try: - try: - rcu_attenuator_dB_data = self.current_matrix.parameters["rcu_attenuator_dB"].astype(numpy.int64) - except: - rcu_attenuator_dB_data = None - current_group.create_dataset( name="rcu_attenuator_dB", - data=rcu_attenuator_dB_data, + data=self.current_matrix.parameters["rcu_attenuator_dB"].astype(numpy.int64), + compression="gzip", + ) + except AttributeError: + logger.debug("set rcu_attenuator_dB_data to None") + current_group.create_dataset( + name="rcu_attenuator_dB", + data=None, + shape=(1,), compression="gzip", ) - try: - rcu_band_select_data = self.current_matrix.parameters["rcu_band_select"].astype(numpy.int64) - except: - rcu_band_select_data = None - + try: current_group.create_dataset( name="rcu_band_select", - data=rcu_band_select_data, + data=self.current_matrix.parameters["rcu_band_select"].astype(numpy.int64), + compression="gzip", + ) + except AttributeError: + logger.debug("set rcu_band_select_data to None") + current_group.create_dataset( + name="rcu_band_select", + data=None, + shape=(1,), compression="gzip", ) - try: - rcu_dth_on_data = self.current_matrix.parameters["rcu_dth_on"].astype(numpy.bool_) - except: - rcu_dth_on_data = None - + try: current_group.create_dataset( name="rcu_dth_on", - data=rcu_dth_on_data, + data=self.current_matrix.parameters["rcu_dth_on"].astype(numpy.bool_), + compression="gzip", + ) + except AttributeError: + logger.debug("set rcu_dth_on to None") + current_group.create_dataset( + name="rcu_dth_on", + data=None, + shape=(1,), compression="gzip", ) - - except AttributeError as e: - logger.warning("AttributeError: Device values not written.") - except Exception as e: - logger.warning("Device values not written.") class BstHdf5Writer(HDF5Writer):