Skip to content

Commit

Permalink
Handle specifically the case of HPLC like datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
kif committed Dec 5, 2024
1 parent e257206 commit b4e3024
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/freesas/app/extract_ascii.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
__author__ = "Jérôme Kieffer"
__license__ = "MIT"
__copyright__ = "2020, ESRF"
__date__ = "15/01/2021"
__date__ = "05/12/2024"

import io
import os
Expand Down Expand Up @@ -89,7 +89,10 @@ def extract_averaged(filename):
with Nexus(filename, "r") as nxsr:
entry_grp = nxsr.get_entries()[0]
results["h5path"] = entry_grp.name
nxdata_grp = nxsr.h5[entry_grp.attrs["default"]]
default = entry_grp.attrs["default"]
if posixpath.split(default)[-1] == "hplc":
default = posixpath.join(posixpath.split(default)[0],"result")
nxdata_grp = nxsr.h5[default]
signal = nxdata_grp.attrs["signal"]
axis = nxdata_grp.attrs["axes"]
results["I"] = nxdata_grp[signal][()]
Expand Down Expand Up @@ -119,9 +122,7 @@ def extract_averaged(filename):
results["exposure temperature"] = sample_grp["temperature"][()]
results["concentration"] = sample_grp["concentration"][()]
if "2_correlation_mapping" in entry_grp:
results["to_merge"] = entry_grp[
"2_correlation_mapping/results/to_merge"
][()]
results["to_merge"] = entry_grp["2_correlation_mapping/results/to_merge"][()]
return results


Expand Down

0 comments on commit b4e3024

Please sign in to comment.