From 515bf55242c379f5ba4c0c6d15899e573ea08378 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 27 Feb 2024 17:10:14 +0100 Subject: alignment_test.jl: Break plotting routine into 3 --- julia/alignment-test.jl | 47 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/julia/alignment-test.jl b/julia/alignment-test.jl index adaf399e..43a22a23 100644 --- a/julia/alignment-test.jl +++ b/julia/alignment-test.jl @@ -67,26 +67,45 @@ let mille = Mille("mille.dat") end -function plotresiduals(filename) +function ploth(a, n, offs, label) + histogram(map(x->x.residual,filter(x->in(n, keys(x.globalgradients)), a[offs:3:end])), label=label) +end + + +function plotfs(filename) t = loadmille(filename) l = @layout([q0 q1; q2 q3]) a = collect(Iterators.flatten(t)) - function ploth(n, offs, label) - histogram(map(x->x.residual,filter(x->in(n, keys(x.globalgradients)), a[offs:3:end])), label=label) - end - - q0 = ploth(101, 1, "q0") - q1 = ploth(201, 1, "q1") - q2 = ploth(301, 1, "q2") - q3 = ploth(401, 1, "q3") + q0 = ploth(a, 101, 1, "q0") + q1 = ploth(a, 201, 1, "q1") + q2 = ploth(a, 301, 1, "q2") + q3 = ploth(a, 401, 1, "q3") plot(q0, q1, q2, q3, layout=l, plot_title="Fast scan residual") - #q0 = ploth(102, 2, "q0") - #q1 = ploth(202, 2, "q1") - #q2 = ploth(302, 2, "q2") - #q3 = ploth(402, 2, "q3") - #plot(q0, q1, q2, q3, layout=l, plot_title="Slow scan residual", reuse=false) +end + + +function plotss(filename) + t = loadmille(filename) + l = @layout([q0 q1; q2 q3]) + a = collect(Iterators.flatten(t)) + + q0 = ploth(a, 102, 2, "q0") + q1 = ploth(a, 202, 2, "q1") + q2 = ploth(a, 302, 2, "q2") + q3 = ploth(a, 402, 2, "q3") + plot(q0, q1, q2, q3, layout=l, plot_title="Slow scan residual") + +end + + +function plotr(filename) + t = loadmille(filename) + l = @layout([q0 q1; q2 q3]) + a = collect(Iterators.flatten(t)) + meas = histogram(map(x->x.residual, a[3:3:end])) + plot(meas, plot_title="Excitation error residual") end -- cgit v1.2.3