From bc911805335e0c93343bcc851937b2ddbff52681 Mon Sep 17 00:00:00 2001 From: Rama Vasudevan Date: Tue, 19 Dec 2023 20:59:15 -0500 Subject: [PATCH] Labview patch fix for some corrupted BELINE --- BGlib/be/translators/labview_h5_patcher.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/BGlib/be/translators/labview_h5_patcher.py b/BGlib/be/translators/labview_h5_patcher.py index c608cd3..631c250 100644 --- a/BGlib/be/translators/labview_h5_patcher.py +++ b/BGlib/be/translators/labview_h5_patcher.py @@ -153,15 +153,15 @@ def translate(self, h5_path, force_patch=False, **kwargs): if h5_spec_vals.shape[1]!=h5_raw.shape[1]: print("Problem encountered with spectroscopic dimensions. Attempting to fix.") - spec_inds_fixed = h5_main.parent.create_dataset("spec_inds_fixed", + spec_inds_fixed = h5_raw.parent.create_dataset("spec_inds_fixed", shape=(1,h5_raw.shape[1]),dtype = 'uint32') - spec_inds_fixed.attrs['labels'] = spec_indices.attrs['labels'] - spec_inds_fixed.attrs['units'] = spec_indices.attrs['units'] + spec_inds_fixed.attrs['labels'] = h5_spec_inds.attrs['labels'] + spec_inds_fixed.attrs['units'] = h5_spec_inds.attrs['units'] - spec_vals_fixed = h5_main.parent.create_dataset("spec_vals_fixed", + spec_vals_fixed = h5_raw.parent.create_dataset("spec_vals_fixed", shape=(1,h5_raw.shape[1]),dtype = 'uint32') - spec_vals_fixed.attrs['labels'] = spec_values.attrs['labels'] - spec_vals_fixed.attrs['units'] = spec_values.attrs['units'] + spec_vals_fixed.attrs['labels'] = h5_spec_vals.attrs['labels'] + spec_vals_fixed.attrs['units'] = h5_spec_vals.attrs['units'] spec_vals_fixed[:] = h5_spec_vals[0,:h5_raw.shape[1]] h5_raw.file.flush() h5_spec_inds = h5_chan['spec_inds_fixed']