diff --git a/examples/plot_sorted.py b/examples/plot_sorted.py index 4f7abfae1899a3fd10036f82efb849ce0c7fa128..e76f338b56d3897d547599f0a23c4fc2fa6e9767 100644 --- a/examples/plot_sorted.py +++ b/examples/plot_sorted.py @@ -35,7 +35,9 @@ import sys import os from scipy import stats -dist_cutoff_ratio=1.2 +dist_cutoff_ratio=1.5 +dist_max = 0.5 +plot_range = 0.01 print "Plotting..." @@ -69,6 +71,9 @@ axis = [ ] +# Compute correctness limit +limit_exact = ( dist_cutoff_ratio - 1. ) + #names = ["side", "edge", "corner"] #for orientation in range( 26 ): @@ -152,31 +157,30 @@ for jjj in range(3): 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') - plot([-dist_cutoff_ratio/2., -dist_cutoff_ratio/2.], [-0.01, 0.01], 'k--') - plot([dist_cutoff_ratio/2., dist_cutoff_ratio/2.], [-0.01, 0.01], 'k--') + 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([-limit_exact, -limit_exact], [-plot_range, plot_range], '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) xlim(-1.2*max(abs(pos)), 1.2*max(abs(pos))) - ylim(-0.03, 0.03) + ylim(-plot_range, plot_range) grid() 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') - plot([-dist_cutoff_ratio/2., -dist_cutoff_ratio/2.], [-0.03, 0.03], 'k--') - plot([dist_cutoff_ratio/2., dist_cutoff_ratio/2.], [-0.03, 0.03], 'k--') + 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([-limit_exact, -limit_exact], [-plot_range, plot_range], '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) xlim(-1.2*max(abs(pos)), 1.2*max(abs(pos))) - ylim(-0.03, 0.03) + ylim(-plot_range, plot_range) grid() 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') - plot([-dist_cutoff_ratio/2., -dist_cutoff_ratio/2.], [-0.03, 0.03], 'k--') - plot([dist_cutoff_ratio/2., dist_cutoff_ratio/2.], [-0.03, 0.03], 'k--') + 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([-limit_exact, -limit_exact], [-plot_range, plot_range], '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) - #legend(loc="upper right") xlim(-1.2*max(abs(pos)), 1.2*max(abs(pos))) - ylim(-0.03, 0.03) + ylim(-plot_range, plot_range) grid() savefig("quadrupole_accelerations_relative_%d.png"%orientation) @@ -250,7 +254,7 @@ for jjj in range(3): # # 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_erry_s = erry_s[(abs(erry_s) >= 0.000) & (abs(erry_s) < 1.)]