starts working on nexus file creation

This commit is contained in:
2026-02-13 16:23:42 +01:00
parent 2f4985c443
commit b4d7373933

View File

@@ -1,4 +1,4 @@
import os, json, requests
import os, json, requests, h5py
from getpass import getpass
from APIHandler import APIHandler
from classes import *
@@ -200,6 +200,21 @@ def make_nexus_schema_dictionary(substrate_object, layers):
}
return pld_fabrication
def build_nexus_file(pld_fabrication, output_path):
# NOTE: look at the mail attachment from Emiliano...
with h5py.File(output_path, "w") as f:
nx_pld_entry = f.create_group("pld_fabrication")
nx_pld_entry.attrs["NX_class"] = "NXentry"
# Sample section
nx_sample = nx_pld_entry.create_group("sample")
nx_sample.attrs["NX_class"] = "NXsample"
# Substrate section
nx_substrate = nx_pld_entry.create_group("substrate")
nx_substrate.attrs["NX_class"] = "NXsubentry"
pass
if __name__=="__main__":
# TO-DO: place the API base URL somewhere else.
ELABFTW_API_URL = "https://elabftw.fisica.unina.it/api/v2"