Skip to content

Commit

Permalink
Fix AEQDSK problems in mapping
Browse files Browse the repository at this point in the history
Some variables have different names in MDS+ and EFIT which is
complicated by the fact that some of the names in MDS+ match the
EFIT names but have different or missing data...
  • Loading branch information
torrinba committed Jul 20, 2023
1 parent 9ea3801 commit 2a69ca6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 24 deletions.
46 changes: 31 additions & 15 deletions omas/machine_mappings/_efit.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,25 @@
"eval2TDI": "py2tdi(nan_where,'\\{EFIT_tree}::TOP.RESULTS.GEQDSK.ZBBBS','\\{EFIT_tree}::TOP.RESULTS.GEQDSK.RBBBS',0)",
"treename": "{EFIT_tree}"
},
"equilibrium.time_slice.:.boundary.x_point.:.r": {
"equilibrium.time_slice.:.boundary.x_point.0.r": {
"NANFILTER": true,
"eval2TDI": "py2tdi(nan_where,'\\{EFIT_tree}::TOP.RESULTS.AEQDSK.RSEPS','\\{EFIT_tree}::TOP.RESULTS.AEQDSK.RSEPS',0)",
"eval2TDI": "py2tdi(nan_where,'\\{EFIT_tree}::TOP.RESULTS.AEQDSK.RXPT1','\\{EFIT_tree}::TOP.RESULTS.AEQDSK.RXPT1',0)",
"treename": "{EFIT_tree}",
"TRANSPOSE": [1,0]
},
"equilibrium.time_slice.:.boundary.x_point.:.z": {
"equilibrium.time_slice.:.boundary.x_point.1.r": {
"NANFILTER": true,
"eval2TDI": "py2tdi(nan_where,'\\{EFIT_tree}::TOP.RESULTS.AEQDSK.ZSEPS','\\{EFIT_tree}::TOP.RESULTS.AEQDSK.ZSEPS',0)",
"eval2TDI": "py2tdi(nan_where,'\\{EFIT_tree}::TOP.RESULTS.AEQDSK.RXPT2','\\{EFIT_tree}::TOP.RESULTS.AEQDSK.RXPT2',0)",
"treename": "{EFIT_tree}",
},
"equilibrium.time_slice.:.boundary.x_point.0.z": {
"NANFILTER": true,
"eval2TDI": "py2tdi(nan_where,'\\{EFIT_tree}::TOP.RESULTS.AEQDSK.ZXPT1','\\{EFIT_tree}::TOP.RESULTS.AEQDSK.ZXPT1',0)",
"treename": "{EFIT_tree}",
},
"equilibrium.time_slice.:.boundary.x_point.1.z": {
"NANFILTER": true,
"eval2TDI": "py2tdi(nan_where,'\\{EFIT_tree}::TOP.RESULTS.AEQDSK.ZXPT2','\\{EFIT_tree}::TOP.RESULTS.AEQDSK.ZXPT2',0)",
"treename": "{EFIT_tree}",
"TRANSPOSE": [1,0]
},
"equilibrium.time_slice.:.boundary_separatrix.outline.r": {
"NANFILTER": true,
Expand All @@ -59,28 +67,36 @@
"eval2TDI": "py2tdi(nan_where,'\\{EFIT_tree}::TOP.RESULTS.GEQDSK.ZBBBS','\\{EFIT_tree}::TOP.RESULTS.GEQDSK.RBBBS',0)",
"treename": "{EFIT_tree}"
},
"equilibrium.time_slice.:.boundary_separatrix.x_point.:.r": {
"equilibrium.time_slice.:.boundary_separatrix.x_point.0.r": {
"NANFILTER": true,
"eval2TDI": "py2tdi(nan_where,'\\{EFIT_tree}::TOP.RESULTS.AEQDSK.RXPT1','\\{EFIT_tree}::TOP.RESULTS.AEQDSK.RXPT1',0)",
"treename": "{EFIT_tree}",
},
"equilibrium.time_slice.:.boundary_separatrix.x_point.1.r": {
"NANFILTER": true,
"eval2TDI": "py2tdi(nan_where,'\\{EFIT_tree}::TOP.RESULTS.AEQDSK.RXPT2','\\{EFIT_tree}::TOP.RESULTS.AEQDSK.RXPT2',0)",
"treename": "{EFIT_tree}",
},
"equilibrium.time_slice.:.boundary_separatrix.x_point.0.z": {
"NANFILTER": true,
"eval2TDI": "py2tdi(nan_where,'\\{EFIT_tree}::TOP.RESULTS.AEQDSK.RSEPS','\\{EFIT_tree}::TOP.RESULTS.AEQDSK.RSEPS',0)",
"eval2TDI": "py2tdi(nan_where,'\\{EFIT_tree}::TOP.RESULTS.AEQDSK.ZXPT1','\\{EFIT_tree}::TOP.RESULTS.AEQDSK.ZXPT1',0)",
"treename": "{EFIT_tree}",
"TRANSPOSE": [1,0]
},
"equilibrium.time_slice.:.boundary_separatrix.x_point.:.z": {
"equilibrium.time_slice.:.boundary_separatrix.x_point.1.z": {
"NANFILTER": true,
"eval2TDI": "py2tdi(nan_where,'\\{EFIT_tree}::TOP.RESULTS.AEQDSK.ZSEPS','\\{EFIT_tree}::TOP.RESULTS.AEQDSK.ZSEPS',0)",
"eval2TDI": "py2tdi(nan_where,'\\{EFIT_tree}::TOP.RESULTS.AEQDSK.ZXPT2','\\{EFIT_tree}::TOP.RESULTS.AEQDSK.ZXPT2',0)",
"treename": "{EFIT_tree}",
"TRANSPOSE": [1,0]
},
"equilibrium.time_slice.:.boundary_separatrix.geometric_axis.r": {
"TDI": "data(\\{EFIT_tree}::TOP.RESULTS.AEQDSK.ROUT)/100.",
"TDI": "data(\\{EFIT_tree}::TOP.RESULTS.AEQDSK.RSURF)/100.",
"treename": "{EFIT_tree}"
},
"equilibrium.time_slice.:.boundary_separatrix.geometric_axis.z": {
"TDI": "data(\\{EFIT_tree}::TOP.RESULTS.AEQDSK.ZOUT)/100.",
"TDI": "data(\\{EFIT_tree}::TOP.RESULTS.AEQDSK.ZSURF)/100.",
"treename": "{EFIT_tree}"
},
"equilibrium.time_slice.:.boundary_separatrix.closest_wall_point.distance": {
"eval2TDI": "py2tdi(min_4,'\\{EFIT_tree}::TOP.RESULTS.AEQDSK.GAPIN/100.','\\{EFIT_tree}::TOP.RESULTS.AEQDSK.GAPTOP/100.','\\{EFIT_tree}::TOP.RESULTS.AEQDSK.GAPOUT/100.','\\{EFIT_tree}::TOP.RESULTS.AEQDSK.GAPBOT/100.')",
"TDI": "data(\\{EFIT_tree}::TOP.RESULTS.AEQDSK.ZEPLIM)/100.",
"treename": "{EFIT_tree}"
},
"equilibrium.time_slice.:.boundary_separatrix.gap.0.name": {
Expand Down
9 changes: 0 additions & 9 deletions omas/machine_mappings/python_tdi.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ def nan_where(a, b, n):
a[b == n] = np.NaN
return a

def min_4_w_scale(a, b, c, d, scale):
import numpy as np

a = a.data()
b = b.data()
c = c.data()
d = d.data()
return np.min(np.vstack([a,b,c,d]), axis=0) * scale

def get_largest_axis_value(a, b):
import numpy as np

Expand Down

0 comments on commit 2a69ca6

Please sign in to comment.