• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisión9c25f3895466837d55cf2f13aefe813063fd1df7 (tree)
Tiempo2008-01-29 19:22:18
Autoriselllo
Commiteriselllo

Log Message

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!

Cambiar Resumen

Diferencia incremental

diff -r 143021913bb3 -r 9c25f3895466 Python-codes/plot_statistics.py
--- a/Python-codes/plot_statistics.py Tue Jan 22 14:22:55 2008 +0000
+++ b/Python-codes/plot_statistics.py Tue Jan 29 10:22:18 2008 +0000
@@ -107,10 +107,6 @@
107107
108108 print "the length of tot_config is, ", len(tot_config)
109109 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]]
114110
115111 # print "tot_config at line 10 is, ", tot_config[10,:]
116112
@@ -771,56 +767,6 @@
771767 radius=s.sqrt(var_x_arr+var_y_arr+var_z_arr)
772768 return radius
773769
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-
824770
825771
826772
@@ -838,7 +784,6 @@
838784 for i in xrange(0,n_config):
839785 test_arr=tot_config[i,:]
840786 test_arr=s.reshape(test_arr,(n_part,3))
841-
842787 # if (i==14):
843788 # p.save("test_14.dat",test_arr)
844789 #dist_mat=r.distance(test_arr)
@@ -846,11 +791,10 @@
846791 y_pos=y_arr[i,:]
847792 z_pos=z_arr[i,:]
848793 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)
851796 # 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+
854798
855799
856800 clust_struc= (r.mycluster2(dist_mat,threshold)) #a cumbersome
@@ -876,7 +820,6 @@
876820 cluster_name="hist_number_cluster%05d"%my_selection[i]
877821 p.savefig(cluster_name)
878822 p.hold(False)
879- p.clf()
880823
881824 #Now I re-organize the particles in my configuration
882825 #by putting together those which are in the same
@@ -886,16 +829,13 @@
886829 r_gyr_dist=s.zeros(len(my_cluster)) #this will contain the distribution of
887830 #the calculated radia of gyration
888831
889- #dist_save=s.zeros(len(my_cluster))
890-
891-
892832 my_sum=s.cumsum(my_cluster)
893833 f=s.arange(1) #simply 0 but as an array!
894834 my_lim=s.concatenate((f,my_sum))
895835 for m in xrange(0,len(my_cluster)):
896836 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]]]
899839 r_gyr_dist[m]=calc_radius(x_pos2,y_pos2,z_pos2,box_size)
900840
901841
@@ -906,7 +846,7 @@
906846 cluster_name="hist_radius_gyration%05d"%my_selection[i]
907847 p.savefig(cluster_name)
908848 p.hold(False)
909- p.clf()
849+
910850 # print 'the evolution of the number of clusters is, ', n_clusters
911851
912852 p.save("number_cluster.dat",n_clusters)
@@ -919,7 +859,7 @@
919859 p.grid(True)
920860 p.savefig('number_clusters_vs_time.pdf')
921861 p.hold(False)
922- p.clf()
862+
923863
924864 # p.plot(time, min_dist,linewidth=2.)
925865 # p.xlabel('time')