Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions disruption_py/machine/cmod/efit.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,12 @@ def efit_check(params: PhysicsMethodParams):
values = [
params.mds_conn.get(expr, tree_name="analysis")
for expr in [
r"_lf=\analysis::efit_aeqdsk:lflag",
r"_lf=\efit_aeqdsk:lflag",
r"_l0=((sum(_lf,1) - _lf[*,20] - _lf[*,1])==0)",
r"_n=\analysis::efit_fitout:nitera,(_l0 and (_n>4))",
r"_n=\efit_fitout:nitera,(_l0 and (_n>4))",
]
]
_n = values[2].data()
valid_indices = np.nonzero(_n)
(times,) = params.mds_conn.get_dims(
r"\analysis::efit_aeqdsk:lflag", tree_name="analysis"
)
(times,) = params.mds_conn.get_dims(r"\efit_aeqdsk:lflag", tree_name="analysis")
return valid_indices, times[valid_indices]
17 changes: 9 additions & 8 deletions disruption_py/machine/cmod/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ def get_z_parameters(params: PhysicsMethodParams):
end = pcstime[-1]
else:
end = active_wire_segments[i + 1][1]
# DPCS refers to PCS so we need to open the common ancestor tree, HYBRID
z_factor = params.mds_conn.get_data(
rf"\dpcs::top.seg_{i + 1:02d}:p_{z_wire_index:02d}:predictor:factor",
tree_name="hybrid",
Expand All @@ -453,10 +454,10 @@ def get_z_parameters(params: PhysicsMethodParams):
# TODO: Try to fix this
if params.shot_id > 1150101000:
ip_without_factor = params.mds_conn.get_data(
r"\hybrid::top.hardware.dpcs.signals.a_in:input_056", tree_name="hybrid"
r"\top.hardware.dpcs.signals.a_in:input_056", tree_name="hybrid"
)
ip_factor = params.mds_conn.get_data(
r"\hybrid::top.dpcs_config.inputs:input_056:p_to_v_expr",
r"\top.dpcs_config.inputs:input_056:p_to_v_expr",
tree_name="hybrid",
)
ip = ip_without_factor * ip_factor # [A]
Expand Down Expand Up @@ -1874,16 +1875,16 @@ def get_prad_peaking(params: PhysicsMethodParams):
got_axa = False
try:
bright_axa, t_axa, r_axa = params.mds_conn.get_data_with_dims(
r"\SPECTROSCOPY::TOP.BOLOMETER.RESULTS.DIODE.AXA:BRIGHT",
r"\TOP.BOLOMETER.RESULTS.DIODE.AXA:BRIGHT",
tree_name="spectroscopy",
dim_nums=[1, 0],
) # [W/m^2], [s], [m]
z_axa = params.mds_conn.get_data(
r"\SPECTROSCOPY::TOP.BOLOMETER.DIODE_CALIB.AXA:Z_O",
r"\TOP.BOLOMETER.DIODE_CALIB.AXA:Z_O",
tree_name="spectroscopy",
) # [m]
good_axa = params.mds_conn.get_data(
r"\SPECTROSCOPY::TOP.BOLOMETER.DIODE_CALIB.AXA:GOOD",
r"\TOP.BOLOMETER.DIODE_CALIB.AXA:GOOD",
tree_name="spectroscopy",
) # [index]
got_axa = True
Expand All @@ -1892,16 +1893,16 @@ def get_prad_peaking(params: PhysicsMethodParams):
got_axj = False
try:
bright_axj, t_axj, r_axj = params.mds_conn.get_data_with_dims(
r"\SPECTROSCOPY::TOP.BOLOMETER.RESULTS.DIODE.AXJ:BRIGHT",
r"\TOP.BOLOMETER.RESULTS.DIODE.AXJ:BRIGHT",
tree_name="spectroscopy",
dim_nums=[1, 0],
) # [W/m^2], [s], [m]
z_axj = params.mds_conn.get_data(
r"\SPECTROSCOPY::TOP.BOLOMETER.DIODE_CALIB.AXJ:Z_O",
r"\TOP.BOLOMETER.DIODE_CALIB.AXJ:Z_O",
tree_name="spectroscopy",
) # [m]
good_axj = params.mds_conn.get_data(
r"\SPECTROSCOPY::TOP.BOLOMETER.DIODE_CALIB.AXJ:GOOD",
r"\TOP.BOLOMETER.DIODE_CALIB.AXJ:GOOD",
tree_name="spectroscopy",
) # [index]
got_axj = True
Expand Down
4 changes: 2 additions & 2 deletions disruption_py/machine/d3d/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def get_power_parameters(params: PhysicsMethodParams):
# Get neutral beam injected power
try:
p_nbi, t_nbi = params.mds_conn.get_data_with_dims(
r"\d3d::top.nb:pinj", tree_name="d3d"
r"\top.nb:pinj", tree_name="d3d"
)
t_nbi /= 1e3 # [ms] -> [s]
p_nbi *= 1e3 # [KW] -> [W]
Expand Down Expand Up @@ -1116,7 +1116,7 @@ def get_zeff_parameters(params: PhysicsMethodParams):
"""
# Get Zeff
zeff, t_zeff = params.mds_conn.get_data_with_dims(
r"\d3d::top.spectroscopy.vb.zeff:zeff", tree_name="d3d"
r"\top.spectroscopy.vb.zeff:zeff", tree_name="d3d"
)
t_zeff = t_zeff / 1.0e3 # [ms] -> [s]
if len(t_zeff) > 2:
Expand Down
12 changes: 6 additions & 6 deletions disruption_py/settings/time_setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,20 +233,20 @@ def cmod_times(self, params: TimeSettingParams):
if efit_tree_name == "analysis":
try:
return params.mds_conn.get_data(
r"\analysis::efit_aeqdsk:time",
tree_name="_efit_tree",
r"\efit_aeqdsk:time",
tree_name=efit_tree_name,
astype="float64",
)
except mdsExceptions.MdsException:
return params.mds_conn.get_data(
r"\analysis::efit:results:a_eqdsk:time",
tree_name="_efit_tree",
r"\efit:results:a_eqdsk:time",
tree_name=efit_tree_name,
astype="float64",
)
else:
return params.mds_conn.get_data(
rf"\{efit_tree_name}::top.results.a_eqdsk:time",
tree_name="_efit_tree",
r"\top.results.a_eqdsk:time",
tree_name=efit_tree_name,
astype="float64",
)

Expand Down