From 2ae1cb2d410bc28f0f4fc499d72597b5d5b36a75 Mon Sep 17 00:00:00 2001 From: mkuehbach Date: Thu, 14 Dec 2023 17:42:44 +0100 Subject: [PATCH] Added prioritization level 1 and 2 quantities for all five imaging modes of the IKZ Apreo, tested generation of NeXus files for all five test images from Robert Kernke successfully, next step continue with eds --- dev-requirements.txt | 4 + image_tiff_tfs_to_nexus.ods | Bin 17720 -> 11631 bytes imgs.batch.sh | 4 +- pynxtools/dataconverter/readers/em/reader.py | 2 +- .../readers/em/subparsers/image_tiff_tfs.py | 34 +- .../em/subparsers/image_tiff_tfs_cfg.py | 416 ++---------------- .../em/subparsers/image_tiff_tfs_concepts.py | 301 +++++++++++++ .../em/subparsers/image_tiff_tfs_modifier.py | 40 +- pyproject.toml | 1 + 9 files changed, 377 insertions(+), 425 deletions(-) create mode 100644 pynxtools/dataconverter/readers/em/subparsers/image_tiff_tfs_concepts.py diff --git a/dev-requirements.txt b/dev-requirements.txt index d8ad60a09..9941ac2a7 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -65,6 +65,8 @@ decorator==5.1.1 # via # ipyparallel # ipython +defusedxml==0.7.1 + # via odfpy diffpy-structure==3.1.0 # via # diffsims @@ -298,6 +300,8 @@ numpy==1.24.4 # zarr numpy-quaternion==2022.4.3 # via orix +odfpy==1.4.1 + # via pynxtools (pyproject.toml) orix==0.11.1 # via # diffsims diff --git a/image_tiff_tfs_to_nexus.ods b/image_tiff_tfs_to_nexus.ods index f3fc491b4a8bac27c6a828b0b0de8a3732fc185e..835a84832dfbee901a3cb0fa4ea443627121a8f2 100644 GIT binary patch delta 8872 zcmb`tWmH{D(;$3;yE_DTw}ZO{f@^Sh4Z(He53 z`@J)3&CFWUKX!N3uC84z)z!PI8s5J+)kjxTgoVQcfsjBT-H`Ysbajm9>dos6q?Kt{ z5NH}U$&nLy0eUX(NHEXO?I}ME5C}F?K}J%`JM(yP-Fbl%4?!)_`_x`_M93M;^AJ5s`xdV!@KP;^X65i$PV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ivQYZmTgp zXvJbLja;Odx~VZngWMQ!kT_}9Y6EV)DwO1Hao9ofLsK6^W&W>0+*7mtpQDb6JT%-Se}dG1r*tCxcf
  • NKB-+qZ{<|NN zVB$wgg2Wm+sDH3eB&EX#6BkSrr2Chu{|LwweCLLh*hh=@7pVU|W`h5I0GSm`?4%(1 yKVm!H86pZLF4NJF|AQUU?=csOcMK#TKtM46hl8w8Vm1|aq80-R)HmTjE&mUb)k=5( diff --git a/imgs.batch.sh b/imgs.batch.sh index c18aa0a23..ae80412cf 100755 --- a/imgs.batch.sh +++ b/imgs.batch.sh @@ -1,6 +1,6 @@ #!/bin/bash -datasource="../../../../paper_paper_paper/scidat_nomad_ebsd/bb_analysis/data/development_imgs/" +datasource="../../../../paper_paper_paper/scidat_nomad_ebsd/bb_analysis/data/development_imgs/ikz_robert/" # comments is detector mode examples="kit/FeMoOx_AntiA_04_1k5x_CN.tif" @@ -10,6 +10,8 @@ examples="ikz_robert/T3_image.tif" examples="ikz_robert/ETD_image.tif" # ETD examples="ikz_martin/NavCam_normal_vis_light_ccd.tif" # NavCam +examples="0c8nA_3deg_003_AplusB_test.tif ALN_baoh_021.tif T3_image.tif ETD_image.tif NavCam_normal_vis_light_ccd.tif" + for example in $examples; do echo $example diff --git a/pynxtools/dataconverter/readers/em/reader.py b/pynxtools/dataconverter/readers/em/reader.py index 8108cbcb7..971579de4 100644 --- a/pynxtools/dataconverter/readers/em/reader.py +++ b/pynxtools/dataconverter/readers/em/reader.py @@ -22,7 +22,7 @@ from typing import Tuple, Any from pynxtools.dataconverter.readers.base.reader import BaseReader -from pynxtools.pynxtools.dataconverter.readers.em.concepts.nxs_concepts import NxEmAppDef +from pynxtools.dataconverter.readers.em.concepts.nxs_concepts import NxEmAppDef # from pynxtools.dataconverter.readers.em.subparsers.nxs_mtex import NxEmNxsMTexSubParser # from pynxtools.dataconverter.readers.em.subparsers.nxs_pyxem import NxEmNxsPyxemSubParser from pynxtools.dataconverter.readers.em.subparsers.nxs_imgs import NxEmImagesSubParser diff --git a/pynxtools/dataconverter/readers/em/subparsers/image_tiff_tfs.py b/pynxtools/dataconverter/readers/em/subparsers/image_tiff_tfs.py index bc9acd948..09c33f997 100644 --- a/pynxtools/dataconverter/readers/em/subparsers/image_tiff_tfs.py +++ b/pynxtools/dataconverter/readers/em/subparsers/image_tiff_tfs.py @@ -24,8 +24,10 @@ from PIL.TiffTags import TAGS from pynxtools.dataconverter.readers.em.subparsers.image_tiff import TiffSubParser +from pynxtools.dataconverter.readers.em.subparsers.image_tiff_tfs_concepts import \ + get_fei_parent_concepts, get_fei_childs from pynxtools.dataconverter.readers.em.subparsers.image_tiff_tfs_cfg import \ - TiffTfsConcepts, TiffTfsToNeXusCfg, get_fei_parent_concepts, get_fei_childs + TIFF_TFS_TO_NEXUS_CFG from pynxtools.dataconverter.readers.em.utils.image_utils import \ sort_ascendingly_by_second_argument, if_str_represents_float from pynxtools.dataconverter.readers.shared.map_concepts.mapping_functors \ @@ -88,7 +90,7 @@ def get_metadata(self): if pos != -1: tfs_parent_concepts_byte_offset[concept] = pos else: - raise ValueError(f"Expected block with metadata for concept [{concept}] were not found !") + print(f"Instance of concept [{concept}] was not found !") print(tfs_parent_concepts_byte_offset) sequence = [] # decide I/O order in which metadata for childs of parent concepts will be read @@ -140,6 +142,8 @@ def parse_and_normalize(self): if self.supported is True: print(f"Parsing via ThermoFisher-specific metadata...") self.get_metadata() + # for key in self.tmp["meta"].keys(): + # print(f"{key}") else: print(f"{self.file_path} is not a ThermoFisher-specific " f"TIFF file that this parser can process !") @@ -185,11 +189,14 @@ def process_event_data_em_data(self, template: dict) -> dict: # 0 is y while 1 is x for 2d, 0 is z, 1 is y, while 2 is x for 3d template[f"{trg}/intensity/@long_name"] = f"Signal" - sxy = {"x": self.tmp["meta"]["EScan/PixelWidth"], - "y": self.tmp["meta"]["EScan/PixelHeight"]} - shp = np.shape(np.array(fp)) - nxy = {"x": shp[1], "y": shp[0]} + sxy = {"x": 1., "y": 1.} scan_unit = {"x": "m", "y": "m"} # assuming FEI reports SI units + # we may face the CCD overview camera for the chamber for which there might not be a calibration! + if ("EScan/PixelWidth" in self.tmp["meta"].keys()) and ("EScan/PixelHeight" in self.tmp["meta"].keys()): + sxy = {"x": self.tmp["meta"]["EScan/PixelWidth"], + "y": self.tmp["meta"]["EScan/PixelHeight"]} + scan_unit = {"x": "px", "y": "px"} + nxy = {"x": np.shape(np.array(fp))[1], "y": np.shape(np.array(fp))[0]} # TODO::be careful we assume here a very specific coordinate system # however the TIFF file gives no clue, TIFF just documents in which order # it arranges a bunch of pixels that have stream in into a n-d tiling @@ -219,9 +226,14 @@ def process_event_data_em_metadata(self, template: dict) -> dict: # contextualization to understand how the image relates to the EM session print(f"Mapping some of the TFS/FEI metadata concepts onto NeXus concepts") identifier = [self.entry_id, self.event_id, 1] - for nx_path, modifier in TiffTfsToNeXusCfg.items(): - if (nx_path != "IGNORE") and (nx_path != "UNCLEAR"): - trg = variadic_path_to_specific_path(nx_path, identifier) - template[trg] = get_nexus_value(modifier, self.tmp["meta"]) - # print(f"nx_path: {nx_path}, trg: {trg}, tfs_concept: {template[trg]}\n") + for tpl in TIFF_TFS_TO_NEXUS_CFG: + if isinstance(tpl, tuple): + trg = variadic_path_to_specific_path(tpl[0], identifier) + if len(tpl) == 2: + template[trg] = tpl[1] + if len(tpl) == 3: + # nxpath, modifier, value to load from and eventually to be modified + retval = get_nexus_value(tpl[1], tpl[2], self.tmp["meta"]) + if retval is not None: + template[trg] = retval return template diff --git a/pynxtools/dataconverter/readers/em/subparsers/image_tiff_tfs_cfg.py b/pynxtools/dataconverter/readers/em/subparsers/image_tiff_tfs_cfg.py index 2ff14e344..68c4d5352 100644 --- a/pynxtools/dataconverter/readers/em/subparsers/image_tiff_tfs_cfg.py +++ b/pynxtools/dataconverter/readers/em/subparsers/image_tiff_tfs_cfg.py @@ -17,397 +17,35 @@ # """Configuration of the image_tiff_tfs subparser.""" -from typing import List - - -TiffTfsConcepts = ["User/Date", - "User/Time", - "User/User", - "User/UserText", - "User/UserTextUnicode", - "System/Type", - "System/Dnumber", - "System/Software", - "System/BuildNr", - "System/Source", - "System/Column", - "System/FinalLens", - "System/Chamber", - "System/Stage", - "System/Pump", - "System/ESEM", - "System/Aperture", - "System/Scan", - "System/Acq", - "System/EucWD", - "System/SystemType", - "System/DisplayWidth", - "System/DisplayHeight", - "Beam/HV", - "Beam/Spot", - "Beam/StigmatorX", - "Beam/StigmatorY", - "Beam/BeamShiftX", - "Beam/BeamShiftY", - "Beam/ScanRotation", - "Beam/ImageMode", - "Beam/FineStageBias", - "Beam/Beam", - "Beam/Scan", - "EBeam/Source", - "EBeam/ColumnType", - "EBeam/FinalLens", - "EBeam/Acq", - "EBeam/Aperture", - "EBeam/ApertureDiameter", - "EBeam/HV", - "EBeam/HFW", - "EBeam/VFW", - "EBeam/WD", - "EBeam/BeamCurrent", - "EBeam/TiltCorrectionIsOn", - "EBeam/DynamicFocusIsOn", - "EBeam/DynamicWDIsOn", - "EBeam/ScanRotation", - "EBeam/LensMode", - "EBeam/LensModeA", - "EBeam/ATubeVoltage", - "EBeam/UseCase", - "EBeam/SemOpticalMode", - "EBeam/ImageMode", - "EBeam/SourceTiltX", - "EBeam/SourceTiltY", - "EBeam/StageX", - "EBeam/StageY", - "EBeam/StageZ", - "EBeam/StageR", - "EBeam/StageTa", - "EBeam/StageTb", - "EBeam/StigmatorX", - "EBeam/StigmatorY", - "EBeam/BeamShiftX", - "EBeam/BeamShiftY", - "EBeam/EucWD", - "EBeam/EmissionCurrent", - "EBeam/TiltCorrectionAngle", - "EBeam/PreTilt", - "EBeam/WehneltBias", - "EBeam/BeamMode", - "EBeam/MagnificationCorrection", - "GIS/Number", - "Scan/InternalScan", - "Scan/Dwelltime", - "Scan/PixelWidth", - "Scan/PixelHeight", - "Scan/HorFieldsize", - "Scan/VerFieldsize", - "Scan/Average", - "Scan/Integrate", - "Scan/FrameTime", - "EScan/Scan", - "EScan/InternalScan", - "EScan/Dwell", - "EScan/PixelWidth", - "EScan/PixelHeight", - "EScan/HorFieldsize", - "EScan/VerFieldsize", - "EScan/FrameTime", - "EScan/LineTime", - "EScan/Mainslock", - "EScan/LineIntegration", - "EScan/ScanInterlacing", - "Stage/StageX", - "Stage/StageY", - "Stage/StageZ", - "Stage/StageR", - "Stage/StageT", - "Stage/StageTb", - "Stage/SpecTilt", - "Stage/WorkingDistance", - "Stage/ActiveStage", - "Image/DigitalContrast", - "Image/DigitalBrightness", - "Image/DigitalGamma", - "Image/Average", - "Image/Integrate", - "Image/ResolutionX", - "Image/ResolutionY", - "Image/DriftCorrected", - "Image/ZoomFactor", - "Image/ZoomPanX", - "Image/ZoomPanY", - "Image/MagCanvasRealWidth", - "Image/MagnificationMode", - "Image/ScreenMagCanvasRealWidth", - "Image/ScreenMagnificationMode", - "Image/PostProcessing", - "Image/Transformation", - "Vacuum/ChPressure", - "Vacuum/Gas", - "Vacuum/UserMode", - "Vacuum/Humidity", - "Specimen/Temperature", - "Specimen/SpecimenCurrent", - "Detectors/Number", - "Detectors/Name", - "Detectors/Mode", - "T2/Contrast", - "T2/Brightness", - "T2/Signal", - "T2/ContrastDB", - "T2/BrightnessDB", - "T2/Setting", - "T2/MinimumDwellTime", - "Accessories/Number", - "EBeamDeceleration/ModeOn", - "EBeamDeceleration/LandingEnergy", - "EBeamDeceleration/ImmersionRatio", - "EBeamDeceleration/StageBias", - "CompoundLensFilter/IsOn", - "CompoundLensFilter/ThresholdEnergy", - "PrivateFei/BitShift", - "PrivateFei/DataBarSelected", - "PrivateFei/DataBarAvailable", - "PrivateFei/TimeOfCreation", - "PrivateFei/DatabarHeight", - "HiResIllumination/BrightFieldIsOn", - "HiResIllumination/BrightFieldValue", - "HiResIllumination/DarkFieldIsOn", - "HiResIllumination/DarkFieldValue", - "EasyLift/Rotation", - "HotStageMEMS/HeatingCurrent", - "HotStageMEMS/HeatingVoltage", - "HotStageMEMS/TargetTemperature", - "HotStageMEMS/ActualTemperature", - "HotStageMEMS/HeatingPower", - "HotStageMEMS/SampleBias", - "HotStageMEMS/SampleResistance", - "HotStage/TargetTemperature", - "HotStage/ActualTemperature", - "HotStage/SampleBias", - "HotStage/ShieldBias", - "HotStageHVHS/TargetTemperature", - "HotStageHVHS/ActualTemperature", - "HotStageHVHS/SampleBias", - "HotStageHVHS/ShieldBias", - "ColdStage/TargetTemperature", - "ColdStage/ActualTemperature", - "ColdStage/Humidity", - "ColdStage/SampleBias"] - -# there is more to know and understand than just knowing TFS/FEI uses -# the above-mentioned concepts in their taxonomy: -# take the example of System/Source for which an example file (instance) has the -# value "FEG" -# similar like in NeXus "System/Source" labels a concept for which (assumption!) there -# is a controlled enumeration of symbols possible (as the example shows "FEG" is one such -# allowed symbol of the enumeration. -# The key issue is that the symbols for the leaf (here "FEG") means nothing eventually -# when one has another semantic world-view, like in NOMAD metainfo or NeXus -# (only us) humans understand that what TFS/FEI likely means with the symbol -# "FEG" is exactly the same as what we mean in NeXus when setting emitter_type of -# NXebeam_column to "cold_cathode_field_emitter" -# world with the controlled enumeration value "other" because we do not know -# if FEG means really a filament or a cold_cathode_field_emitter TfsToNexusConceptMapping = {"System/Source/FEG": "cold_field_cathode_emitter"} -def get_fei_parent_concepts() -> List: - """Get list of unique FEI parent concepts.""" - parent_concepts = set() - for entry in TiffTfsConcepts: - if isinstance(entry, str) and entry.count("/") == 1: - parent_concepts.add(entry.split("/")[0]) - return list(parent_concepts) - - -def get_fei_childs(concept: str) -> List: - """Get all children of FEI parent concept.""" - child_concepts = set() - for entry in TiffTfsConcepts: - if isinstance(entry, str) and entry.count("/") == 1: - if entry.startswith(f"{concept}/") is True: - child_concepts.add(entry.split("/")[1]) - return list(child_concepts) - - # "/ENTRY[entry*]/measurement/EVENT_DATA_EM_SET[event_data_em_set]/EVENT_DATA_EM[event_data_em*]/start_time" -TiffTfsToNeXusCfg = {"IGNORE": {"fun": "ikz_berlin_apreo_iso8601", "terms": ["User/Date", "User/Time"]}, - "IGNORE": {"fun": "load_from", "terms": "User/User"}, - "IGNORE": {"fun": "load_from", "terms": "User/UserText"}, - "IGNORE": {"fun": "load_from", "terms": "User/UserTextUnicode"}, - "IGNORE": {"fun": "load_from", "terms": "System/Type"}, - "IGNORE": {"fun": "load_from", "terms": "System/Dnumber"}, - "IGNORE": {"fun": "load_from", "terms": "System/Software"}, - "/ENTRY[entry*]/measurement/em_lab/FABRICATION[fabrication]/identifier": {"fun": "load_from", "terms": "System/BuildNr"}, - "/ENTRY[entry*]/measurement/em_lab/EBEAM_COLUMN[ebeam_column]/electron_source/emitter_type": {"fun": "tfs_to_nexus", "terms": "System/Source"}, - "/ENTRY[entry*]/measurement/em_lab/FABRICATION[fabrication]/vendor": "FEI", - "IGNORE": {"fun": "load_from", "terms": "System/FinalLens"}, - "IGNORE": {"fun": "load_from", "terms": "System/Chamber"}, - "IGNORE": {"fun": "load_from", "terms": "System/Stage"}, - "IGNORE": {"fun": "load_from", "terms": "System/Pump"}, - "IGNORE": {"fun": "load_from", "terms": "System/ESEM"}, - "IGNORE": {"fun": "load_from", "terms": "System/Aperture"}, - "IGNORE": {"fun": "load_from", "terms": "System/Scan"}, - "IGNORE": {"fun": "load_from", "terms": "System/Acq"}, - "IGNORE": {"fun": "load_from", "terms": "System/EucWD"}, - "/ENTRY[entry*]/measurement/em_lab/FABRICATION[fabrication]/model": {"fun": "load_from", "terms": "System/SystemType"}, - "IGNORE": {"fun": "load_from", "terms": "System/DisplayWidth"}, - "IGNORE": {"fun": "load_from", "terms": "System/DisplayHeight"}, - "IGNORE": {"fun": "load_from", "terms": "Beam/HV"}, - "IGNORE": {"fun": "load_from", "terms": "Beam/Spot"}, - "IGNORE": {"fun": "load_from", "terms": "Beam/StigmatorX"}, - "IGNORE": {"fun": "load_from", "terms": "Beam/StigmatorY"}, - "IGNORE": {"fun": "load_from", "terms": "Beam/BeamShiftX"}, - "IGNORE": {"fun": "load_from", "terms": "Beam/BeamShiftY"}, - "IGNORE": {"fun": "load_from", "terms": "Beam/ScanRotation"}, - "IGNORE": {"fun": "load_from", "terms": "Beam/ImageMode"}, - "IGNORE": {"fun": "load_from", "terms": "Beam/FineStageBias"}, - "IGNORE": {"fun": "load_from", "terms": "Beam/Beam"}, - "IGNORE": {"fun": "load_from", "terms": "Beam/Scan"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/Source"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/ColumnType"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/FinalLens"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/Acq"}, - "/ENTRY[entry*]/measurement/em_lab/EBEAM_COLUMN[ebeam_column]/APERTURE_EM[aperture_em*]/description": {"fun": "load_from", "terms": "EBeam/Aperture"}, - "/ENTRY[entry*]/measurement/em_lab/EBEAM_COLUMN[ebeam_column]/APERTURE_EM[aperture_em*]/value": {"fun": "load_from", "terms": "EBeam/ApertureDiameter"}, - "/ENTRY[entry*]/measurement/em_lab/EBEAM_COLUMN[ebeam_column]/APERTURE_EM[aperture_em*]/value/@units": "m", - "/ENTRY[entry*]/measurement/em_lab/EBEAM_COLUMN[ebeam_column]/electron_source/voltage": {"fun": "load_from", "terms": "EBeam/HV"}, - "/ENTRY[entry*]/measurement/em_lab/EBEAM_COLUMN[ebeam_column]/electron_source/voltage/@units": "V", - "IGNORE": {"fun": "load_from", "terms": "EBeam/HFW"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/VFW"}, - "/ENTRY[entry*]/measurement/em_lab/OPTICAL_SYSTEM_EM[optical_system_em]/working_distance": {"fun": "load_from", "terms": "EBeam/WD"}, - "/ENTRY[entry*]/measurement/em_lab/OPTICAL_SYSTEM_EM[optical_system_em]/working_distance/@units": "m", - "/ENTRY[entry*]/measurement/em_lab/OPTICAL_SYSTEM_EM[optical_system_em]/beam_current": {"fun": "load_from", "terms": "EBeam/WD"}, - "/ENTRY[entry*]/measurement/em_lab/OPTICAL_SYSTEM_EM[optical_system_em]/beam_current/@units": "A", - "IGNORE": {"fun": "load_from", "terms": "EBeam/TiltCorrectionIsOn"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/DynamicFocusIsOn"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/DynamicWDIsOn"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/ScanRotation"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/LensMode"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/LensModeA"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/ATubeVoltage"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/UseCase"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/SemOpticalMode"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/ImageMode"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/SourceTiltX"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/SourceTiltY"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/StageX"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/StageY"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/StageZ"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/StageR"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/StageTa"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/StageTb"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/StigmatorX"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/StigmatorY"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/BeamShiftX"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/BeamShiftY"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/EucWD"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/EmissionCurrent"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/TiltCorrectionAngle"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/PreTilt"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/WehneltBias"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/BeamMode"}, - "IGNORE": {"fun": "load_from", "terms": "EBeam/MagnificationCorrection"}, - "IGNORE": {"fun": "load_from", "terms": "GIS/Number"}, - "IGNORE": {"fun": "load_from", "terms": "Scan/InternalScan"}, - "IGNORE": {"fun": "load_from", "terms": "Scan/Dwelltime"}, - "IGNORE": {"fun": "load_from", "terms": "Scan/PixelWidth"}, - "IGNORE": {"fun": "load_from", "terms": "Scan/PixelHeight"}, - "IGNORE": {"fun": "load_from", "terms": "Scan/HorFieldsize"}, - "IGNORE": {"fun": "load_from", "terms": "Scan/VerFieldsize"}, - "IGNORE": {"fun": "load_from", "terms": "Scan/Average"}, - "IGNORE": {"fun": "load_from", "terms": "Scan/Integrate"}, - "IGNORE": {"fun": "load_from", "terms": "Scan/FrameTime"}, - "IGNORE": {"fun": "load_from", "terms": "EScan/Scan"}, - "IGNORE": {"fun": "load_from", "terms": "EScan/InternalScan"}, - "IGNORE": {"fun": "load_from", "terms": "EScan/Dwell"}, - "IGNORE": {"fun": "load_from", "terms": "EScan/PixelWidth"}, - "IGNORE": {"fun": "load_from", "terms": "EScan/PixelHeight"}, - "IGNORE": {"fun": "load_from", "terms": "EScan/HorFieldsize"}, - "IGNORE": {"fun": "load_from", "terms": "EScan/VerFieldsize"}, - "IGNORE": {"fun": "load_from", "terms": "EScan/FrameTime"}, - "IGNORE": {"fun": "load_from", "terms": "EScan/LineTime"}, - "IGNORE": {"fun": "load_from", "terms": "EScan/Mainslock"}, - "IGNORE": {"fun": "load_from", "terms": "EScan/LineIntegration"}, - "IGNORE": {"fun": "load_from", "terms": "EScan/ScanInterlacing"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/StageX"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/StageY"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/StageZ"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/StageR"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/StageT"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/StageTb"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/SpecTilt"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/WorkingDistance"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/ActiveStage"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/[Image]"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/DigitalContrast"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/DigitalBrightness"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/DigitalGamma"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/Average"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/Integrate"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/ResolutionX"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/ResolutionY"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/DriftCorrected"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/ZoomFactor"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/ZoomPanX"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/ZoomPanY"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/MagCanvasRealWidth"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/MagnificationMode"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/ScreenMagCanvasRealWidth"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/ScreenMagnificationMode"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/PostProcessing"}, - "IGNORE": {"fun": "load_from", "terms": "StageX/Transformation"}, - "IGNORE": {"fun": "load_from", "terms": "Vacuum/ChPressure"}, - "IGNORE": {"fun": "load_from", "terms": "Vacuum/Gas"}, - "IGNORE": {"fun": "load_from", "terms": "Vacuum/UserMode"}, - "IGNORE": {"fun": "load_from", "terms": "Vacuum/Humidity"}, - "IGNORE": {"fun": "load_from", "terms": "Specimen/Temperature"}, - "IGNORE": {"fun": "load_from", "terms": "Specimen/SpecimenCurrent"}, - "IGNORE": {"fun": "load_from", "terms": "Detectors/Number"}, - "/ENTRY[entry*]/measurement/em_lab/DETECTOR[detector*]/local_name": {"fun": "load_from", "terms": "Detectors/Name"}, - "IGNORE": {"fun": "load_from", "terms": "Detectors/Mode"}, - "IGNORE": {"fun": "load_from", "terms": "T2/Contrast"}, - "IGNORE": {"fun": "load_from", "terms": "T2/Brightness"}, - "/ENTRY[entry*]/measurement/EVENT_DATA_EM_SET[event_data_em_set]/EVENT_DATA_EM[event_data_em*]/event_type": {"fun": "load_from_lower_case", "terms": "T2/Signal"}, - "IGNORE": {"fun": "load_from", "terms": "T2/ContrastDB"}, - "IGNORE": {"fun": "load_from", "terms": "T2/BrightnessDB"}, - "IGNORE": {"fun": "load_from", "terms": "T2/Setting"}, - "IGNORE": {"fun": "load_from", "terms": "T2/MinimumDwellTime"}, - "IGNORE": {"fun": "load_from", "terms": "Accessories/Number"}, - "IGNORE": {"fun": "load_from", "terms": "EBeamDeceleration/ModeOn"}, - "IGNORE": {"fun": "load_from", "terms": "EBeamDeceleration/LandingEnergy"}, - "IGNORE": {"fun": "load_from", "terms": "EBeamDeceleration/ImmersionRatio"}, - "IGNORE": {"fun": "load_from", "terms": "EBeamDeceleration/StageBias"}, - "IGNORE": {"fun": "load_from", "terms": "CompoundLensFilter/IsOn"}, - "IGNORE": {"fun": "load_from", "terms": "CompoundLensFilter/ThresholdEnergy"}, - "IGNORE": {"fun": "load_from", "terms": "PrivateFei/BitShift"}, - "IGNORE": {"fun": "load_from", "terms": "PrivateFei/DataBarSelected"}, - "IGNORE": {"fun": "load_from", "terms": "PrivateFei/DataBarAvailable"}, - "IGNORE": {"fun": "load_from", "terms": "PrivateFei/TimeOfCreation"}, - "IGNORE": {"fun": "load_from", "terms": "PrivateFei/DatabarHeight"}, - "IGNORE": {"fun": "load_from", "terms": "HiResIllumination/BrightFieldIsOn"}, - "IGNORE": {"fun": "load_from", "terms": "HiResIllumination/BrightFieldValue"}, - "IGNORE": {"fun": "load_from", "terms": "HiResIllumination/DarkFieldIsOn"}, - "IGNORE": {"fun": "load_from", "terms": "HiResIllumination/DarkFieldValue"}, - "IGNORE": {"fun": "load_from", "terms": "EasyLift/Rotation"}, - "IGNORE": {"fun": "load_from", "terms": "HotStageMEMS/HeatingCurrent"}, - "IGNORE": {"fun": "load_from", "terms": "HotStageMEMS/HeatingVoltage"}, - "IGNORE": {"fun": "load_from", "terms": "HotStageMEMS/TargetTemperature"}, - "IGNORE": {"fun": "load_from", "terms": "HotStageMEMS/ActualTemperature"}, - "IGNORE": {"fun": "load_from", "terms": "HotStageMEMS/HeatingPower"}, - "IGNORE": {"fun": "load_from", "terms": "HotStageMEMS/SampleBias"}, - "IGNORE": {"fun": "load_from", "terms": "HotStageMEMS/SampleResistance"}, - "IGNORE": {"fun": "load_from", "terms": "HotStage/TargetTemperature"}, - "IGNORE": {"fun": "load_from", "terms": "HotStage/ActualTemperature"}, - "IGNORE": {"fun": "load_from", "terms": "HotStage/SampleBias"}, - "IGNORE": {"fun": "load_from", "terms": "HotStage/ShieldBias"}, - "IGNORE": {"fun": "load_from", "terms": "HotStageHVHS/TargetTemperature"}, - "IGNORE": {"fun": "load_from", "terms": "HotStageHVHS/ActualTemperature"}, - "IGNORE": {"fun": "load_from", "terms": "HotStageHVHS/SampleBias"}, - "IGNORE": {"fun": "load_from", "terms": "HotStageHVHS/ShieldBias"}, - "IGNORE": {"fun": "load_from", "terms": "ColdStage/TargetTemperature"}, - "IGNORE": {"fun": "load_from", "terms": "ColdStage/ActualTemperature"}, - "IGNORE": {"fun": "load_from", "terms": "ColdStage/Humidity"}, - "IGNORE": {"fun": "load_from", "terms": "ColdStage/SampleBias"}} +TIFF_TFS_TO_NEXUS_CFG = [('/ENTRY[entry*]/measurement/EVENT_DATA_EM_SET[event_data_em_set]/EVENT_DATA_EM[event_data_em*]/em_lab/DETECTOR[detector*]/mode', 'load_from', 'Detectors/Mode'), + ('/ENTRY[entry*]/measurement/em_lab/DETECTOR[detector*]/local_name', 'load_from', 'Detectors/Name'), + ('/ENTRY[entry*]/measurement/em_lab/EBEAM_COLUMN[ebeam_column]/APERTURE_EM[aperture_em*]/description', 'load_from', 'EBeam/Aperture'), + ('/ENTRY[entry*]/measurement/em_lab/EBEAM_COLUMN[ebeam_column]/APERTURE_EM[aperture_em*]/value', 'load_from', 'EBeam/ApertureDiameter'), + ('/ENTRY[entry*]/measurement/em_lab/EBEAM_COLUMN[ebeam_column]/APERTURE_EM[aperture_em*]/value/@units', 'm'), + ('/ENTRY[entry*]/measurement/em_lab/OPTICAL_SYSTEM_EM[optical_system_em]/beam_current', 'load_from', 'EBeam/BeamCurrent'), + ('/ENTRY[entry*]/measurement/em_lab/OPTICAL_SYSTEM_EM[optical_system_em]/beam_current/@units', 'A'), + ('/ENTRY[entry*]/measurement/em_lab/EBEAM_COLUMN[ebeam_column]/electron_source/voltage', 'load_from', 'EBeam/HV'), + ('/ENTRY[entry*]/measurement/em_lab/EBEAM_COLUMN[ebeam_column]/electron_source/voltage/@units', 'V'), + ('/ENTRY[entry*]/measurement/EVENT_DATA_EM_SET[event_data_em_set]/EVENT_DATA_EM[event_data_em*]/em_lab/STAGE_LAB[stage_lab]/tilt_1', 'load_from_rad_to_deg', 'EBeam/StageTa'), + ('/ENTRY[entry*]/measurement/EVENT_DATA_EM_SET[event_data_em_set]/EVENT_DATA_EM[event_data_em*]/em_lab/STAGE_LAB[stage_lab]/tilt_1/@units', 'deg'), + ('/ENTRY[entry*]/measurement/EVENT_DATA_EM_SET[event_data_em_set]/EVENT_DATA_EM[event_data_em*]/em_lab/STAGE_LAB[stage_lab]/tilt_2', 'load_from_rad_to_deg', 'EBeam/StageTb'), + ('/ENTRY[entry*]/measurement/EVENT_DATA_EM_SET[event_data_em_set]/EVENT_DATA_EM[event_data_em*]/em_lab/STAGE_LAB[stage_lab]/tilt_2/@units', 'deg'), + ('/ENTRY[entry*]/measurement/EVENT_DATA_EM_SET[event_data_em_set]/EVENT_DATA_EM[event_data_em*]/em_lab/EBEAM_COLUMN[ebeam_column]/operation_mode', 'load_from', 'EBeam/UseCase'), + ('/ENTRY[entry*]/measurement/em_lab/OPTICAL_SYSTEM_EM[optical_system_em]/working_distance', 'load_from', 'EBeam/WD'), + ('/ENTRY[entry*]/measurement/em_lab/OPTICAL_SYSTEM_EM[optical_system_em]/working_distance/@units', 'm'), + ('/ENTRY[entry*]/measurement/EVENT_DATA_EM_SET[event_data_em_set]/EVENT_DATA_EM[event_data_em*]/event_type', 'load_from_lower_case', 'ETD/Signal'), + ('/ENTRY[entry*]/measurement/EVENT_DATA_EM_SET[event_data_em_set]/EVENT_DATA_EM[event_data_em*]/em_lab/SCANBOX_EM[scanbox_em]/dwell_time', 'load_from', 'Scan/Dwelltime'), + ('/ENTRY[entry*]/measurement/EVENT_DATA_EM_SET[event_data_em_set]/EVENT_DATA_EM[event_data_em*]/em_lab/SCANBOX_EM[scanbox_em]/dwell_time/@units', 's'), + ('/ENTRY[entry*]/measurement/em_lab/FABRICATION[fabrication]/identifier', 'load_from', 'System/BuildNr'), + ('/ENTRY[entry*]/measurement/EVENT_DATA_EM_SET[event_data_em_set]/EVENT_DATA_EM[event_data_em*]/em_lab/SCANBOX_EM[scanbox_em]/scan_schema', 'load_from', 'System/Scan'), + ('/ENTRY[entry*]/measurement/em_lab/EBEAM_COLUMN[ebeam_column]/electron_source/emitter_type', 'load_from', 'System/Source'), + ('/ENTRY[entry*]/measurement/em_lab/FABRICATION[fabrication]/vendor', 'FEI'), + ('/ENTRY[entry*]/measurement/em_lab/FABRICATION[fabrication]/model', 'load_from', 'System/SystemType'), + ('/ENTRY[entry*]/measurement/EVENT_DATA_EM_SET[event_data_em_set]/EVENT_DATA_EM[event_data_em*]/event_type', 'load_from_lower_case', 'T1/Signal'), + ('/ENTRY[entry*]/measurement/EVENT_DATA_EM_SET[event_data_em_set]/EVENT_DATA_EM[event_data_em*]/event_type', 'load_from_lower_case', 'T2/Signal'), + ('/ENTRY[entry*]/measurement/EVENT_DATA_EM_SET[event_data_em_set]/EVENT_DATA_EM[event_data_em*]/event_type', 'load_from_lower_case', 'T3/Signal')] diff --git a/pynxtools/dataconverter/readers/em/subparsers/image_tiff_tfs_concepts.py b/pynxtools/dataconverter/readers/em/subparsers/image_tiff_tfs_concepts.py new file mode 100644 index 000000000..8e7f2d69d --- /dev/null +++ b/pynxtools/dataconverter/readers/em/subparsers/image_tiff_tfs_concepts.py @@ -0,0 +1,301 @@ +# +# Copyright The NOMAD Authors. +# +# This file is part of NOMAD. See https://nomad-lab.eu for further info. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +"""Configuration of the image_tiff_tfs subparser.""" + +from typing import List + + +# this example exemplifies the situation for the TFS/FEI SEM Apreo from the IKZ of Prof. Martin Albrecht +# thanks to Robert Kernke it was clarified the microscope has several detectors and imaging modes +# these imaging modes control the specific TFS/FEI concept instances stored in the respective TIFF file +# we here use a glossary of all concepts which we were able to parse out from an example image +# taken for each detector and imaging mode +# we then assume that one can work with the joint set of these concepts + +TIFF_TFS_PARENT_CONCEPTS = ["Accessories", + "Beam", + "ColdStage", + "CompoundLensFilter", + "Detectors", + "EBeam", + "EBeamDeceleration", + "EScan", + "ETD", + "EasyLift", + "GIS", + "HiResIllumination", + "HotStage", + "HotStageHVHS", + "HotStageMEMS", + "IRBeam", + "Image", + "Nav-Cam", + "PrivateFei", + "Scan", + "Specimen", + "Stage", + "System", + "T1", + "T2", + "T3", + "User", + "Vacuum"] + +TIFF_TFS_ALL_CONCEPTS = ["Accessories/Number", + "Beam/Beam", + "Beam/BeamShiftX", + "Beam/BeamShiftY", + "Beam/FineStageBias", + "Beam/HV", + "Beam/ImageMode", + "Beam/Scan", + "Beam/ScanRotation", + "Beam/Spot", + "Beam/StigmatorX", + "Beam/StigmatorY", + "ColdStage/ActualTemperature", + "ColdStage/Humidity", + "ColdStage/SampleBias", + "ColdStage/TargetTemperature", + "CompoundLensFilter/IsOn", + "CompoundLensFilter/ThresholdEnergy", + "Detectors/Mode", + "Detectors/Name", + "Detectors/Number", + "EasyLift/Rotation", + "EBeam/Acq", + "EBeam/Aperture", + "EBeam/ApertureDiameter", + "EBeam/ATubeVoltage", + "EBeam/BeamCurrent", + "EBeam/BeamMode", + "EBeam/BeamShiftX", + "EBeam/BeamShiftY", + "EBeam/ColumnType", + "EBeam/DynamicFocusIsOn", + "EBeam/DynamicWDIsOn", + "EBeam/EmissionCurrent", + "EBeam/EucWD", + "EBeam/FinalLens", + "EBeam/HFW", + "EBeam/HV", + "EBeam/ImageMode", + "EBeam/LensMode", + "EBeam/LensModeA", + "EBeam/MagnificationCorrection", + "EBeam/PreTilt", + "EBeam/ScanRotation", + "EBeam/SemOpticalMode", + "EBeam/Source", + "EBeam/SourceTiltX", + "EBeam/SourceTiltY", + "EBeam/StageR", + "EBeam/StageTa", + "EBeam/StageTb", + "EBeam/StageX", + "EBeam/StageY", + "EBeam/StageZ", + "EBeam/StigmatorX", + "EBeam/StigmatorY", + "EBeam/TiltCorrectionAngle", + "EBeam/TiltCorrectionIsOn", + "EBeam/UseCase", + "EBeam/VFW", + "EBeam/WD", + "EBeam/WehneltBias", + "EBeamDeceleration/ImmersionRatio", + "EBeamDeceleration/LandingEnergy", + "EBeamDeceleration/ModeOn", + "EBeamDeceleration/StageBias", + "EScan/Dwell", + "EScan/FrameTime", + "EScan/HorFieldsize", + "EScan/InternalScan", + "EScan/LineIntegration", + "EScan/LineTime", + "EScan/Mainslock", + "EScan/PixelHeight", + "EScan/PixelWidth", + "EScan/Scan", + "EScan/ScanInterlacing", + "EScan/VerFieldsize", + "ETD/Brightness", + "ETD/BrightnessDB", + "ETD/Contrast", + "ETD/ContrastDB", + "ETD/Grid", + "ETD/MinimumDwellTime", + "ETD/Mix", + "ETD/Setting", + "ETD/Signal", + "GIS/Number", + "HiResIllumination/BrightFieldIsOn", + "HiResIllumination/BrightFieldValue", + "HiResIllumination/DarkFieldIsOn", + "HiResIllumination/DarkFieldValue", + "HotStage/ActualTemperature", + "HotStage/SampleBias", + "HotStage/ShieldBias", + "HotStage/TargetTemperature", + "HotStageHVHS/ActualTemperature", + "HotStageHVHS/SampleBias", + "HotStageHVHS/ShieldBias", + "HotStageHVHS/TargetTemperature", + "HotStageMEMS/ActualTemperature", + "HotStageMEMS/HeatingCurrent", + "HotStageMEMS/HeatingPower", + "HotStageMEMS/HeatingVoltage", + "HotStageMEMS/SampleBias", + "HotStageMEMS/SampleResistance", + "HotStageMEMS/TargetTemperature", + "Image/Average", + "Image/DigitalBrightness", + "Image/DigitalContrast", + "Image/DigitalGamma", + "Image/DriftCorrected", + "Image/Integrate", + "Image/MagCanvasRealWidth", + "Image/MagnificationMode", + "Image/PostProcessing", + "Image/ResolutionX", + "Image/ResolutionY", + "Image/ScreenMagCanvasRealWidth", + "Image/ScreenMagnificationMode", + "Image/Transformation", + "Image/ZoomFactor", + "Image/ZoomPanX", + "Image/ZoomPanY", + "IRBeam/HFW", + "IRBeam/n", + "IRBeam/ScanRotation", + "IRBeam/SiDepth", + "IRBeam/StageR", + "IRBeam/StageTa", + "IRBeam/StageTb", + "IRBeam/StageX", + "IRBeam/StageY", + "IRBeam/StageZ", + "IRBeam/VFW", + "IRBeam/WD", + "PrivateFei/BitShift", + "PrivateFei/DataBarAvailable", + "PrivateFei/DatabarHeight", + "PrivateFei/DataBarSelected", + "PrivateFei/TimeOfCreation", + "Scan/Average", + "Scan/Dwelltime", + "Scan/FrameTime", + "Scan/HorFieldsize", + "Scan/Integrate", + "Scan/InternalScan", + "Scan/PixelHeight", + "Scan/PixelWidth", + "Scan/VerFieldsize", + "Specimen/SpecimenCurrent", + "Specimen/Temperature", + "Stage/ActiveStage", + "Stage/SpecTilt", + "Stage/StageR", + "Stage/StageT", + "Stage/StageTb", + "Stage/StageX", + "Stage/StageY", + "Stage/StageZ", + "Stage/WorkingDistance", + "System/Acq", + "System/Aperture", + "System/BuildNr", + "System/Chamber", + "System/Column", + "System/DisplayHeight", + "System/DisplayWidth", + "System/Dnumber", + "System/ESEM", + "System/EucWD", + "System/FinalLens", + "System/Pump", + "System/Scan", + "System/Software", + "System/Source", + "System/Stage", + "System/SystemType", + "System/Type", + "T1/Brightness", + "T1/BrightnessDB", + "T1/Contrast", + "T1/ContrastDB", + "T1/MinimumDwellTime", + "T1/Setting", + "T1/Signal", + "T2/Brightness", + "T2/BrightnessDB", + "T2/Contrast", + "T2/ContrastDB", + "T2/MinimumDwellTime", + "T2/Setting", + "T2/Signal", + "T3/Brightness", + "T3/BrightnessDB", + "T3/Contrast", + "T3/ContrastDB", + "T3/MinimumDwellTime", + "T3/Signal", + "User/Date", + "User/Time", + "User/User", + "User/UserText", + "User/UserTextUnicode", + "Vacuum/ChPressure", + "Vacuum/Gas", + "Vacuum/Humidity", + "Vacuum/UserMode"] + +# there is more to know and understand than just knowing TFS/FEI uses +# the above-mentioned concepts in their taxonomy: +# take the example of System/Source for which an example file (instance) has the +# value "FEG" +# similar like in NeXus "System/Source" labels a concept for which (assumption!) there +# is a controlled enumeration of symbols possible (as the example shows "FEG" is one such +# allowed symbol of the enumeration. +# The key issue is that the symbols for the leaf (here "FEG") means nothing eventually +# when one has another semantic world-view, like in NOMAD metainfo or NeXus +# (only us) humans understand that what TFS/FEI likely means with the symbol +# "FEG" is exactly the same as what we mean in NeXus when setting emitter_type of +# NXebeam_column to "cold_cathode_field_emitter" +# world with the controlled enumeration value "other" because we do not know +# if FEG means really a filament or a cold_cathode_field_emitter + + +def get_fei_parent_concepts() -> List: + """Get list of unique FEI parent concepts.""" + return TIFF_TFS_PARENT_CONCEPTS + # parent_concepts = set() + # for entry in TiffTfsConcepts: + # if isinstance(entry, str) and entry.count("/") == 1: + # parent_concepts.add(entry.split("/")[0]) + # return list(parent_concepts) + + +def get_fei_childs(parent_concept: str) -> List: + """Get all children of FEI parent concept.""" + child_concepts = set() + for entry in TIFF_TFS_ALL_CONCEPTS: + if isinstance(entry, str) and entry.count("/") == 1: + if entry.startswith(f"{parent_concept}/") is True: + child_concepts.add(entry.split("/")[1]) + return list(child_concepts) diff --git a/pynxtools/dataconverter/readers/em/subparsers/image_tiff_tfs_modifier.py b/pynxtools/dataconverter/readers/em/subparsers/image_tiff_tfs_modifier.py index dddd59bd3..2a4a5f5e9 100644 --- a/pynxtools/dataconverter/readers/em/subparsers/image_tiff_tfs_modifier.py +++ b/pynxtools/dataconverter/readers/em/subparsers/image_tiff_tfs_modifier.py @@ -19,31 +19,25 @@ # pylint: disable=no-member -from pynxtools.dataconverter.readers.em.subparsers.image_tiff_tfs_cfg import \ - TfsToNexusConceptMapping +from numpy import pi -def get_nexus_value(modifier, metadata: dict): - """Interpret a functional mapping using data from dct via calling modifiers.""" - if isinstance(modifier, dict): - # different commands are available - if set(["fun", "terms"]) == set(modifier.keys()): - if modifier["fun"] == "load_from": - if modifier["terms"] in metadata.keys(): - return metadata[modifier['terms']] - else: - raise ValueError(f"Unable to interpret modififier load_from for argument {modifier['terms']}") - if modifier["fun"] == "tfs_to_nexus": - # print(metadata[modifier['terms']]) - if f"{modifier['terms']}/{metadata[modifier['terms']]}" in TfsToNexusConceptMapping.keys(): - return TfsToNexusConceptMapping[f"{modifier['terms']}/{metadata[modifier['terms']]}"] - else: - raise ValueError(f"Unable to interpret modifier tfs_to_nexus for argument {modifier['terms']}/{metadata[modifier['terms']]}") - else: - print(f"WARNING::Modifier {modifier} is currently not implemented !") - # elif set(["link"]) == set(modifier.keys()), with the jsonmap reader Sherjeel conceptualized "link" +def get_nexus_value(modifier, qnt_name, metadata: dict): + """Interpret a functional mapping and modifier on qnt_name loaded from metadata.""" + if qnt_name in metadata.keys(): + if modifier == "load_from": + return metadata[qnt_name] + elif modifier == "load_from_rad_to_deg": + if qnt_name in metadata.keys(): + return metadata[qnt_name] / pi * 180. + elif modifier == "load_from_lower_case": + if isinstance(metadata[qnt_name], str): + return metadata[qnt_name].lower() + # print(f"WARNING modifier {modifier}, qnt_name {qnt_name} metadata['qnt_name'] not string !") return None - elif isinstance(modifier, str): - return modifier # metadata[modifier] else: + # print(f"WARNING modifier {modifier}, qnt_name {qnt_name} not found !") return None + # if f"{modifier['terms']}/{metadata[modifier['terms']]}" in TfsToNexusConceptMapping.keys(): + # return TfsToNexusConceptMapping[f"{modifier['terms']}/{metadata[modifier['terms']]}"] + # elif set(["link"]) == set(modifier.keys()), with the jsonmap reader Sherjeel conceptualized "link" diff --git a/pyproject.toml b/pyproject.toml index f8e75cf10..21ebf7b89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,6 +28,7 @@ dependencies = [ "PyYAML>=6.0", "numpy>=1.21.2", "pandas>=1.3.2", + "odfpy>=1.4.1", "ase>=3.19.0", "flatdict>=4.0.1", "hyperspy>=1.7.6",