Skip to content

Commit 05d714f

Browse files
committed
x_points() and strike_points() of pulse schedule
1 parent 57db778 commit 05d714f

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/physics/boundary.jl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,10 @@ function x_points(x_points::IMAS.IDSvector{<:IMAS.pulse_schedule__position_contr
309309
x_points0 = Tuple{T,T}[]
310310
for x_point in x_points
311311
Rx = get_time_array(x_point.r, :reference, time0)
312-
Zx = get_time_array(x_point.z, :reference, time0)
313-
push!(x_points0, (Rx, Zx))
312+
if Rx > 0.0 # discard NaN and points with Rx==0
313+
Zx = get_time_array(x_point.z, :reference, time0)
314+
push!(x_points0, (Rx, Zx))
315+
end
314316
end
315317
return x_points0
316318
end
@@ -325,10 +327,12 @@ Beturns vector with tuples of R,Z coordinates of x-points in pulse_schedule at t
325327
"""
326328
function strike_points(strike_points::IMAS.IDSvector{<:IMAS.pulse_schedule__position_control__strike_point{T}}; time0::Float64=global_time(strike_points)) where {T<:Real}
327329
strike_points0 = Tuple{T,T}[]
328-
for x_point in strike_points
329-
Rxx = get_time_array(x_point.r, :reference, time0)
330-
Zxx = get_time_array(x_point.z, :reference, time0)
331-
push!(strike_points0, (Rxx, Zxx))
330+
for strike_point in strike_points
331+
Rs = get_time_array(strike_point.r, :reference, time0)
332+
if Rs > 0.0 # discard NaN and points with Rx==0
333+
Zs = get_time_array(strike_point.z, :reference, time0)
334+
push!(strike_points0, (Rs, Zs))
335+
end
332336
end
333337
return strike_points0
334338
end

src/plot.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2791,15 +2791,15 @@ end
27912791
markerstrokewidth --> 0
27922792
primary := false
27932793
Xs = x_points(pc.x_point; time0)
2794-
[x[1] for x in Xs if x[1] != 0.0], [x[2] for x in Xs if x[1] != 0.0]
2794+
[x[1] for x in Xs], [x[2] for x in Xs]
27952795
end
27962796
@series begin
27972797
seriestype := :scatter
27982798
marker --> :circle
27992799
markerstrokewidth --> 0
28002800
primary := false
28012801
Ss = strike_points(pc.strike_point; time0)
2802-
[x[1] for x in Ss if x[1] != 0.0], [x[2] for x in Ss if x[1] != 0.0]
2802+
[x[1] for x in Ss], [x[2] for x in Ss]
28032803
end
28042804
if !ismissing(pc.magnetic_axis.r, :reference) && !ismissing(pc.magnetic_axis.z, :reference)
28052805
@series begin

0 commit comments

Comments
 (0)