Skip to content

Commit

Permalink
axon parser using v3 and tested
Browse files Browse the repository at this point in the history
  • Loading branch information
atomprobe-tc committed Aug 19, 2024
1 parent 4334a53 commit e083309
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 84 deletions.
10 changes: 6 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
"args": ["convert",
// eln_data/oasis_specific
//"examples/em.conventions.yaml",
"examples/eln_data.yaml",
"examples/em.oasis.specific.yaml",
//"examples/eln_data.yaml",
//"examples/em.oasis.specific.yaml",
"../axon/ReductionOfFeOxSmall.zip",
//"../nion-parsing/2022-02-18_Metadata_Kuehbach.zip",
//"/media/kaiobach/production/paper_paper_paper/scidat_nomad_em/digitalmicrograph/241.a2c338fd458e6b7023ec946a5e3ce8c85bd2befcb5d17dae7ae5f44b2dede81b.dm4",
//"/media/kaiobach/production/paper_paper_paper/scidat_nomad_em/digitalmicrograph/218.ebdf722abcf63000e2fa71fc6a72cd4b4747991c702a2dc65e400196f990cbad.dm3",
Expand All @@ -28,8 +29,9 @@
"em",
"--nxdl",
"NXem",
//"--output=dbg/conv.nxs"
"--output=dbg/eln.nxs"],
//"--output=dbg/conv.nxs",
//"--output=dbg/eln.nxs",
"--output=dbg/axon.nxs"],
}
]
}
43 changes: 23 additions & 20 deletions src/pynxtools_em/configurations/image_png_protochips_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"""Configuration of the image_png_protochips parser."""

import re
from typing import Dict

from pynxtools_em.utils.pint_custom_unit_registry import ureg


def specific_to_variadic(token):
Expand Down Expand Up @@ -46,7 +47,8 @@ def specific_to_variadic(token):


AXON_DETECTOR_STATIC_TO_NX_EM = {
"prefix": "/ENTRY[entry*]/measurement/em_lab/DETECTOR[detector*]",
"prefix_trg": "/ENTRY[entry*]/measurement/em_lab/detectorID[detector*]",
"prefix_src": "",
"use": [
(
"local_name",
Expand All @@ -59,34 +61,33 @@ def specific_to_variadic(token):
AXON_STAGE_DYNAMIC_TO_NX_EM = {
"prefix_trg": "/ENTRY[entry*]/measurement/event_data_em_set/EVENT_DATA_EM[event_data_em*]/em_lab/STAGE_LAB[stage_lab]",
"prefix_src": "MicroscopeControlImageMetadata.ActivePositionerSettings.PositionerSettings.[*].Stage.",
"map_to_real_and_join": [("position", ["X", "Y", "Z"])],
} # "use": [("position/@units", "m")], values are much to large to be m
"map_to_f8": [
("position", ureg.meter, ["X", "Y", "Z"], ureg.meter)
], # values are much to large to be in m!
}


AXON_CHIP_DYNAMIC_TO_NX_EM = {
"prefix_trg": "/ENTRY[entry*]/measurement/event_data_em_set/EVENT_DATA_EM[event_data_em*]/em_lab/heater",
"prefix_src": "MicroscopeControlImageMetadata.AuxiliaryData.AuxiliaryDataCategory.[*].DataValues.AuxiliaryDataValue.[*].",
"use": [("current/@units", "A"), ("power/@units", "W"), ("voltage/@units", "V")],
"map_to_real": [
("current", "HeatingCurrent"),
("power", "HeatingPower"),
("voltage", "HeatingVoltage"),
"map_to_f8": [
("current", ureg.ampere, "HeatingCurrent", ureg.ampere),
("power", ureg.watt, "HeatingPower", ureg.watt),
("voltage", ureg.volt, "HeatingVoltage", ureg.volt),
],
}


AXON_AUX_DYNAMIC_TO_NX_EM = {
"prefix_trg": "/ENTRY[entry*]/measurement/event_data_em_set/EVENT_DATA_EM[event_data_em*]/em_lab/STAGE_LAB[stage_lab]",
"prefix_trg": "/ENTRY[entry*]/measurement/event_data_em_set/EVENT_DATA_EM[event_data_em*]/em_lab/ebeam_column",
"prefix_src": "MicroscopeControlImageMetadata.AuxiliaryData.AuxiliaryDataCategory.[*].DataValues.AuxiliaryDataValue.[*].",
"use": [
("SENSOR[sensor2]/value/@units", "torr"),
("SENSOR[sensor2]/measurement", "pressure"),
("SENSOR[sensor1]/value/@units", "°C"),
("SENSOR[sensor1]/measurement", "temperature"),
("sensorID[sensor1]/measurement", "temperature"),
("sensorID[sensor2]/measurement", "pressure"),
],
"map_to_real": [
("SENSOR[sensor2]/value", "HolderPressure"),
("SENSOR[sensor1]/value", "HolderTemperature"),
"map_to_f8": [
("sensorID[sensor1]/value", ureg.degC, "HolderTemperature", ureg.degC),
("sensorID[sensor2]/value", ureg.bar, "HolderPressure", ureg.torr),
],
}

Expand All @@ -95,7 +96,6 @@ def specific_to_variadic(token):
"prefix_trg": "/ENTRY[entry*]/measurement/event_data_em_set/EVENT_DATA_EM[event_data_em*]",
"prefix_src": "MicroscopeControlImageMetadata.MicroscopeSettings.",
"use": [
("em_lab/EBEAM_COLUMN[ebeam_column]/electron_source/voltage/@units", "V"),
(
"event_type",
"As tested with AXON 10.4.4.21, 2021-04-26T22:51:28.4539893-05:00 not included in Protochips PNG metadata",
Expand All @@ -104,22 +104,25 @@ def specific_to_variadic(token):
"em_lab/DETECTOR[detector*]/mode",
"As tested with AXON 10.4.4.21, 2021-04-26T22:51:28.4539893-05:00 not included in Protochips PNG metadata",
),
("em_lab/OPTICAL_SYSTEM_EM[optical_system_em]/camera_length", "m"),
],
"map": [
(
"em_lab/EBEAM_COLUMN[ebeam_column]/DEFLECTOR[beam_blanker1]/state",
"BeamBlankerState",
),
],
"map_to_real": [
"map_to_f8": [
(
"em_lab/EBEAM_COLUMN[ebeam_column]/electron_source/voltage",
ureg.volt,
"AcceleratingVoltage",
ureg.volt,
),
(
"em_lab/OPTICAL_SYSTEM_EM[optical_system_em]/camera_length",
ureg.meter,
"CameraLengthValue",
ureg.meter,
),
(
"em_lab/OPTICAL_SYSTEM_EM[optical_system_em]/magnification",
Expand Down
Loading

0 comments on commit e083309

Please sign in to comment.