diff --git a/examples/plot_sorted_all.py b/examples/plot_sorted_all.py index 49eb63e212576f719b0690eb4c88fb4b9c2df5b8..dac04c8edc1daf180768e3cfee90f2c0184062c0 100644 --- a/examples/plot_sorted_all.py +++ b/examples/plot_sorted_all.py @@ -34,9 +34,7 @@ rc('font', family='serif') import sys import os -print "Plotting..." - - +plot_limit = 0.02 # Read Quickshed accelerations data=loadtxt( "interaction_dump_all.dat" ) @@ -93,31 +91,22 @@ stdz_s = std(errz_s[abs(errz_s) < 0.1]) figure(frameon=True) subplot(311, title="Acceleration along X") -#plot(id[abs(errx_s) > 0.001], e_errx_s , 'ro') plot(pos_x, e_errx_bh , 'bx', label='B-H') plot(pos_x, e_errx_s , 'ro') -#text( 0., 0.1, "axis=( %d %d %d )"%(axis[orientation*3 + 0], axis[orientation*3 + 1], axis[orientation*3 + 2]) , ha='center', backgroundcolor='w', fontsize=14) -ylim(-0.1, 0.1) +ylim(-plot_limit, plot_limit) grid() subplot(312, title="Acceleration along Y") -#plot(id[abs(erry_s) > 0.001], e_erry_s , 'ro') -plot(pos_x, e_erry_bh , 'bx', label='B-H') +plot(pos_y, e_erry_bh , 'bx', label='B-H') plot(pos_y, e_erry_s , 'ro') -#text( 0., 0.1, "axis=( %d %d %d )"%(axis[orientation*3 + 0], axis[orientation*3 + 1], axis[orientation*3 + 2]) , ha='center', backgroundcolor='w', fontsize=14) -ylim(-0.1, 0.1) +ylim(-plot_limit, plot_limit) grid() subplot(313, title="Acceleration along Z") -#plot(id[abs(errz_s) > 0.001], e_errz_s , 'ro', label="Sorted") -plot(pos_x, e_errz_bh , 'bx', label='B-H') +plot(pos_z, e_errz_bh , 'bx', label='B-H') plot(pos_z, e_errz_s , 'ro', label="Sorted") -#text( 0., 0.1, "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") - -ylim(-0.1, 0.1) -#xlim(0, size(id)-1) +ylim(-plot_limit, plot_limit) grid() savefig("accelerations_relative_all.png") @@ -128,34 +117,21 @@ close() figure(frameon=True) subplot(311, title="Acceleration along X") -#plot(id[abs(errx_s) > 0.001], e_errx_s , 'ro') plot(pos_x, accx_bh, 'bx') plot(pos_x, accx_s , 'ro') -#text( 0., 0.1, "axis=( %d %d %d )"%(axis[orientation*3 + 0], axis[orientation*3 + 1], axis[orientation*3 + 2]) , ha='center', backgroundcolor='w', fontsize=14) ylim(-250, 250) grid() subplot(312, title="Acceleration along Y") -#plot(id[abs(erry_s) > 0.001], e_erry_s , 'ro') -#plot(pos_y, accy_u , 'gs') plot(pos_y, accy_s , 'ro') -plot(pos_y, accz_bh , 'bx', label="B-H") -#text( 0., 0.1, "axis=( %d %d %d )"%(axis[orientation*3 + 0], axis[orientation*3 + 1], axis[orientation*3 + 2]) , ha='center', backgroundcolor='w', fontsize=14) -#ylim(-70, 70) +plot(pos_y, accy_bh , 'bx', label="B-H") ylim(-250, 250) grid() subplot(313, title="Acceleration along Z") -#plot(id[abs(errz_s) > 0.001], e_errz_s , 'ro', label="Sorted") plot(pos_z, accz_bh , 'bx', label="B-H") plot(pos_z, accz_s , 'ro', label="Sorted") -#plot(pos_z, accz_u , 'gs', label="Unsorted") - -#text( 0., 0.1, "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") - -#ylim(-70, 70) ylim(-250, 250) grid() @@ -215,12 +191,8 @@ close() print "E_error for sorted: ( x= %4.3e"%std(e_errx_s), "y= %4.3e"%std(e_erry_s), "z= %4.3e"%std(e_errz_s), ") Combined YZ = %4.3e"%(( std(e_erry_s) + std(e_errz_s) )/2.) +print "E_error for BH : ( x= %4.3e"%std(e_errx_bh), "y= %4.3e"%std(e_erry_bh), "z= %4.3e"%std(e_errz_bh), ") Combined YZ = %4.3e"%(( std(e_erry_bh) + std(e_errz_bh) )/2.) - #print std(e_errx_s), std(e_erry_s), std(e_errz_s) - - - #print "Min for sorted: ( x= %4.3e"%min(errx_s), "y= %4.3e"%min(erry_s), "z= %4.3e"%min(errz_s), ") Combined YZ = %4.3e"%(min( min(erry_s), min(errz_s) )) - #print "Max for sorted: ( x= %4.3e"%max(errx_s), "y= %4.3e"%max(erry_s), "z= %4.3e"%max(errz_s), ") Combined YZ = %4.3e"%(max( max(erry_s), max(errz_s) ))