Skip to content

Commit 0095602

Browse files
committed
Fixed numeric TCI channel indexing
1 parent 804605a commit 0095602

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

disruption_py/machine/cmod/thomson.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,9 @@ def _map_ts2tci(params: PhysicsMethodParams, nlnum):
244244
psits = CmodThomsonDensityMeasure._efit_rz2psi(params, rts, zts, nets_core_t)
245245
mtci = 101
246246
ztci = -0.4 + 0.8 * np.arange(0, mtci) / (mtci - 1)
247-
rtci = rtci[nlnum] + np.zeros((1, mtci))
247+
# There are 10 TCI channels like NL_01, NL_02, ..., NL_10
248+
# nlnum is 1-indexed to match the channel numbering, but we need to convert it to 0-indexed for array indexing
249+
rtci = rtci[nlnum-1] + np.zeros((1, mtci))
248250
psitci = CmodThomsonDensityMeasure._efit_rz2psi(params, rtci, ztci, nets_core_t)
249251
psia = interp1(psia_t, psia, nets_core_t)
250252
psi_0 = interp1(psia_t, psi_0, nets_core_t)

0 commit comments

Comments
 (0)