Skip to content
Snippets Groups Projects
Commit 17a12b81 authored by Gröne, Tjark Leon Raphael's avatar Gröne, Tjark Leon Raphael
Browse files

Update file maxwell_integrate_to_h5.py

parent 324d527a
Branches
No related tags found
No related merge requests found
......@@ -167,9 +167,9 @@ def integrate_ims_in_dir(path_im, path_int, dtype_im=".tif", dtype_int=".dat"):
meas.attrs["axes"] = "q"
meas.attrs["filename"] = result["filename"]
meas["I"] = h5py.SoftLink(f"/{subdir_name}/{entry_name}/instrument/detector/I")
meas["q"] = h5py.SoftLink(f"/{subdir_name}/{entry_name}/instrument/detector/q")
meas["dI"] = h5py.SoftLink(f"/{subdir_name}/{entry_name}/instrument/detector/dI")
meas["I"] = h5py.SoftLink(f"/{entry_name}/instrument/detector/I")
meas["q"] = h5py.SoftLink(f"/{entry_name}/instrument/detector/q")
meas["dI"] = h5py.SoftLink(f"/{entry_name}/instrument/detector/dI")
# Optional display-friendly names
meas["I"].attrs["long_name"] = "Intensity"
......@@ -181,8 +181,8 @@ def integrate_ims_in_dir(path_im, path_int, dtype_im=".tif", dtype_int=".dat"):
plotselect.attrs["signal"] = "I"
plotselect.attrs["axes"] = "q"
plotselect["I"] = h5py.SoftLink(f"/{subdir_name}/{entry_name}/instrument/detector/I")
plotselect["q"] = h5py.SoftLink(f"/{subdir_name}/{entry_name}/instrument/detector/q")
plotselect["I"] = h5py.SoftLink(f"/{entry_name}/instrument/detector/I")
plotselect["q"] = h5py.SoftLink(f"/{entry_name}/instrument/detector/q")
# Optional display-friendly names
plotselect["I"].attrs["long_name"] = "Intensity"
......@@ -256,8 +256,6 @@ def integrate_ims_in_dir(path_im, path_int, dtype_im=".tif", dtype_int=".dat"):
# plot["dI"].attrs["long_name"] = np.string_("Uncertainty in I")
h5.flush()
h5.close()
print(f"✅ HDF5 file '{output_file}' created with {len(results_data)} spectra.")
# # Sort results_data by filename
# def natural_sort_key(item):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment