aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2024-02-27 17:10:14 +0100
committerThomas White <taw@physics.org>2024-02-27 17:10:14 +0100
commit515bf55242c379f5ba4c0c6d15899e573ea08378 (patch)
tree010021426cf2b0840f9860194f7bdd6f9e82ca5e
parentda9794d5775ca3af9bde78da830eaba5d71ffe2b (diff)
alignment_test.jl: Break plotting routine into 3
-rw-r--r--julia/alignment-test.jl47
1 files 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