feat: add initial file structure
This commit is contained in:
@@ -0,0 +1 @@
|
||||
from .debye_nexus_structure import DebyeNexusStructure
|
||||
26
debye_bec/file_writer/debye_nexus_structure.py
Normal file
26
debye_bec/file_writer/debye_nexus_structure.py
Normal 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"
|
||||
|
||||
Reference in New Issue
Block a user