Compare commits

..

2 Commits

Author SHA256 Message Date
b4d7373933 starts working on nexus file creation 2026-02-13 16:23:42 +01:00
2f4985c443 adds h5py to requirements 2026-02-13 16:23:24 +01:00
2 changed files with 17 additions and 1 deletions

View File

@@ -1,2 +1,3 @@
requests requests
asyncio asyncio
h5py

View File

@@ -1,4 +1,4 @@
import os, json, requests import os, json, requests, h5py
from getpass import getpass from getpass import getpass
from APIHandler import APIHandler from APIHandler import APIHandler
from classes import * from classes import *
@@ -200,6 +200,21 @@ def make_nexus_schema_dictionary(substrate_object, layers):
} }
return pld_fabrication 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__": if __name__=="__main__":
# TO-DO: place the API base URL somewhere else. # TO-DO: place the API base URL somewhere else.
ELABFTW_API_URL = "https://elabftw.fisica.unina.it/api/v2" ELABFTW_API_URL = "https://elabftw.fisica.unina.it/api/v2"