Skip to content

Commit

Permalink
Labview patch fix for some corrupted BELINE
Browse files Browse the repository at this point in the history
  • Loading branch information
Rama Vasudevan committed Dec 20, 2023
1 parent 73cf6c5 commit bc91180
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions BGlib/be/translators/labview_h5_patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit bc91180

Please sign in to comment.