adds mod. suggested by ClaudeAI - still doesn't work

original code is commented below, rows 517-545
This commit is contained in:
2026-03-18 15:15:31 +01:00
parent 839799a13f
commit 5cf67648af

View File

@@ -514,17 +514,35 @@ def build_nexus_file(pld_fabrication, output_path, rheed_osc=None):
nx_rheed = nx_pld_entry.create_group("rheed_data") nx_rheed = nx_pld_entry.create_group("rheed_data")
nx_rheed.attrs["NX_class"] = "NXdata" nx_rheed.attrs["NX_class"] = "NXdata"
nx_rheed.create_dataset("time", data=rheed_osc["time"]) # Asse temporale
nx_rheed["time"].attrs["units"] = "s" t_ds = nx_rheed.create_dataset("time", data=rheed_osc["time"])
t_ds.attrs["units"] = "s"
t_ds.attrs["long_name"] = "Time"
nx_rheed.create_dataset("intensity", data=rheed_osc["intensity"]) # Intensità: shape (n_layers, n_timepoints, 3)
#nx_rheed["intensity"].attrs["units"] = "counts" i_ds = nx_rheed.create_dataset("intensity", data=rheed_osc["intensity"])
nx_rheed["intensity"].attrs["long_name"] = "RHEED intensity" i_ds.attrs["units"] = "a.u."
i_ds.attrs["long_name"] = "RHEED Intensity"
# Attributi NXdata — notazione NeXus 3.x corretta
nx_rheed.attrs["signal"] = "intensity" nx_rheed.attrs["signal"] = "intensity"
nx_rheed.attrs["axes"] = "layer:time:channel" nx_rheed.attrs["axes"] = [".", "time", "."] # solo l'asse 1 (time) è denominato
nx_rheed.attrs["layer_indices"] = [0] # asse layer nx_rheed.attrs["time_indices"] = np.array([1], dtype=np.int32)
nx_rheed.attrs["time_indices"] = [1] # asse tempo # ###########
nx_rheed.attrs["channel_indices"] = [2] # nx_rheed = nx_pld_entry.create_group("rheed_data")
# nx_rheed.attrs["NX_class"] = "NXdata"
# nx_rheed.create_dataset("time", data=rheed_osc["time"])
# nx_rheed["time"].attrs["units"] = "s"
# nx_rheed.create_dataset("intensity", data=rheed_osc["intensity"])
# #nx_rheed["intensity"].attrs["units"] = "counts"
# nx_rheed["intensity"].attrs["long_name"] = "RHEED intensity"
# nx_rheed.attrs["signal"] = "intensity"
# nx_rheed.attrs["axes"] = "layer:time:channel"
# nx_rheed.attrs["layer_indices"] = [0] # asse layer
# nx_rheed.attrs["time_indices"] = [1] # asse tempo
# nx_rheed.attrs["channel_indices"] = [2]
return return
if __name__=="__main__": if __name__=="__main__":