first version with working entries
This commit is contained in:
@@ -24,7 +24,54 @@ class cSAXSNeXusFormat(DefaultFormat):
|
||||
See also: :class:`bec_server.file_writer.file_writer.HDF5Storage`.
|
||||
|
||||
"""
|
||||
entry = self.storage.create_group("entry")
|
||||
# ------------------------------------------------------------------
|
||||
# Create ptychography entry
|
||||
# ------------------------------------------------------------------
|
||||
entry_ptycho = entry.create_group("entry_ptycho")
|
||||
entry_ptycho.attrs["NX_class"] = "NXentry"
|
||||
entry_ptycho.attrs["definition"] = "NXptycho"
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# NXdata group
|
||||
# ------------------------------------------------------------------
|
||||
nxdata = entry_ptycho.create_group("data")
|
||||
nxdata.attrs["NX_class"] = "NXdata"
|
||||
nxdata.attrs["signal"] = "data"
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Link Eiger data (external)
|
||||
# ------------------------------------------------------------------
|
||||
data = entry.create_group("data")
|
||||
data.attrs["NX_class"] = "NXentry"
|
||||
# Either ext link!
|
||||
#data.create_ext_link("data", self.file_references["eiger_1_5"].file_path, "entry/data")
|
||||
# Or soft link to already linked path
|
||||
data_soft = entry.create_group("data_soft")
|
||||
data_soft.attrs["NX_class"] = "NXentry"
|
||||
for k in self.file_references["eiger_1_5"].hinted_h5_entries.keys():
|
||||
data_soft.create_soft_link(k, f"/entry/collection/file_references/eiger_1_5/{k}")
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Link positions (soft links)
|
||||
# ------------------------------------------------------------------
|
||||
positions_path = "/entry/collection/devices/rt_positions"
|
||||
|
||||
try:
|
||||
nxdata.create_soft_link("positions", positions_path)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Sample group
|
||||
# ------------------------------------------------------------------
|
||||
sample = entry_ptycho.create_group("sample")
|
||||
sample.attrs["NX_class"] = "NXsample"
|
||||
|
||||
try:
|
||||
sample.create_soft_link("positions", positions_path)
|
||||
except Exception:
|
||||
pass
|
||||
# entry = self.storage.create_group("entry")
|
||||
|
||||
# # /entry/control
|
||||
|
||||
Reference in New Issue
Block a user