From 9cb2342930dd7e819239c2fd5fca776096b248bb Mon Sep 17 00:00:00 2001 From: Adam Parker Date: Mon, 22 Apr 2024 17:59:20 +0100 Subject: [PATCH] Commit magnetics IDS mappings first pass --- mappings/magnetics/globals.json | 64 +++++++++++++++++++++++++- mappings/magnetics/mappings.json | 77 +++++++++++++++++++++++++++++++- requirements.txt | 15 ++++--- 3 files changed, 146 insertions(+), 10 deletions(-) diff --git a/mappings/magnetics/globals.json b/mappings/magnetics/globals.json index 98abb40..d32070b 100644 --- a/mappings/magnetics/globals.json +++ b/mappings/magnetics/globals.json @@ -1,3 +1,65 @@ { - "DESCRIPTION": "Global naming conventions and templating parameters for magnetics IDS" + "DESCRIPTION": "Global naming conventions and templating parameters for magnetics IDS", + "PI_const": 3.14159, + "phi_coord": [0.0, 6.2831855], + "flux_loop_names": [ + "cc01", "cc02", "cc03", "cc04", "cc05", "cc06", "cc07", "cc08", "cc09", "cc10", "p2u/1", "p2u/2", "p2u/3", + "p2u/4", "p3u/1", "p3u/2", "p3u/3", "p3u/4", "p4u/1", "p4u/2", "p4u/3", "p4u/4", "p5u/1", "p5u/2", "p5u/3", + "p5u/4", "p6u/1", "p6u/2", "p2l/1", "p2l/2", "p2l/3", "p2l/4", "p3l/1", "p3l/2", "p3l/3", "p3l/4", "p4l/1", + "p4l/2", "p4l/3", "p4l/4", "p5l/1", "p5l/2", "p5l/3", "p5l/4", "p6l/1", "p6l/2" + ], + "flux_loop_r": [ + 0.1785, 0.1785, 0.1785, 0.1785, 0.1785, 0.1785, 0.1785, 0.1785, 0.1785, 0.1785, 0.445, 0.501, 0.566, 0.6617, + 1.163, 1.163, 1.0354, 1.0354, 1.593, 1.593, 1.4001, 1.4001, 1.7493, 1.7493, 1.5458, 1.5458, 1.4025, 1.4025, + 0.445, 0.501, 0.566, 0.6617, 1.163, 1.163, 1.0354, 1.0354, 1.5984, 1.5984, 1.4005, 1.4005, 1.7463, 1.7463, + 1.7463, 1.5495, 1.4025, 1.4025 + ], + "flux_loop_z": [ + 1.2349, 0.9299, 0.6249, 0.3199, 0.0149, -0.0181, -0.3231, -0.6281, -0.9331, -1.2381, 1.56899, 1.56899, 1.56899, + 1.63838, 1.08259, 1.09759, 1.09759, 1.08309, 1.04079, 1.05579, 1.16579, 1.15079, 0.44221, 0.45721, 0.5642, + 0.5492, 0.889, 0.904, -1.57102, -1.57102, -1.57102, -1.64041, -1.0886, -1.1036, -1.1036, -1.0886, -1.04443, + -1.06943, -1.15943, -1.14403, -0.44224, -0.45724, -0.53224, -0.54724, -0.8876, -0.9026 + ], + "flux_loop_rel_error": 0.02, + "flux_lop_abs_error": 0.001, + "bpol_probe_names": [ + "amb_ccbv01", "amb_ccbv02", "amb_ccbv03", "amb_ccbv04", "amb_ccbv05", "amb_ccbv06", "amb_ccbv07", "amb_ccbv08", + "amb_ccbv09", "amb_ccbv10", "amb_ccbv11", "amb_ccbv12", "amb_ccbv13", "amb_ccbv14", "amb_ccbv15", "amb_ccbv16", + "amb_ccbv17", "amb_ccbv18", "amb_ccbv19", "amb_ccbv20", "amb_ccbv21", "amb_ccbv22", "amb_ccbv23", "amb_ccbv24", + "amb_ccbv25", "amb_ccbv26", "amb_ccbv27", "amb_ccbv28", "amb_ccbv29", "amb_ccbv30", "amb_ccbv31", "amb_ccbv32", + "amb_ccbv33", "amb_ccbv34", "amb_ccbv35", "amb_ccbv36", "amb_ccbv37", "amb_ccbv38", "amb_ccbv39", "amb_ccbv40", + "amb_obv01", "amb_obv02", "amb_obv03", "amb_obv04", "amb_obv05", "amb_obv06", "amb_obv07", "amb_obv08", + "amb_obv09", "amb_obv10", "amb_obv11", "amb_obv12", "amb_obv13", "amb_obv14", "amb_obv15", "amb_obv16", + "amb_obv17", "amb_obv18", "amb_obv19", "amb_obr01", "amb_obr02", "amb_obr03", "amb_obr04", "amb_obr05", + "amb_obr06", "amb_obr07", "amb_obr08", "amb_obr09", "amb_obr10", "amb_obr11", "amb_obr12", "amb_obr13", + "amb_obr14", "amb_obr15", "amb_obr16", "amb_obr17", "amb_obr18", "amb_obr19" + ], + "bpol_probe_r": [ + 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, + 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, + 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 0.1803, 1.442, 1.442, + 1.5897, 1.5897, 1.5897, 1.8449, 1.8449, 1.8449, 1.8449, 1.8449, 1.8449, 1.8449, 1.8449, 1.8449, 1.5913, 1.5913, + 1.5913, 1.4401, 1.4401, 1.442, 1.442, 1.5897, 1.5897, 1.5897, 1.8449, 1.8449, 1.8449, 1.8449, 1.8449, 1.8449, + 1.8449, 1.8449, 1.8449, 1.5913, 1.5913, 1.5913, 1.4401, 1.4401 + ], + "bpol_probe_z": [ + 1.44875, 1.3725, 1.29625, 1.22, 1.14375, 1.0675, 0.99125, 0.915, 0.83875, 0.75887, 0.68625, 0.61, 0.53375, + 0.4575, 0.38125, 0.305, 0.22875, 0.1525, 0.07625, 0.0, -0.07625, -0.1525, -0.22875, -0.305, -0.38125, -0.4575, + -0.53375, -0.61, -0.68625, -0.7625, -0.83875, -0.915, -0.99125, -1.0675, -1.14375, -1.22, -1.29625, -1.3725, + -1.44875, -1.525, 1.335, 1.26, 0.81045, 0.73545, 0.66045, 0.30698, 0.23198, 0.15698, 0.08198, 0.004, -0.06802, + -0.14302, -0.21802, -0.29302, -0.64038, -0.71538, -0.79038, -1.26017, -1.33517, 1.335, 1.26, 0.81045, 0.73545, + 0.66045, 0.30698, 0.23198, 0.15698, 0.08198, 0.00698, -0.06802, -0.14302, -0.21802, -0.29302, -0.64038, + -0.71538, -0.79038, -1.26017, -1.33517 + ], + "bpol_probes_poloidal_angle": [ + 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, + 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, + 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, + 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, + 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, + 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, 1.5707963, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 + ], + "bpol_rel_error": 0.01, + "bpol_abs_error": 0.0003 } diff --git a/mappings/magnetics/mappings.json b/mappings/magnetics/mappings.json index 11f1ce1..4c36fef 100644 --- a/mappings/magnetics/mappings.json +++ b/mappings/magnetics/mappings.json @@ -11,8 +11,81 @@ "MAP_TYPE": "PLUGIN", "PLUGIN": "UDA", "ARGS": { - "signal": "AMC_PLASMA_CURRENT" + "signal": "AMC_PLASMA CURRENT" }, - "SCALE": 1000 + "SCALE": 1000.0 + }, + "flux_loop": { + "MAP_TYPE": "VALUE", + "VALUE": 46 + }, + "flux_loop[#]/name": { + "MAP_TYPE": "VALUE", + "VALUE": "{{ at(flux_loop_names, indices.0) }}", + "COMMENT": "Use the index of the flux_loop_names array" + }, + "flux_loop[#]/identifier": { + "MAP_TYPE": "VALUE", + "VALUE": "{{ indices.0 }}" + }, + "flux_loop[#]/position": { + "MAP_TYPE": "VALUE", + "VALUE": "{{ length(phi_coords) }}" + }, + "flux_loop[#]/position[#]/r": { + "MAP_TYPE": "VALUE", + "VALUE": "{{ at(flux_loop_r, indices.0 )}}" + }, + "flux_loop[#]/position[#]/z": { + "MAP_TYPE": "VALUE", + "VALUE": "{{ at(flux_loop_z, indices.0 )}}" + }, + "flux_loop[#]/position[#]/phi": { + "MAP_TYPE": "VALUE", + "VALUE": "{{ at(phi_coord, indices.1) }}" + }, + "flux_loop[#]/flux": { + "MAP_TYPE": "PLUGIN", + "PLUGIN": "UDA", + "ARGS": { + "signal": "amb_fl/{{ at(flux_loop_names, indices.0) }}" + }, + "SCALE": -1.0 + }, + "bpol_probe": { + "MAP_TYPE": "VALUE", + "VALUE": "{{ length(bpol_probe_names) }}" + }, + "bpol_probe[#]/name": { + "MAP_TYPE": "VALUE", + "VALUE": "{{ at(bpol_probe_names, indices.0) }}" + }, + "bpol_probe[#]/identifier": { + "MAP_TYPE": "VALUE", + "VALUE": "{{ indices.0 }}" + }, + "bpol_probe[#]/position": { + "MAP_TYPE": "VALUE", + "VALUE": 1 + }, + "bpol_probe[#]/position[#]/r": { + "MAP_TYPE": "VALUE", + "VALUE": "{{ at(bpol_probe_r, indices.0) }}" + }, + "bpol_probe[#]/position[#]/z": { + "MAP_TYPE": "VALUE", + "VALUE": "{{ at(bpol_probe_z, indices.0) }}" + }, + "bpol_probe[#]/position/phi": { + "MAP_TYPE": "VALUE", + "VALUE": 0.0 + }, + "bpol_probe[#]/toroidal_angle": { + "MAP_TYPE": "VALUE", + "VALUE": 0.0 + }, + "bpol_probe[#]/poloidal_angle": { + "MAP_TYPE": "VALUE", + "VALUE": -1.5707964 } } diff --git a/requirements.txt b/requirements.txt index 4407a69..c5103cb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,15 @@ attrs==23.1.0 cexprtk==0.4.1 -Cython==0.29.36 +Cython==3.0.10 exceptiongroup==1.1.2 iniconfig==2.0.0 -jsonschema==4.18.0 -jsonschema-specifications==2023.6.1 -numpy==1.25.1 +jsonschema==4.21.1 +jsonschema-specifications==2023.12.1 +numpy==1.26.4 packaging==23.1 -pluggy==1.2.0 -pytest==7.4.0 -referencing==0.29.1 +pluggy==1.5.0 +pytest==8.1.1 +referencing==0.34.0 rpds-py==0.8.10 +setuptools==69.5.1 tomli==2.0.1