feat: add initial file structure

This commit is contained in:
gac-x01da
2025-05-27 11:42:52 +02:00
committed by appel_c
parent 27ff5697af
commit a9fd62d249
2 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1 @@
from .debye_nexus_structure import DebyeNexusStructure

View File

@@ -0,0 +1,26 @@
from bec_server.file_writer.default_writer import DefaultFormat
class DebyeNexusStructure(DefaultFormat):
""" Nexus Structure for Debye"""
def format(self) -> None:
""" Specify the file format for the file writer."""
entry = self.storage.create_group(name="entry")
entry.attrs["NX_class"] = "NXentry"
instrument = entry.create_group(name="instrument")
instrument.attrs["NX_class"] = "NXinstrument"
monochromator = instrument.create_group(name="monochromator")
# monochromator.attrs["NX_class"] = "NXmonochromator" -> to be checked
crystal = monochromator.create_group(name="crystal")
###################
## mo1_bragg specific information
###################
# Logic if device exist
if "mo_trx" in self.device_manager.devices:
# Create a softlink
chemical_formular = crystal.create_soft_link(name="chemical_formular", target="/entry/collection/devices/mo_trx/mo_trx")
chemical_formular.attrs["NX_class"] = "NXdata"