Skip to content
Snippets Groups Projects
Commit e55ff6e0 authored by Taya Snijder's avatar Taya Snijder
Browse files

polished the code a bit

parent 2a5cd492
Branches
Tags
1 merge request!421Resolve L2SS-920 "Make statistics writer tolerant"
......@@ -198,9 +198,10 @@ class statistics_data:
# get SST specific stuff
if self.marker == "S":
logger.debug(f"rcu_attenuator_dB: {file.get(f'{group_key}/rcu_attenuator_dB')}")
logger.debug(f"rcu_band_select: {file.get(f'{group_key}/rcu_band_select')}")
logger.debug(f"rcu_dth_on is: {file.get(f'{group_key}/rcu_dth_on')}")
self.data_id_signal_input_index = file[group_key].attrs["data_id_signal_input_index"]
# check if the dataset is empty or not. if empty, set to None, if not get the value
if file.get(f'{group_key}/rcu_attenuator_dB').shape is None:
self.rcu_attenuator_dB = None
......@@ -217,12 +218,6 @@ class statistics_data:
else:
self.rcu_dth_on = numpy.array(file.get(f"{group_key}/rcu_dth_on"))
self.data_id_signal_input_index = file[group_key].attrs["data_id_signal_input_index"]
# self.rcu_attenuator_dB = numpy.array(file.get(f"{group_key}/rcu_attenuator_dB"))
# self.rcu_band_select = numpy.array(file.get(f"{group_key}/rcu_band_select"))
# self.rcu_dth_on = numpy.array(file.get(f"{group_key}/rcu_dth_on"))
# get XST specific stuff
if self.marker == "X":
self.data_id_subband_index = file[group_key].attrs["data_id_subband_index"]
......
......@@ -318,7 +318,6 @@ class SstHdf5Writer(HDF5Writer):
compression="gzip",
)
except AttributeError:
logger.debug("set rcu_attenuator_dB_data to None")
current_group.create_dataset(
name="rcu_attenuator_dB",
data=h5py.Empty("f"),
......@@ -331,7 +330,6 @@ class SstHdf5Writer(HDF5Writer):
compression="gzip",
)
except AttributeError:
logger.debug("set rcu_band_select_data to None")
current_group.create_dataset(
name="rcu_band_select",
data=h5py.Empty("f"),
......@@ -344,7 +342,6 @@ class SstHdf5Writer(HDF5Writer):
compression="gzip",
)
except AttributeError:
logger.debug("set rcu_dth_on to None")
current_group.create_dataset(
name="rcu_dth_on",
data=h5py.Empty("f"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment