Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve units of coil currents #94

Merged
merged 1 commit into from
Oct 11, 2023
Merged
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
11 changes: 10 additions & 1 deletion src/plot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,23 @@ NOTE: Current plots are for the total current flowing in the coil (ie. it is mul
else
index = 1:length(pfa.coil[1].current.time)
end

currents = [get_time_array(c.current, :data, time0) * c.element[1].turns_with_sign for c in pfa.coil]

CURRENT = maximum((maximum(abs, c.current.data[index] * c.element[1].turns_with_sign) for c in pfa.coil))
if maximum(currents) > 1e6
currents = currents ./ 1e6
CURRENT = CURRENT ./ 1e6
c_unit = "MA"
else
c_unit = "A"
end
end

if what ∈ (:cx, :coils_flux)
label --> ""
aspect --> :equal
colorbar_title --> "PF currents [A]"
colorbar_title --> "PF currents [$c_unit]"

# dummy markers to get the colorbar right
if any(currents .!= 0.0)
Expand Down
Loading