[BUG] Can not read HDF file anymore #311

Open
opened 2025-06-11 07:46:26 +00:00 by jepsinrajkp · 2 comments
Member

Current behavior

Can not open HDF file anymore.

dw = float(index['dwelltime'])

Version

2025-06-03

Expected behavior

File loading should work

Steps to reproduce

  1. load file
  2. error in log

Log messages

Traceback (most recent call last):
  File "/tmp/.mount_NMRevaWf1xbU/usr/src/gui_qt/io/hdfreader.py", line 116, in accept
    self.get_selected()
  File "/tmp/.mount_NMRevaWf1xbU/usr/src/gui_qt/io/hdfreader.py", line 111, in get_selected
    selected.extend(self._reader.get_selected(path, value=value, group=group))
  File "/tmp/.mount_NMRevaWf1xbU/usr/src/nmreval/io/hdfreader.py", line 286, in get_selected
    ret_val.append(self.make_signal(child, flag=flag, value=value, group=group))
  File "/tmp/.mount_NMRevaWf1xbU/usr/src/nmreval/io/hdfreader.py", line 354, in make_signal
    dw = float(index['dwelltime'])
TypeError: only size-1 arrays can be converted to Python scalars

Anything else?

No response

### Current behavior Can not open HDF file anymore. https://gitea.pkm.physik.tu-darmstadt.de/IPKM/nmreval/src/commit/5975c08fb2ec326b12c3144a9facbed2e4e7fe3f/src/nmreval/io/hdfreader.py#L354 ### Version 2025-06-03 ### Expected behavior File loading should work ### Steps to reproduce 1. load file 2. error in log ### Log messages ```shell Traceback (most recent call last): File "/tmp/.mount_NMRevaWf1xbU/usr/src/gui_qt/io/hdfreader.py", line 116, in accept self.get_selected() File "/tmp/.mount_NMRevaWf1xbU/usr/src/gui_qt/io/hdfreader.py", line 111, in get_selected selected.extend(self._reader.get_selected(path, value=value, group=group)) File "/tmp/.mount_NMRevaWf1xbU/usr/src/nmreval/io/hdfreader.py", line 286, in get_selected ret_val.append(self.make_signal(child, flag=flag, value=value, group=group)) File "/tmp/.mount_NMRevaWf1xbU/usr/src/nmreval/io/hdfreader.py", line 354, in make_signal dw = float(index['dwelltime']) TypeError: only size-1 arrays can be converted to Python scalars ``` ### Anything else? _No response_
jepsinrajkp added the
Kind/Bug
label 2025-06-11 07:46:26 +00:00
dominik was assigned by jepsinrajkp 2025-06-11 07:46:27 +00:00
Author
Member

Actually the problem is in the HDF file.
There are 2 record statements in the experiment script, thus the indices array has two dwell time entries:

5e-07	32768	8	0	0.0
5e-07	32768	8	32768	0.016384
Actually the problem is in the HDF file. There are 2 record statements in the experiment script, thus the indices array has two dwell time entries: ``` 5e-07 32768 8 0 0.0 5e-07 32768 8 32768 0.016384 ```
Member

A weird problem of the h5 file but I will also have a look if the program can catch this.

A weird problem of the h5 file but I will also have a look if the program can catch this.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: IPKM/nmreval#311
No description provided.