Skip to content

Commit

Permalink
Refs #629 HidraProjectFile can read units from the project file
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Borreguero <[email protected]>
  • Loading branch information
jmborr committed Sep 7, 2020
1 parent 99224ee commit df67c33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyrs/projectfile/file_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,11 @@ def read_sample_logs(self):
# first set subruns
samplelogs[HidraConstants.SUB_RUNS] = logs_group[HidraConstants.SUB_RUNS].value
for log_name in logs_group.keys():
samplelogs[log_name] = logs_group[log_name].value
data_set = logs_group[log_name] # an instance of HDF5::DataSet
try:
samplelogs[log_name, data_set.attrs['units']] = data_set.value
except KeyError: # this log entry has no units. True for old project files
samplelogs[log_name] = data_set.value

return samplelogs

Expand Down
Binary file added tests/data/HB2B_938_v2.h5
Binary file not shown.

0 comments on commit df67c33

Please sign in to comment.