Skip to content
Snippets Groups Projects
Commit 838dc16d authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Modified the plotting script to better analyse the bias

parent 844d116a
No related branches found
No related tags found
No related merge requests found
...@@ -35,7 +35,9 @@ import sys ...@@ -35,7 +35,9 @@ import sys
import os import os
from scipy import stats from scipy import stats
dist_cutoff_ratio=1.2 dist_cutoff_ratio=1.5
dist_max = 0.5
plot_range = 0.01
print "Plotting..." print "Plotting..."
...@@ -69,6 +71,9 @@ axis = [ ...@@ -69,6 +71,9 @@ axis = [
] ]
# Compute correctness limit
limit_exact = ( dist_cutoff_ratio - 1. )
#names = ["side", "edge", "corner"] #names = ["side", "edge", "corner"]
#for orientation in range( 26 ): #for orientation in range( 26 ):
...@@ -152,31 +157,30 @@ for jjj in range(3): ...@@ -152,31 +157,30 @@ for jjj in range(3):
subplot(311, title="Acceleration along X") subplot(311, title="Acceleration along X")
scatter(pos[dist<1.], e_errx_s[dist<1.] ,c=dist[dist<1.], marker='o', s=1, linewidth=0, cmap='jet') scatter(pos[dist<dist_max], e_errx_s[dist<dist_max] ,c=dist[dist<dist_max], marker='o', s=1, linewidth=0, cmap='jet')
plot([-dist_cutoff_ratio/2., -dist_cutoff_ratio/2.], [-0.01, 0.01], 'k--') plot([-limit_exact, -limit_exact], [-plot_range, plot_range], 'k--')
plot([dist_cutoff_ratio/2., dist_cutoff_ratio/2.], [-0.01, 0.01], 'k--') plot([limit_exact, limit_exact], [-plot_range, plot_range], 'k--')
text( 0., 0.005, "axis=( %d %d %d )"%(axis[orientation*3 + 0], axis[orientation*3 + 1], axis[orientation*3 + 2]) , ha='center', backgroundcolor='w', fontsize=14) text( 0., 0.005, "axis=( %d %d %d )"%(axis[orientation*3 + 0], axis[orientation*3 + 1], axis[orientation*3 + 2]) , ha='center', backgroundcolor='w', fontsize=14)
xlim(-1.2*max(abs(pos)), 1.2*max(abs(pos))) xlim(-1.2*max(abs(pos)), 1.2*max(abs(pos)))
ylim(-0.03, 0.03) ylim(-plot_range, plot_range)
grid() grid()
subplot(312, title="Acceleration along Y") subplot(312, title="Acceleration along Y")
scatter(pos[dist<1.], e_erry_s[dist<1.] , c=dist[dist<1.], marker='o', s=1, linewidth=0, cmap='jet') scatter(pos[dist<dist_max], e_erry_s[dist<dist_max] , c=dist[dist<dist_max], marker='o', s=1, linewidth=0, cmap='jet')
plot([-dist_cutoff_ratio/2., -dist_cutoff_ratio/2.], [-0.03, 0.03], 'k--') plot([-limit_exact, -limit_exact], [-plot_range, plot_range], 'k--')
plot([dist_cutoff_ratio/2., dist_cutoff_ratio/2.], [-0.03, 0.03], 'k--') plot([limit_exact, limit_exact], [-plot_range, plot_range], 'k--')
text( 0., 0.005, "axis=( %d %d %d )"%(axis[orientation*3 + 0], axis[orientation*3 + 1], axis[orientation*3 + 2]) , ha='center', backgroundcolor='w', fontsize=14) text( 0., 0.005, "axis=( %d %d %d )"%(axis[orientation*3 + 0], axis[orientation*3 + 1], axis[orientation*3 + 2]) , ha='center', backgroundcolor='w', fontsize=14)
xlim(-1.2*max(abs(pos)), 1.2*max(abs(pos))) xlim(-1.2*max(abs(pos)), 1.2*max(abs(pos)))
ylim(-0.03, 0.03) ylim(-plot_range, plot_range)
grid() grid()
subplot(313, title="Acceleration along Z") subplot(313, title="Acceleration along Z")
scatter(pos[dist<1.], e_errz_s[dist<1.] , c=dist[dist<1.], label="Sorted", marker='o', s=1, linewidth=0, cmap='jet') scatter(pos[dist<dist_max], e_errz_s[dist<dist_max] , c=dist[dist<dist_max], label="Sorted", marker='o', s=1, linewidth=0, cmap='jet')
plot([-dist_cutoff_ratio/2., -dist_cutoff_ratio/2.], [-0.03, 0.03], 'k--') plot([-limit_exact, -limit_exact], [-plot_range, plot_range], 'k--')
plot([dist_cutoff_ratio/2., dist_cutoff_ratio/2.], [-0.03, 0.03], 'k--') plot([limit_exact, limit_exact], [-plot_range, plot_range], 'k--')
text( 0., 0.005, "axis=( %d %d %d )"%(axis[orientation*3 + 0], axis[orientation*3 + 1], axis[orientation*3 + 2]) , ha='center', backgroundcolor='w', fontsize=14) text( 0., 0.005, "axis=( %d %d %d )"%(axis[orientation*3 + 0], axis[orientation*3 + 1], axis[orientation*3 + 2]) , ha='center', backgroundcolor='w', fontsize=14)
#legend(loc="upper right")
xlim(-1.2*max(abs(pos)), 1.2*max(abs(pos))) xlim(-1.2*max(abs(pos)), 1.2*max(abs(pos)))
ylim(-0.03, 0.03) ylim(-plot_range, plot_range)
grid() grid()
savefig("quadrupole_accelerations_relative_%d.png"%orientation) savefig("quadrupole_accelerations_relative_%d.png"%orientation)
...@@ -250,7 +254,7 @@ for jjj in range(3): ...@@ -250,7 +254,7 @@ for jjj in range(3):
# # Plot ------------------------------------------------------- # # Plot -------------------------------------------------------
# bins = linspace(-3, 3, 10000) bins = linspace(-3, 3, 10000)
# e_errx_s = errx_s[(abs(errx_s) >= 0.000) & (abs(errx_s) < 1.)] # e_errx_s = errx_s[(abs(errx_s) >= 0.000) & (abs(errx_s) < 1.)]
# e_erry_s = erry_s[(abs(erry_s) >= 0.000) & (abs(erry_s) < 1.)] # e_erry_s = erry_s[(abs(erry_s) >= 0.000) & (abs(erry_s) < 1.)]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment