Skip to content

Commit

Permalink
Merge pull request #329 from gafusion/correct_MDSplus_name
Browse files Browse the repository at this point in the history
Use correct name for MDSplus
  • Loading branch information
torrinba authored Jan 14, 2025
2 parents 77574fb + 8b797a9 commit 70b82c8
Show file tree
Hide file tree
Showing 14 changed files with 105 additions and 105 deletions.
10 changes: 5 additions & 5 deletions omas/machine_mappings/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ def get_support_file(object_type, filename):

def MDS_gEQDSK_COCOS_identify(machine, pulse, EFIT_tree, EFIT_run_id):
"""
Python function that queries MDS+ EFIT tree to figure
Python function that queries MDSplus EFIT tree to figure
out COCOS convention used for a particular reconstruction
:param machine: machine name
:param pulse: pulse number
:param EFIT_tree: MDS+ EFIT tree name
:param EFIT_tree: MDSplus EFIT tree name
:param EFIT_run_id: with id extension for non-standard shot numbers. E.g. 19484401 for EFIT tree
Expand Down Expand Up @@ -87,7 +87,7 @@ def MDS_gEQDSK_psi(ods, machine, pulse, EFIT_tree):
:param pulse: pulse
:param EFIT_tree: MDS+ EFIT tree name
:param EFIT_tree: MDSplus EFIT tree name
:return: integer cocos convention
"""
Expand Down Expand Up @@ -200,9 +200,9 @@ def fetch_assign(
:param validity: location in `ods` where to set the validity flag
:param mds_server: MDS+ server to connect to
:param mds_server: MDSplus server to connect to
:param mds_tree: MDS+ tree from where to get the data
:param mds_tree: MDSplus tree from where to get the data
:param tdi_expression: string with tdi_expression to use
Expand Down
10 changes: 5 additions & 5 deletions omas/machine_mappings/d3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ def electron_cyclotron_emission_data(ods, pulse=133221, fast_ece=False, _measure
ece_uncertainty[key] = np.sqrt(np.abs(ece_data[key] * 1.e3)) + 70 * np.abs(ece_data[key])

ods['ece.ids_properties.homogeneous_time'] = 0
# Not in mds+
# Not in MDSplus
if not _measurements:
points = [{}, {}]
points[0]['r'] = 2.5
Expand Down Expand Up @@ -1386,8 +1386,8 @@ def equilibrium_special(ods, pulse, EFIT_tree="EFIT", get_all=True):
from omfit_classes.omfit_eqdsk import from_mds_plus, OMFITkeqdsk
times = mdsvalue('d3d', treename=EFIT_tree, pulse=pulse, TDI="\\TOP.RESULTS.GEQDSK.GTIME").raw()
if times is None:
print("No mds+ data")
raise ValueError(f"Could not find any data in MDS+ for {pulse} and {EFIT_tree}")
print("No MDSplus data")
raise ValueError(f"Could not find any data in MDSplus for {pulse} and {EFIT_tree}")
ods["equilibrium.ids_properties.homogeneous_time"] = 1
ods["equilibrium.time"]= times / 1.e3
if get_all == False:
Expand Down Expand Up @@ -1477,8 +1477,8 @@ def core_profiles_profile_1d(ods, pulse, PROFILES_tree="OMFIT_PROFS", PROFILES_r
query[entry + "_error_upper"] = "error_of(" + query[entry] + ")"
data = mdsvalue('d3d', treename=PROFILES_tree, pulse=pulse_id, TDI=query).raw()
if data is None:
print("No mds+ data")
raise ValueError(f"Could not find any data in MDS+ for {pulse} and {PROFILES_tree}")
print("No MDSplus data")
raise ValueError(f"Could not find any data in MDSplus for {pulse} and {PROFILES_tree}")
dim_info = mdsvalue('d3d', treename=PROFILES_tree, pulse=pulse_id, TDI="\\TOP.n_e")

data['time'] = dim_info.dim_of(1) * 1.e-3
Expand Down
12 changes: 6 additions & 6 deletions omas/machine_mappings/nstxu.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import glob

# NOTES:
# List of MDS+ signals
# List of MDSplus signals
# https://nstx.pppl.gov/nstx/Software/FAQ/signallabels.html
# magnetics:
# https://nstx.pppl.gov/DragNDrop/Operations/Physics_Operations_Course/11%20OpsCourse_EquilibriumMagnetics_Rev1.pdf
Expand Down Expand Up @@ -272,7 +272,7 @@ def MDS_gEQDSK_bbbs_nstx(ods, pulse, EFIT_tree='EFIT01'):
:param pulse: shot number
:param EFIT_tree: MDS+ EFIT tree
:param EFIT_tree: MDSplus EFIT tree
"""
TDIs = {
'r': f'\\{EFIT_tree}::TOP.RESULTS.GEQDSK.RBBBS',
Expand Down Expand Up @@ -353,20 +353,20 @@ def mse_data(ods, pulse, MSE_revision="ANALYSIS", MSE_Er_correction=True):
Omega is +90 degrees for a radial sightline, assuming MSE port is on the outboard midplane
Omega is 180 degrees for a tangential sightline that is pointed toward -phi
NOTE: In this coordinate system, the omega = om_nstx + 180 degrees where om_nstx is the omega recorded in the MDS+ Tree
NOTE: In this coordinate system, the omega = om_nstx + 180 degrees where om_nstx is the omega recorded in the MDSplus Tree
**NOTE: The signs of the A1, A4, A5 and A7 coefficients are reversed compared to DIII-D to reflect the NSTX definition of omega
In NSTX, standard operation is BT<0 (CCW) and Ip>0 (CW) ... identical to standard DIII-D operation
Thus, Bpol>0 in theta dimension. Bz<0 at outboard midplane, Bz>0 at inboard midplane
Gamma is the pitch of the local electric field relative to the MSE sightline vector (sigma polization component)
GA EFIT assumes pitch angle (gamma) is the measured polarization angle
NSTX MSE data is saved on the MDS+ tree as the actual field pitch angle = (A2/A1)*tan(gamma)
The MSE data from MDS+ is multiplied by A1/A2 to convert the actual field pitch angle into the measured polization angle to be consistent with GA EFIT
NSTX MSE data is saved on the MDSplus tree as the actual field pitch angle = (A2/A1)*tan(gamma)
The MSE data from MDSplus is multiplied by A1/A2 to convert the actual field pitch angle into the measured polization angle to be consistent with GA EFIT
A2 and A1 are positive in the NSTX geometry
For a co-Ip beam (+phi) with CCW BT, EZ = vb x Bphi is positive (+Z), Ephi = vb x Bz is negative (-phi) at outboard midplane
Thus, on NSTX, with MSE sightline vectors pointing in -phi, postive R, gamma should be positive outboard of the magnetic axis
This is consistent with the tan_alpha recorded in MDS+
This is consistent with the tan_alpha recorded in MDSplus
The A coefficients modified from for the NSTX convention are A1>0, A2>0, A5>0 for alpha and omega between 0 and 90 degrees
At outboard midplane, BZ<0, Bphi<0, ER>0
Expand Down
6 changes: 3 additions & 3 deletions omas/machine_mappings/sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
"treename": "{EFIT_tree}"
},
"equilibrium.time_slice.:.global_quantities.ip": {
"COMMENT": "TDI functions to access MDS+",
"COMMENT": "TDI functions to access MDSplus",
"TDI": "data(\\{EFIT_tree}::TOP.RESULTS.GEQDSK.CPASMA)",
"treename": "{EFIT_tree}"
},
"equilibrium.time_slice.:.profiles_1d.psi": {
"COMMENT": "eval2TDI allows defining python functions can be evaluated on the MDS+ server side. These functions are defined in python_tdi.py",
"COMMENT": "eval2TDI allows defining python functions can be evaluated on the MDSplus server side. These functions are defined in python_tdi.py",
"eval2TDI": "py2tdi(geqdsk_psi,'\\{EFIT_tree}::TOP.RESULTS.GEQDSK.SSIMAG','\\{EFIT_tree}::TOP.RESULTS.GEQDSK.SSIBRY','\\{EFIT_tree}::TOP.RESULTS.GEQDSK.PSIN')",
"treename": "{EFIT_tree}"
}
}
}
2 changes: 1 addition & 1 deletion omas/machine_mappings/support_files/mast/0/signals.dat
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ P1LEVEL RL none 1 - c 0.000 0.00 0.00 n 1.00 1.0 1.0
;map indx: Used to index multiple map vars and two-dimensional signals
; - negative value: Interpolate FE data to MD position in time plots
; *** pending - negative value: Swap X and Y axes of MD data in profile plots
;MDS tree: Designation for MDS+ tree name from which to read signal. Using an
;MDS tree: Designation for MDSplus tree name from which to read signal. Using an
; identifier that is not in the DBsignaldesig.pro file (such as '-')
; will result in the code using the default tree name in maincontrol.dat
;Read sig?: y: read signal, n: skip signal, c: compute signal
Expand Down
2 changes: 1 addition & 1 deletion omas/machine_mappings/support_files/mast/40000/signals.dat
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ P1LEVEL RL none 1 - c 0.000 0.00 0.00 n 1.00 1.0 1.0
;map indx: Used to index multiple map vars and two-dimensional signals
; - negative value: Interpolate FE data to MD position in time plots
; *** pending - negative value: Swap X and Y axes of MD data in profile plots
;MDS tree: Designation for MDS+ tree name from which to read signal. Using an
;MDS tree: Designation for MDSplus tree name from which to read signal. Using an
; identifier that is not in the DBsignaldesig.pro file (such as '-')
; will result in the code using the default tree name in maincontrol.dat
;Read sig?: y: read signal, n: skip signal, c: compute signal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,26 +370,26 @@ MSCPA8 PA pabzz0 -8 E2 n 0.050 5.0e-3 1.0e-3 y 1.7453e-2 1.0 1.0
MSCPA9 PA pabzz0 -9 E2 n 0.050 5.0e-3 1.0e-3 y 1.7453e-2 1.0 1.0 1 0 \\PABZBTZ0 -
MSCPA10 PA pabzz0 -10 E2 n 0.050 5.0e-3 1.0e-3 y 1.7453e-2 1.0 1.0 1 0 \\PABZBTZ0 -
P1LEVEL RL none 1 - c 0.000 0.00 0.00 n 1.00 1.0 1.0 1 0 NONE - ; Process 1 run level at each time
;TRPT1 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDS+-TREE-PATH-GOES-HERE -
;TRPT2 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDS+-TREE-PATH-GOES-HERE -
;TRPT3 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDS+-TREE-PATH-GOES-HERE -
;TRPT4 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDS+-TREE-PATH-GOES-HERE -
;TRPT5 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDS+-TREE-PATH-GOES-HERE -
;TRPT6 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDS+-TREE-PATH-GOES-HERE -
;TRPT7 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDS+-TREE-PATH-GOES-HERE -
;TRPT8 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDS+-TREE-PATH-GOES-HERE -
;TRPT9 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDS+-TREE-PATH-GOES-HERE -
;TRPT10 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDS+-TREE-PATH-GOES-HERE -
;TRPT11 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDS+-TREE-PATH-GOES-HERE -
;TRPT12 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDS+-TREE-PATH-GOES-HERE -
;TRPT13 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDS+-TREE-PATH-GOES-HERE -
;TRPT14 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDS+-TREE-PATH-GOES-HERE -
;TRPT15 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDS+-TREE-PATH-GOES-HERE -
;TRPT16 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDS+-TREE-PATH-GOES-HERE -
;TRPT17 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDS+-TREE-PATH-GOES-HERE -
;TRPT18 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDS+-TREE-PATH-GOES-HERE -
;TRPT19 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDS+-TREE-PATH-GOES-HERE -
;TRPT20 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDS+-TREE-PATH-GOES-HERE -
;TRPT1 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDSplus-TREE-PATH-GOES-HERE -
;TRPT2 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDSplus-TREE-PATH-GOES-HERE -
;TRPT3 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDSplus-TREE-PATH-GOES-HERE -
;TRPT4 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDSplus-TREE-PATH-GOES-HERE -
;TRPT5 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDSplus-TREE-PATH-GOES-HERE -
;TRPT6 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDSplus-TREE-PATH-GOES-HERE -
;TRPT7 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDSplus-TREE-PATH-GOES-HERE -
;TRPT8 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDSplus-TREE-PATH-GOES-HERE -
;TRPT9 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDSplus-TREE-PATH-GOES-HERE -
;TRPT10 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDSplus-TREE-PATH-GOES-HERE -
;TRPT11 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDSplus-TREE-PATH-GOES-HERE -
;TRPT12 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDSplus-TREE-PATH-GOES-HERE -
;TRPT13 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDSplus-TREE-PATH-GOES-HERE -
;TRPT14 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDSplus-TREE-PATH-GOES-HERE -
;TRPT15 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDSplus-TREE-PATH-GOES-HERE -
;TRPT16 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDSplus-TREE-PATH-GOES-HERE -
;TRPT17 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDSplus-TREE-PATH-GOES-HERE -
;TRPT18 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDSplus-TREE-PATH-GOES-HERE -
;TRPT19 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDSplus-TREE-PATH-GOES-HERE -
;TRPT20 TP ptvsrz0 -3 - n 0.000 0.000 0.000 y 1.0 1.0 1.0 1 0 \\TRANSP-MDSplus-TREE-PATH-GOES-HERE -
;=====================================================================================================================================================================
; Stated errors
;--------------
Expand Down Expand Up @@ -430,7 +430,7 @@ P1LEVEL RL none 1 - c 0.000 0.00 0.00 n 1.00 1.0 1.0
;map indx: Used to index multiple map vars and two-dimensional signals
; - negative value: Interpolate FE data to MD position in time plots
; *** pending - negative value: Swap X and Y axes of MD data in profile plots
;MDS tree: Designation for MDS+ tree name from which to read signal
;MDS tree: Designation for MDSplus tree name from which to read signal
;Read sig?: y: read signal, n: skip signal, c: compute signal
; m: read multiple dimensional signal, p: process previous multi-dim signal
;Error rel: Relative error
Expand Down
Loading

0 comments on commit 70b82c8

Please sign in to comment.