Revisión | 9c25f3895466837d55cf2f13aefe813063fd1df7 (tree) |
---|---|
Tiempo | 2008-01-29 19:22:18 |
Autor | iselllo |
Commiter | iselllo |
I corrected a bug in plot_statistics.py: y_pos2 and z_pos2 were defined
in terms of x_arr instead of y_arr and z_arr respectively!
@@ -107,10 +107,6 @@ | ||
107 | 107 | |
108 | 108 | print "the length of tot_config is, ", len(tot_config) |
109 | 109 | tot_config=s.reshape(tot_config,(n_config,3*n_part)) |
110 | -# #I swap two columns as a test: | |
111 | -# tot_config[:,[0,3]]=tot_config[:,[3,0]] | |
112 | -# tot_config[:,[1,4]]=tot_config[:,[4,1]] | |
113 | -# tot_config[:,[2,5]]=tot_config[:,[5,2]] | |
114 | 110 | |
115 | 111 | # print "tot_config at line 10 is, ", tot_config[10,:] |
116 | 112 |
@@ -771,56 +767,6 @@ | ||
771 | 767 | radius=s.sqrt(var_x_arr+var_y_arr+var_z_arr) |
772 | 768 | return radius |
773 | 769 | |
774 | -# def calc_radius2(x_arr,y_arr,z_arr,Len): | |
775 | -# #here x_arr is one-dimensional corresponding to a single configuration | |
776 | -# r_0j=s.zeros((len(x_arr)-1)) | |
777 | -# for j in xrange(1,len(x_arr)): #so, particle zero is now the reference particle | |
778 | -# r_0j[j-1]=x_arr[0]-x_arr[j] | |
779 | -# r_0j[j-1]=-(r_0j[j-1]-Len*n.round(r_0j[j-1]/Len)) | |
780 | -# #r_ij[count_int]=-r_ij[count_int] #I have better reverse the signs now. | |
781 | -# #print 'i and j are, ', (i+1), (j+1) | |
782 | - | |
783 | - | |
784 | -# #Now I re-define the x_arr in order to be able to take tha variance correctly | |
785 | -# x_arr[0]=0. | |
786 | -# x_arr[1:n_part]=r_0j | |
787 | - | |
788 | -# #var_x_arr[:]=s.var(r_0j, axis=1) | |
789 | -# var_x_arr=s.var(x_arr) | |
790 | - | |
791 | -# for j in xrange(1,len(y_arr)): #so, particle zero is now the reference particle | |
792 | -# r_0j[j-1]=y_arr[0]-y_arr[j] | |
793 | -# r_0j[j-1]=-(r_0j[j-1]-Len*n.round(r_0j[j-1]/Len)) | |
794 | -# #r_ij[count_int]=-r_ij[count_int] #I have better reverse the signs now. | |
795 | -# #print 'i and j are, ', (i+1), (j+1) | |
796 | - | |
797 | - | |
798 | -# #Now I re-define the x_arr in order to be able to take tha variance correctly | |
799 | -# y_arr[0]=0. | |
800 | -# y_arr[1:n_part]=r_0j | |
801 | - | |
802 | -# #var_x_arr[:]=s.var(r_0j, axis=1) | |
803 | -# var_y_arr=s.var(y_arr) | |
804 | - | |
805 | - | |
806 | - | |
807 | -# for j in xrange(1,len(z_arr)): #so, particle zero is now the reference particle | |
808 | -# r_0j[j-1]=z_arr[0]-z_arr[j] | |
809 | -# r_0j[j-1]=-(r_0j[j-1]-Len*n.round(r_0j[j-1]/Len)) | |
810 | -# #r_ij[count_int]=-r_ij[count_int] #I have better reverse the signs now. | |
811 | -# #print 'i and j are, ', (i+1), (j+1) | |
812 | - | |
813 | - | |
814 | -# #Now I re-define the x_arr in order to be able to take tha variance correctly | |
815 | -# z_arr[0]=0. | |
816 | -# z_arr[1:n_part]=r_0j | |
817 | - | |
818 | -# #var_x_arr[:]=s.var(r_0j, axis=1) | |
819 | -# var_z_arr=s.var(z_arr) | |
820 | - | |
821 | -# my_dist=s.sqrt(x_arr**2.+y_arr**2.+z_arr**2.) | |
822 | -# return my_dist | |
823 | - | |
824 | 770 | |
825 | 771 | |
826 | 772 |
@@ -838,7 +784,6 @@ | ||
838 | 784 | for i in xrange(0,n_config): |
839 | 785 | test_arr=tot_config[i,:] |
840 | 786 | test_arr=s.reshape(test_arr,(n_part,3)) |
841 | - | |
842 | 787 | # if (i==14): |
843 | 788 | # p.save("test_14.dat",test_arr) |
844 | 789 | #dist_mat=r.distance(test_arr) |
@@ -846,11 +791,10 @@ | ||
846 | 791 | y_pos=y_arr[i,:] |
847 | 792 | z_pos=z_arr[i,:] |
848 | 793 | dist_mat=d_calc.distance_calc(x_pos,y_pos,z_pos, box_size) |
849 | -# if (i==10): | |
850 | -# p.save("distance_matrix_10.dat",dist_mat) | |
794 | +# if (i==71): | |
795 | +# p.save("distance_matrix_71.dat",dist_mat) | |
851 | 796 | # p.save("x_pos_71.dat",x_pos) |
852 | -# dist_save=calc_radius2(x_pos,y_pos,z_pos,box_size) | |
853 | -# p.save("distances_from_reference_10.dat",dist_save) | |
797 | + | |
854 | 798 | |
855 | 799 | |
856 | 800 | clust_struc= (r.mycluster2(dist_mat,threshold)) #a cumbersome |
@@ -876,7 +820,6 @@ | ||
876 | 820 | cluster_name="hist_number_cluster%05d"%my_selection[i] |
877 | 821 | p.savefig(cluster_name) |
878 | 822 | p.hold(False) |
879 | - p.clf() | |
880 | 823 | |
881 | 824 | #Now I re-organize the particles in my configuration |
882 | 825 | #by putting together those which are in the same |
@@ -886,16 +829,13 @@ | ||
886 | 829 | r_gyr_dist=s.zeros(len(my_cluster)) #this will contain the distribution of |
887 | 830 | #the calculated radia of gyration |
888 | 831 | |
889 | - #dist_save=s.zeros(len(my_cluster)) | |
890 | - | |
891 | - | |
892 | 832 | my_sum=s.cumsum(my_cluster) |
893 | 833 | f=s.arange(1) #simply 0 but as an array! |
894 | 834 | my_lim=s.concatenate((f,my_sum)) |
895 | 835 | for m in xrange(0,len(my_cluster)): |
896 | 836 | x_pos2=x_arr[i,part_in_clust[my_lim[m]:my_lim[m+1]]] |
897 | - y_pos2=x_arr[i,part_in_clust[my_lim[m]:my_lim[m+1]]] | |
898 | - z_pos2=x_arr[i,part_in_clust[my_lim[m]:my_lim[m+1]]] | |
837 | + y_pos2=y_arr[i,part_in_clust[my_lim[m]:my_lim[m+1]]] | |
838 | + z_pos2=z_arr[i,part_in_clust[my_lim[m]:my_lim[m+1]]] | |
899 | 839 | r_gyr_dist[m]=calc_radius(x_pos2,y_pos2,z_pos2,box_size) |
900 | 840 | |
901 | 841 |
@@ -906,7 +846,7 @@ | ||
906 | 846 | cluster_name="hist_radius_gyration%05d"%my_selection[i] |
907 | 847 | p.savefig(cluster_name) |
908 | 848 | p.hold(False) |
909 | - p.clf() | |
849 | + | |
910 | 850 | # print 'the evolution of the number of clusters is, ', n_clusters |
911 | 851 | |
912 | 852 | p.save("number_cluster.dat",n_clusters) |
@@ -919,7 +859,7 @@ | ||
919 | 859 | p.grid(True) |
920 | 860 | p.savefig('number_clusters_vs_time.pdf') |
921 | 861 | p.hold(False) |
922 | - p.clf() | |
862 | + | |
923 | 863 | |
924 | 864 | # p.plot(time, min_dist,linewidth=2.) |
925 | 865 | # p.xlabel('time') |