From b4d7373933280095d9ea623f66c2a1f7764632d93a7d9cd60810772b68ba0812 Mon Sep 17 00:00:00 2001 From: PioApocalypse Date: Fri, 13 Feb 2026 16:23:42 +0100 Subject: [PATCH] starts working on nexus file creation --- src/main.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index b830c24..4992377 100644 --- a/src/main.py +++ b/src/main.py @@ -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"