diff --git a/examples/04_align_axis/align.py b/examples/04_align_axis/align.py new file mode 100644 index 0000000..c5e920a --- /dev/null +++ b/examples/04_align_axis/align.py @@ -0,0 +1,133 @@ +""" +""" + +import math +import numpy as np +import scipy.linalg + +DEBUG = 0 + +def read_coords(fname): + f = open(fname, "r") + lines = f.readlines() + coords = [] + for i in range(2, len(lines)): + tokens = lines[i].strip().split() + if len(tokens) > 0: + coords.append([float(j) for j in tokens[1:]]) + return coords + +def get_surface_atoms(coords): + sur = [] + for i in range(32): + sur.append(coords[i]) + return sur + +def get_com(coords): + com = [0.0, 0.0, 0.0] + for i in range(len(coords)): + for j in range(3): + com[j] += coords[i][j] + for i in range(3): + com[i] = com[i]/len(coords) + + return com + +def center_coords(coords, s): + coords_new = [] + for i in range(len(coords)): + coords_new.append([]) + for j in range(3): + coords_new[i].append(coords[i][j] - s[j]) + return coords_new + +def fit_plannar(coords): + # regular grid covering the domain of the data + data = np.array(coords) + X,Y = np.meshgrid(np.arange(-10.0, 10.0, 1), np.arange(-10.0, 10.0, 1)) + # best-fit linear plane + A = np.c_[data[:,0], data[:,1], np.ones(data.shape[0])] + C,_,_,_ = scipy.linalg.lstsq(A, data[:,2]) # coefficients + if DEBUG: + o = open("plannar.xyz", "w") + o.write("%d\n\n"%(len(coords)*2)) + for i in range(len(coords)): + x = coords[i][0] + y = coords[i][1] + z0 = coords[i][2] + z1 = C[0]*x + C[1]*y + C[2] + o.write("Au %12.4f%12.4f%12.4f\n"%(x, y, z0)) + o.write("Fe %12.4f%12.4f%12.4f\n"%(x, y, z1)) + o.close() + return C + +def align_axis(v1, v2): + w = np.cross(v1,v2) + w = w/np.linalg.norm(w) + w_hat = np.matrix([[ 0, -w[2], w[1]], + [ w[2], 0, -w[0]], + [-w[1], w[0], 0]]) + cos_tht = np.dot(v1, v2)/np.linalg.norm(v1)/np.linalg.norm(v2) + tht = np.arccos(cos_tht) + R = np.identity(3) + w_hat*np.sin(tht) + w_hat*w_hat*(1-np.cos(tht)) + return R + +def rotate_coords(coords, R): + coords_new = [] + for i in range(len(coords)): + coords_new.append(np.dot(R, coords[i]).A1) + return coords_new + +def output_coords(coords, fname): + o = open(fname, "w") + o.write("%d\n\n"%(len(coords)+20)) + for i in range(len(coords)): + o.write("Au ") + for j in range(3): + o.write("%12.4f"%coords[i][j]) + o.write("\n") + for i in range(20): + o.write("O 0 0 %12.4f\n"%(i-10)) + o.close() + +def output_coords_debug(coords, fname, pc): + o = open(fname, "w") + o.write("%d\n\n"%(len(coords)+20)) + for i in range(len(coords)): + o.write("Au ") + for j in range(3): + o.write("%12.4f"%coords[i][j]) + o.write("\n") + for i in range(20): + x = pc[0]*i + y = pc[1]*i + z = -i + o.write("O %12.4f%12.4f%12.4f\n"%(x, y, z)) + o.close() + +def main(): + # read the xyz file + coords = read_coords("input.xyz") + # get the surface atoms + sur = get_surface_atoms(coords) + # calculate the center of mass (com) + com = get_com(sur) + # move the com to zero + sur_zero = center_coords(sur, com) + # determine the surface and surface vector + pc = fit_plannar(sur_zero) + v1 = [pc[0], pc[1], -1] + v0 = [0, 0, 1] # rotate to z axis + coords_zero = center_coords(coords, com) + if DEBUG: + output_coords_debug(coords_zero, "vector.xyz", pc) + # calculate the rotation matrix + R = align_axis(v1, v0) + # apply the rotation + coords_new = rotate_coords(coords_zero, R) + # output the data + output_coords(coords_zero, "t0.xyz") + output_coords(coords_new, "t1.xyz") + +if __name__ == "__main__": + main() diff --git a/examples/04_align_axis/input.xyz b/examples/04_align_axis/input.xyz new file mode 100644 index 0000000..82b3a0f --- /dev/null +++ b/examples/04_align_axis/input.xyz @@ -0,0 +1,84 @@ +82 +Nanocluster +Pt 4.303200 10.058001 5.519400 +Pt 5.532200 9.051200 3.205000 +Pt 1.845400 12.071800 10.148200 +Pt 3.074400 11.065001 7.833800 +Pt 5.597800 11.509000 8.980600 +Pt 6.826800 10.502000 6.666200 +Pt 8.055600 9.495200 4.351800 +Pt 9.284600 8.488199 2.037400 +Pt 11.808000 8.932200 3.184200 +Pt 9.350201 10.945999 7.813000 +Pt 10.579200 9.939200 5.498600 +Pt 13.102799 10.383200 6.645400 +Pt 14.331599 9.376200 4.331000 +Pt 16.855200 9.820200 5.477800 +Pt 3.140000 13.522600 13.609400 +Pt 4.369000 12.515800 11.295000 +Pt 6.892400 12.959800 12.441799 +Pt 8.121400 11.953000 10.127400 +Pt 5.663600 13.966599 14.756201 +Pt 8.187200 14.410600 15.903000 +Pt 9.416000 13.403799 13.588600 +Pt 10.710600 14.854601 17.049801 +Pt 10.645000 12.396801 11.274199 +Pt 11.873799 11.390000 8.959800 +Pt 14.397400 11.834001 10.106601 +Pt 15.626201 10.827200 7.792200 +Pt 18.149799 11.271000 8.939000 +Pt 11.939600 13.847800 14.735399 +Pt 13.168401 12.840800 12.421000 +Pt 15.692000 13.284800 13.567801 +Pt 16.920799 12.278000 11.253400 +Pt 14.463000 14.291800 15.882200 +Pt 6.147400 7.950400 5.713000 +Pt 3.689600 9.964200 10.341801 +Pt 4.918600 8.957399 8.027400 +Pt 7.442000 9.401400 9.174200 +Pt 7.376400 6.943600 3.398600 +Pt 9.899799 7.387600 4.545400 +Pt 8.671000 8.394400 6.859800 +Pt 11.194400 8.838400 8.006600 +Pt 12.423400 7.831600 5.692200 +Pt 14.947000 8.275600 6.839000 +Pt 2.460800 10.971201 12.656200 +Pt 4.984200 11.415200 13.803000 +Pt 6.213200 10.408200 11.488600 +Pt 8.736600 10.852200 12.635401 +Pt 7.507800 11.859200 14.949800 +Pt 10.031400 12.302999 16.096600 +Pt 9.965600 9.845400 10.320999 +Pt 12.489200 10.289400 11.467800 +Pt 13.717999 9.282400 9.153400 +Pt 16.241600 9.726399 10.300200 +Pt 17.470400 8.719600 7.985800 +Pt 11.260200 11.296200 13.782200 +Pt 13.783799 11.740200 14.929000 +Pt 15.012600 10.733400 12.614599 +Pt 12.554800 12.747001 17.243401 +Pt 5.533800 7.856600 10.535601 +Pt 6.762800 6.849800 8.221200 +Pt 7.991600 5.842800 5.906800 +Pt 9.286200 7.293800 9.368000 +Pt 10.515200 6.286800 7.053600 +Pt 13.038599 6.730800 8.200399 +Pt 4.305000 8.863600 12.849999 +Pt 6.828400 9.307600 13.996600 +Pt 8.057400 8.300600 11.682400 +Pt 9.351999 9.751600 15.143400 +Pt 10.580799 8.744600 12.829000 +Pt 11.809799 7.737800 10.514801 +Pt 14.333400 8.181800 11.661400 +Pt 15.562201 7.174800 9.347000 +Pt 11.875401 10.195600 16.290199 +Pt 13.104400 9.188601 13.975801 +Pt 7.378000 5.749000 10.729199 +Pt 8.607000 4.742200 8.414801 +Pt 11.130400 5.186200 9.561600 +Pt 6.149200 6.756000 13.043600 +Pt 8.672600 7.200000 14.190399 +Pt 9.901600 6.193000 11.876000 +Pt 12.424999 6.637000 13.022799 +Pt 13.653999 5.630200 10.708400 +Pt 11.196199 7.644000 15.337200 diff --git a/examples/04_align_axis/output/t0.xyz b/examples/04_align_axis/output/t0.xyz new file mode 100644 index 0000000..c17d109 --- /dev/null +++ b/examples/04_align_axis/output/t0.xyz @@ -0,0 +1,104 @@ +102 + +Au -5.6944 -1.6134 -4.0242 +Au -4.4654 -2.6203 -6.3386 +Au -8.1522 0.4003 0.6046 +Au -6.9232 -0.6064 -1.7098 +Au -4.3998 -0.1625 -0.5630 +Au -3.1708 -1.1695 -2.8774 +Au -1.9420 -2.1763 -5.1918 +Au -0.7130 -3.1833 -7.5062 +Au 1.8104 -2.7393 -6.3594 +Au -0.6474 -0.7255 -1.7306 +Au 0.5816 -1.7323 -4.0450 +Au 3.1052 -1.2883 -2.8982 +Au 4.3340 -2.2953 -5.2126 +Au 6.8576 -1.8513 -4.0658 +Au -6.8576 1.8511 4.0658 +Au -5.6286 0.8443 1.7514 +Au -3.1052 1.2883 2.8982 +Au -1.8762 0.2815 0.5838 +Au -4.3340 2.2951 5.2126 +Au -1.8104 2.7391 6.3594 +Au -0.5816 1.7323 4.0450 +Au 0.7130 3.1832 7.5062 +Au 0.6474 0.7254 1.7306 +Au 1.8762 -0.2815 -0.5838 +Au 4.3998 0.1626 0.5630 +Au 5.6286 -0.8443 -1.7514 +Au 8.1522 -0.4005 -0.6046 +Au 1.9420 2.1763 5.1918 +Au 3.1708 1.1693 2.8774 +Au 5.6944 1.6133 4.0242 +Au 6.9232 0.6065 1.7098 +Au 4.4654 2.6203 6.3386 +Au -3.8502 -3.7211 -3.8306 +Au -6.3080 -1.7073 0.7982 +Au -5.0790 -2.7141 -1.5162 +Au -2.5556 -2.2701 -0.3694 +Au -2.6212 -4.7279 -6.1450 +Au -0.0978 -4.2839 -4.9982 +Au -1.3266 -3.2771 -2.6838 +Au 1.1968 -2.8331 -1.5370 +Au 2.4258 -3.8399 -3.8514 +Au 4.9494 -3.3959 -2.7046 +Au -7.5368 -0.7002 3.1126 +Au -5.0134 -0.2563 4.2594 +Au -3.7844 -1.2633 1.9450 +Au -1.2610 -0.8193 3.0918 +Au -2.4898 0.1877 5.4062 +Au 0.0338 0.6315 6.5530 +Au -0.0320 -1.8261 0.7774 +Au 2.4916 -1.3821 1.9242 +Au 3.7204 -2.3891 -0.3902 +Au 6.2440 -1.9451 0.7566 +Au 7.4728 -2.9519 -1.5578 +Au 1.2626 -0.3753 4.2386 +Au 3.7862 0.0687 5.3854 +Au 5.0150 -0.9381 3.0710 +Au 2.5572 1.0756 7.6998 +Au -4.4638 -3.8149 0.9920 +Au -3.2348 -4.8217 -1.3224 +Au -2.0060 -5.8287 -3.6368 +Au -0.7114 -4.3777 -0.1756 +Au 0.5176 -5.3847 -2.4900 +Au 3.0410 -4.9407 -1.3432 +Au -5.6926 -2.8079 3.3064 +Au -3.1692 -2.3639 4.4530 +Au -1.9402 -3.3709 2.1388 +Au -0.6456 -1.9199 5.5998 +Au 0.5832 -2.9269 3.2854 +Au 1.8122 -3.9337 0.9712 +Au 4.3358 -3.4897 2.1178 +Au 5.5646 -4.4967 -0.1966 +Au 1.8778 -1.4759 6.7466 +Au 3.1068 -2.4828 4.4322 +Au -2.6196 -5.9225 1.1856 +Au -1.3906 -6.9293 -1.1288 +Au 1.1328 -6.4853 0.0180 +Au -3.8484 -4.9155 3.5000 +Au -1.3250 -4.4715 4.6468 +Au -0.0960 -5.4785 2.3324 +Au 2.4274 -5.0345 3.4792 +Au 3.6564 -6.0413 1.1648 +Au 1.1986 -4.0275 5.7936 +O 0 0 -10.0000 +O 0 0 -9.0000 +O 0 0 -8.0000 +O 0 0 -7.0000 +O 0 0 -6.0000 +O 0 0 -5.0000 +O 0 0 -4.0000 +O 0 0 -3.0000 +O 0 0 -2.0000 +O 0 0 -1.0000 +O 0 0 0.0000 +O 0 0 1.0000 +O 0 0 2.0000 +O 0 0 3.0000 +O 0 0 4.0000 +O 0 0 5.0000 +O 0 0 6.0000 +O 0 0 7.0000 +O 0 0 8.0000 +O 0 0 9.0000 diff --git a/examples/04_align_axis/output/t1.xyz b/examples/04_align_axis/output/t1.xyz new file mode 100644 index 0000000..f9ad882 --- /dev/null +++ b/examples/04_align_axis/output/t1.xyz @@ -0,0 +1,104 @@ +102 + +Au -5.5877 4.4723 -0.0000 +Au -4.2973 6.9654 0.0000 +Au -8.1682 -0.5139 -0.0000 +Au -6.8779 1.9791 0.0001 +Au -4.3849 0.6888 0.0001 +Au -3.0945 3.1820 -0.0000 +Au -1.8043 5.6751 0.0000 +Au -0.5139 8.1683 -0.0001 +Au 1.9791 6.8780 -0.0001 +Au -0.6015 1.8917 -0.0000 +Au 0.6889 4.3848 0.0001 +Au 3.1821 3.0945 0.0001 +Au 4.4722 5.5877 -0.0000 +Au 6.9654 4.2974 -0.0000 +Au -6.9654 -4.2973 -0.0001 +Au -5.6750 -1.8042 0.0000 +Au -3.1821 -3.0945 0.0000 +Au -1.8917 -0.6015 0.0001 +Au -4.4722 -5.5876 -0.0001 +Au -1.9791 -6.8779 -0.0000 +Au -0.6889 -4.3848 0.0000 +Au 0.5139 -8.1682 -0.0000 +Au 0.6015 -1.8917 -0.0001 +Au 1.8917 0.6014 -0.0000 +Au 4.3849 -0.6889 0.0000 +Au 5.6750 1.8042 0.0001 +Au 8.1682 0.5140 -0.0001 +Au 1.8043 -5.6751 0.0001 +Au 3.0945 -3.1820 -0.0001 +Au 5.5877 -4.4723 -0.0000 +Au 6.8779 -1.9792 0.0000 +Au 4.2973 -6.9654 0.0001 +Au -3.6960 5.0738 -1.9850 +Au -6.2765 0.0875 -1.9850 +Au -4.9861 2.5806 -1.9849 +Au -2.4932 1.2903 -1.9849 +Au -2.4056 7.5669 -1.9850 +Au 0.0874 6.2766 -1.9850 +Au -1.2028 3.7835 -1.9850 +Au 1.2902 2.4932 -1.9850 +Au 2.5806 4.9863 -1.9849 +Au 5.0738 3.6960 -1.9849 +Au -7.5667 -2.4056 -1.9849 +Au -5.0737 -3.6959 -1.9849 +Au -3.7833 -1.2028 -1.9850 +Au -1.2904 -2.4931 -1.9850 +Au -2.5805 -4.9862 -1.9849 +Au -0.0873 -6.2764 -1.9850 +Au 0.0000 0.0000 -1.9849 +Au 2.4932 -1.2903 -1.9849 +Au 3.7834 1.2029 -1.9850 +Au 6.2766 -0.0874 -1.9850 +Au 7.5668 2.4057 -1.9849 +Au 1.2028 -3.7834 -1.9850 +Au 3.6960 -5.0737 -1.9849 +Au 4.9862 -2.5806 -1.9849 +Au 2.4056 -7.5667 -1.9850 +Au -4.3848 0.6888 -3.9701 +Au -3.0944 3.1819 -3.9700 +Au -1.8043 5.6751 -3.9701 +Au -0.6015 1.8916 -3.9700 +Au 0.6889 4.3848 -3.9701 +Au 3.1819 3.0945 -3.9701 +Au -5.6750 -1.8044 -3.9700 +Au -3.1820 -3.0945 -3.9699 +Au -1.8916 -0.6015 -3.9701 +Au -0.6888 -4.3848 -3.9699 +Au 0.6014 -1.8916 -3.9700 +Au 1.8917 0.6013 -3.9700 +Au 4.3849 -0.6888 -3.9699 +Au 5.6751 1.8044 -3.9700 +Au 1.8042 -5.6751 -3.9698 +Au 3.0945 -3.1819 -3.9700 +Au -2.4931 1.2903 -5.9551 +Au -1.2027 3.7834 -5.9550 +Au 1.2903 2.4931 -5.9550 +Au -3.7833 -1.2029 -5.9550 +Au -1.2903 -2.4932 -5.9549 +Au 0.0001 -0.0000 -5.9551 +Au 2.4931 -1.2903 -5.9550 +Au 3.7834 1.2028 -5.9550 +Au 1.2029 -3.7835 -5.9549 +O 0 0 -10.0000 +O 0 0 -9.0000 +O 0 0 -8.0000 +O 0 0 -7.0000 +O 0 0 -6.0000 +O 0 0 -5.0000 +O 0 0 -4.0000 +O 0 0 -3.0000 +O 0 0 -2.0000 +O 0 0 -1.0000 +O 0 0 0.0000 +O 0 0 1.0000 +O 0 0 2.0000 +O 0 0 3.0000 +O 0 0 4.0000 +O 0 0 5.0000 +O 0 0 6.0000 +O 0 0 7.0000 +O 0 0 8.0000 +O 0 0 9.0000 diff --git a/examples/04_align_axis/output/view.vmd b/examples/04_align_axis/output/view.vmd new file mode 100644 index 0000000..3898d43 --- /dev/null +++ b/examples/04_align_axis/output/view.vmd @@ -0,0 +1,715 @@ +#!/usr/local/bin/vmd +# VMD script written by save_state $Revision: 1.47 $ +# VMD version: 1.9.3 +set viewplist {} +set fixedlist {} +proc vmdrestoremymaterials {} { + set mlist { Opaque Transparent BrushedMetal Diffuse Ghost Glass1 Glass2 Glass3 Glossy HardPlastic MetallicPastel Steel Translucent Edgy EdgyShiny EdgyGlass Goodsell AOShiny AOChalky AOEdgy BlownGlass GlassBubble RTChrome } + set mymlist [material list] + foreach mat $mlist { + if { [lsearch $mymlist $mat] == -1 } { + material add $mat + } + } + material change ambient Opaque 0.000000 + material change diffuse Opaque 0.650000 + material change specular Opaque 0.500000 + material change shininess Opaque 0.534020 + material change mirror Opaque 0.000000 + material change opacity Opaque 1.000000 + material change outline Opaque 0.000000 + material change outlinewidth Opaque 0.000000 + material change transmode Opaque 0.000000 + material change ambient Transparent 0.000000 + material change diffuse Transparent 0.650000 + material change specular Transparent 0.500000 + material change shininess Transparent 0.534020 + material change mirror Transparent 0.000000 + material change opacity Transparent 0.300000 + material change outline Transparent 0.000000 + material change outlinewidth Transparent 0.000000 + material change transmode Transparent 0.000000 + material change ambient BrushedMetal 0.080000 + material change diffuse BrushedMetal 0.390000 + material change specular BrushedMetal 0.340000 + material change shininess BrushedMetal 0.150000 + material change mirror BrushedMetal 0.000000 + material change opacity BrushedMetal 1.000000 + material change outline BrushedMetal 0.000000 + material change outlinewidth BrushedMetal 0.000000 + material change transmode BrushedMetal 0.000000 + material change ambient Diffuse 0.000000 + material change diffuse Diffuse 0.620000 + material change specular Diffuse 0.000000 + material change shininess Diffuse 0.530000 + material change mirror Diffuse 0.000000 + material change opacity Diffuse 1.000000 + material change outline Diffuse 0.000000 + material change outlinewidth Diffuse 0.000000 + material change transmode Diffuse 0.000000 + material change ambient Ghost 0.000000 + material change diffuse Ghost 0.000000 + material change specular Ghost 1.000000 + material change shininess Ghost 0.230000 + material change mirror Ghost 0.000000 + material change opacity Ghost 0.100000 + material change outline Ghost 0.000000 + material change outlinewidth Ghost 0.000000 + material change transmode Ghost 0.000000 + material change ambient Glass1 0.000000 + material change diffuse Glass1 0.500000 + material change specular Glass1 0.650000 + material change shininess Glass1 0.530000 + material change mirror Glass1 0.000000 + material change opacity Glass1 0.150000 + material change outline Glass1 0.000000 + material change outlinewidth Glass1 0.000000 + material change transmode Glass1 0.000000 + material change ambient Glass2 0.520000 + material change diffuse Glass2 0.760000 + material change specular Glass2 0.220000 + material change shininess Glass2 0.590000 + material change mirror Glass2 0.000000 + material change opacity Glass2 0.680000 + material change outline Glass2 0.000000 + material change outlinewidth Glass2 0.000000 + material change transmode Glass2 0.000000 + material change ambient Glass3 0.150000 + material change diffuse Glass3 0.250000 + material change specular Glass3 0.750000 + material change shininess Glass3 0.800000 + material change mirror Glass3 0.000000 + material change opacity Glass3 0.500000 + material change outline Glass3 0.000000 + material change outlinewidth Glass3 0.000000 + material change transmode Glass3 0.000000 + material change ambient Glossy 0.000000 + material change diffuse Glossy 0.650000 + material change specular Glossy 1.000000 + material change shininess Glossy 0.880000 + material change mirror Glossy 0.000000 + material change opacity Glossy 1.000000 + material change outline Glossy 0.000000 + material change outlinewidth Glossy 0.000000 + material change transmode Glossy 0.000000 + material change ambient HardPlastic 0.000000 + material change diffuse HardPlastic 0.560000 + material change specular HardPlastic 0.280000 + material change shininess HardPlastic 0.690000 + material change mirror HardPlastic 0.000000 + material change opacity HardPlastic 1.000000 + material change outline HardPlastic 0.000000 + material change outlinewidth HardPlastic 0.000000 + material change transmode HardPlastic 0.000000 + material change ambient MetallicPastel 0.000000 + material change diffuse MetallicPastel 0.260000 + material change specular MetallicPastel 0.550000 + material change shininess MetallicPastel 0.190000 + material change mirror MetallicPastel 0.000000 + material change opacity MetallicPastel 1.000000 + material change outline MetallicPastel 0.000000 + material change outlinewidth MetallicPastel 0.000000 + material change transmode MetallicPastel 0.000000 + material change ambient Steel 0.250000 + material change diffuse Steel 0.000000 + material change specular Steel 0.380000 + material change shininess Steel 0.320000 + material change mirror Steel 0.000000 + material change opacity Steel 1.000000 + material change outline Steel 0.000000 + material change outlinewidth Steel 0.000000 + material change transmode Steel 0.000000 + material change ambient Translucent 0.000000 + material change diffuse Translucent 0.700000 + material change specular Translucent 0.600000 + material change shininess Translucent 0.300000 + material change mirror Translucent 0.000000 + material change opacity Translucent 0.800000 + material change outline Translucent 0.000000 + material change outlinewidth Translucent 0.000000 + material change transmode Translucent 0.000000 + material change ambient Edgy 0.000000 + material change diffuse Edgy 0.660000 + material change specular Edgy 0.000000 + material change shininess Edgy 0.750000 + material change mirror Edgy 0.000000 + material change opacity Edgy 1.000000 + material change outline Edgy 0.620000 + material change outlinewidth Edgy 0.940000 + material change transmode Edgy 0.000000 + material change ambient EdgyShiny 0.000000 + material change diffuse EdgyShiny 0.660000 + material change specular EdgyShiny 0.960000 + material change shininess EdgyShiny 0.750000 + material change mirror EdgyShiny 0.000000 + material change opacity EdgyShiny 1.000000 + material change outline EdgyShiny 0.760000 + material change outlinewidth EdgyShiny 0.940000 + material change transmode EdgyShiny 0.000000 + material change ambient EdgyGlass 0.000000 + material change diffuse EdgyGlass 0.660000 + material change specular EdgyGlass 0.500000 + material change shininess EdgyGlass 0.750000 + material change mirror EdgyGlass 0.000000 + material change opacity EdgyGlass 0.620000 + material change outline EdgyGlass 0.620000 + material change outlinewidth EdgyGlass 0.940000 + material change transmode EdgyGlass 0.000000 + material change ambient Goodsell 0.520000 + material change diffuse Goodsell 1.000000 + material change specular Goodsell 0.000000 + material change shininess Goodsell 0.000000 + material change mirror Goodsell 0.000000 + material change opacity Goodsell 1.000000 + material change outline Goodsell 4.000000 + material change outlinewidth Goodsell 0.900000 + material change transmode Goodsell 0.000000 + material change ambient AOShiny 0.000000 + material change diffuse AOShiny 0.850000 + material change specular AOShiny 0.200000 + material change shininess AOShiny 0.530000 + material change mirror AOShiny 0.000000 + material change opacity AOShiny 1.000000 + material change outline AOShiny 0.000000 + material change outlinewidth AOShiny 0.000000 + material change transmode AOShiny 0.000000 + material change ambient AOChalky 0.000000 + material change diffuse AOChalky 0.850000 + material change specular AOChalky 0.000000 + material change shininess AOChalky 0.530000 + material change mirror AOChalky 0.000000 + material change opacity AOChalky 1.000000 + material change outline AOChalky 0.000000 + material change outlinewidth AOChalky 0.000000 + material change transmode AOChalky 0.000000 + material change ambient AOEdgy 0.000000 + material change diffuse AOEdgy 0.900000 + material change specular AOEdgy 0.200000 + material change shininess AOEdgy 0.530000 + material change mirror AOEdgy 0.000000 + material change opacity AOEdgy 1.000000 + material change outline AOEdgy 0.620000 + material change outlinewidth AOEdgy 0.930000 + material change transmode AOEdgy 0.000000 + material change ambient BlownGlass 0.040000 + material change diffuse BlownGlass 0.340000 + material change specular BlownGlass 1.000000 + material change shininess BlownGlass 1.000000 + material change mirror BlownGlass 0.000000 + material change opacity BlownGlass 0.100000 + material change outline BlownGlass 0.000000 + material change outlinewidth BlownGlass 0.000000 + material change transmode BlownGlass 1.000000 + material change ambient GlassBubble 0.250000 + material change diffuse GlassBubble 0.340000 + material change specular GlassBubble 1.000000 + material change shininess GlassBubble 1.000000 + material change mirror GlassBubble 0.000000 + material change opacity GlassBubble 0.040000 + material change outline GlassBubble 0.000000 + material change outlinewidth GlassBubble 0.000000 + material change transmode GlassBubble 1.000000 + material change ambient RTChrome 0.000000 + material change diffuse RTChrome 0.650000 + material change specular RTChrome 0.500000 + material change shininess RTChrome 0.530000 + material change mirror RTChrome 0.700000 + material change opacity RTChrome 1.000000 + material change outline RTChrome 0.000000 + material change outlinewidth RTChrome 0.000000 + material change transmode RTChrome 0.000000 +} +vmdrestoremymaterials +# Atom selection macros +atomselect macro at {resname ADE A THY T +} +atomselect macro acidic {resname ASP GLU +} +atomselect macro cyclic {resname HIS PHE PRO TRP TYR +} +atomselect macro acyclic {protein and not cyclic +} +atomselect macro aliphatic {resname ALA GLY ILE LEU VAL +} +atomselect macro alpha {protein and name CA +} +atomselect macro amino {protein +} +atomselect macro aromatic {resname HIS PHE TRP TYR +} +atomselect macro basic {resname ARG HIS LYS HSP +} +atomselect macro bonded {numbonds > 0 +} +atomselect macro buried {resname ALA LEU VAL ILE PHE CYS MET TRP +} +atomselect macro cg {resname CYT C GUA G +} +atomselect macro charged {basic or acidic +} +atomselect macro hetero {not (protein or nucleic) +} +atomselect macro hydrophobic {resname ALA LEU VAL ILE PRO PHE MET TRP +} +atomselect macro small {resname ALA GLY SER +} +atomselect macro medium {resname VAL THR ASP ASN PRO CYS ASX PCA HYP +} +atomselect macro large {protein and not (small or medium) +} +atomselect macro neutral {resname VAL PHE GLN TYR HIS CYS MET TRP ASX GLX PCA HYP +} +atomselect macro polar {protein and not hydrophobic +} +atomselect macro purine {resname ADE A GUA G +} +atomselect macro pyrimidine {resname CYT C THY T URA U +} +atomselect macro surface {protein and not buried +} +atomselect macro lipid {resname DLPE DMPC DPPC GPC LPPC PALM PC PGCL POPC POPE +} +atomselect macro lipids {lipid +} +atomselect macro ion {resname AL BA CA CAL CD CES CLA CL CO CS CU CU1 CUA HG IN IOD K LIT MG MN3 MO3 MO4 MO5 MO6 NA NAW OC7 PB POT PT RB SOD TB TL WO4 YB ZN ZN1 ZN2 +} +atomselect macro ions {ion +} +atomselect macro sugar {resname AGLC +} +atomselect macro solvent {not (protein or sugar or nucleic or lipid) +} +atomselect macro glycan {resname NAG BGLN FUC AFUC MAN AMAN BMA BMAN +} +atomselect macro carbon {name "C.*" and not ion +} +atomselect macro hydrogen {name "[0-9]?H.*" +} +atomselect macro nitrogen {name "N.*" +} +atomselect macro oxygen {name "O.*" +} +atomselect macro sulfur {name "S.*" and not ion +} +atomselect macro noh {not hydrogen +} +atomselect macro heme {resname HEM HEME +} +atomselect macro conformationall {altloc "" +} +atomselect macro conformationA {altloc "" or altloc "A" +} +atomselect macro conformationB {altloc "" or altloc "B" +} +atomselect macro conformationC {altloc "" or altloc "C" +} +atomselect macro conformationD {altloc "" or altloc "D" +} +atomselect macro conformationE {altloc "" or altloc "E" +} +atomselect macro conformationF {altloc "" or altloc "F" +} +atomselect macro drude {type DRUD or type LP +} +atomselect macro unparametrized beta<1 +atomselect macro addedmolefacture {occupancy 0.8} +atomselect macro qwikmd_protein {(not name QWIKMDDELETE and protein)} +atomselect macro qwikmd_nucleic {(not name QWIKMDDELETE and nucleic)} +atomselect macro qwikmd_glycan {(not name QWIKMDDELETE and glycan)} +atomselect macro qwikmd_lipid {(not name QWIKMDDELETE and lipid)} +atomselect macro qwikmd_hetero {(not name QWIKMDDELETE and hetero and not qwikmd_protein and not qwikmd_lipid and not qwikmd_nucleic and not qwikmd_glycan and not water)} +# Display settings +display eyesep 0.065000 +display focallength 2.000000 +display height 6.000000 +display distance -2.000000 +display projection Orthographic +display nearclip set 0.500000 +display farclip set 10.000000 +display depthcue off +display cuestart 0.500000 +display cueend 10.000000 +display cuestart 0.500000 +display cueend 10.000000 +display cuedensity 0.320000 +display cuemode Exp2 +display shadows off +display ambientocclusion off +display aoambient 0.800000 +display aodirect 0.300000 +display dof off +display dof_fnumber 64.000000 +display dof_focaldist 0.700000 +mol new t0.xyz type xyz first 0 last -1 step 1 filebonds 1 autobonds 1 waitfor all +mol delrep 0 top +mol representation VDW 0.600000 22.000000 +mol color Name +mol selection {name Au} +mol material Opaque +mol addrep top +mol selupdate 0 top 0 +mol colupdate 0 top 0 +mol scaleminmax top 0 0.000000 0.000000 +mol smoothrep top 0 0 +mol drawframes top 0 {now} +mol clipplane center 0 0 top {0.0 0.0 0.0} +mol clipplane color 0 0 top {0.5 0.5 0.5 } +mol clipplane normal 0 0 top {0.0 0.0 1.0} +mol clipplane status 0 0 top {0} +mol clipplane center 1 0 top {0.0 0.0 0.0} +mol clipplane color 1 0 top {0.5 0.5 0.5 } +mol clipplane normal 1 0 top {0.0 0.0 1.0} +mol clipplane status 1 0 top {0} +mol clipplane center 2 0 top {0.0 0.0 0.0} +mol clipplane color 2 0 top {0.5 0.5 0.5 } +mol clipplane normal 2 0 top {0.0 0.0 1.0} +mol clipplane status 2 0 top {0} +mol clipplane center 3 0 top {0.0 0.0 0.0} +mol clipplane color 3 0 top {0.5 0.5 0.5 } +mol clipplane normal 3 0 top {0.0 0.0 1.0} +mol clipplane status 3 0 top {0} +mol clipplane center 4 0 top {0.0 0.0 0.0} +mol clipplane color 4 0 top {0.5 0.5 0.5 } +mol clipplane normal 4 0 top {0.0 0.0 1.0} +mol clipplane status 4 0 top {0} +mol clipplane center 5 0 top {0.0 0.0 0.0} +mol clipplane color 5 0 top {0.5 0.5 0.5 } +mol clipplane normal 5 0 top {0.0 0.0 1.0} +mol clipplane status 5 0 top {0} +mol representation DynamicBonds 3.000000 0.300000 12.000000 +mol color Name +mol selection {name Au} +mol material Opaque +mol addrep top +mol selupdate 1 top 0 +mol colupdate 1 top 0 +mol scaleminmax top 1 0.000000 0.000000 +mol smoothrep top 1 0 +mol drawframes top 1 {now} +mol clipplane center 0 1 top {0.0 0.0 0.0} +mol clipplane color 0 1 top {0.5 0.5 0.5 } +mol clipplane normal 0 1 top {0.0 0.0 1.0} +mol clipplane status 0 1 top {0} +mol clipplane center 1 1 top {0.0 0.0 0.0} +mol clipplane color 1 1 top {0.5 0.5 0.5 } +mol clipplane normal 1 1 top {0.0 0.0 1.0} +mol clipplane status 1 1 top {0} +mol clipplane center 2 1 top {0.0 0.0 0.0} +mol clipplane color 2 1 top {0.5 0.5 0.5 } +mol clipplane normal 2 1 top {0.0 0.0 1.0} +mol clipplane status 2 1 top {0} +mol clipplane center 3 1 top {0.0 0.0 0.0} +mol clipplane color 3 1 top {0.5 0.5 0.5 } +mol clipplane normal 3 1 top {0.0 0.0 1.0} +mol clipplane status 3 1 top {0} +mol clipplane center 4 1 top {0.0 0.0 0.0} +mol clipplane color 4 1 top {0.5 0.5 0.5 } +mol clipplane normal 4 1 top {0.0 0.0 1.0} +mol clipplane status 4 1 top {0} +mol clipplane center 5 1 top {0.0 0.0 0.0} +mol clipplane color 5 1 top {0.5 0.5 0.5 } +mol clipplane normal 5 1 top {0.0 0.0 1.0} +mol clipplane status 5 1 top {0} +mol rename top t0.xyz +set viewpoints([molinfo top]) {{{1 0 0 -1.08329e-05} {0 1 0 -8.82149e-06} {0 0 1 1.73273} {0 0 0 1}} {{-0.455479 -0.89023 -0.00523547 0} {-0.00931668 -0.00111363 0.999955 0} {-0.890196 0.455507 -0.00778734 0} {0 0 0 1}} {{0.0946611 0 0 0} {0 0.0946611 0 0} {0 0 0.0946611 0} {0 0 0 1}} {{1 0 0 0} {0 1 0 0} {0 0 1 0} {0 0 0 1}}} +lappend viewplist [molinfo top] +# done with molecule 0 +mol new /home/tao/Tmp/rotate/t2/t1.xyz type xyz first 0 last -1 step 1 filebonds 1 autobonds 1 waitfor all +mol delrep 0 top +mol representation VDW 0.600000 22.000000 +mol color ColorID 0 +mol selection {name Au} +mol material Opaque +mol addrep top +mol selupdate 0 top 0 +mol colupdate 0 top 0 +mol scaleminmax top 0 0.000000 0.000000 +mol smoothrep top 0 0 +mol drawframes top 0 {now} +mol clipplane center 0 0 top {0.0 0.0 0.0} +mol clipplane color 0 0 top {0.5 0.5 0.5 } +mol clipplane normal 0 0 top {0.0 0.0 1.0} +mol clipplane status 0 0 top {0} +mol clipplane center 1 0 top {0.0 0.0 0.0} +mol clipplane color 1 0 top {0.5 0.5 0.5 } +mol clipplane normal 1 0 top {0.0 0.0 1.0} +mol clipplane status 1 0 top {0} +mol clipplane center 2 0 top {0.0 0.0 0.0} +mol clipplane color 2 0 top {0.5 0.5 0.5 } +mol clipplane normal 2 0 top {0.0 0.0 1.0} +mol clipplane status 2 0 top {0} +mol clipplane center 3 0 top {0.0 0.0 0.0} +mol clipplane color 3 0 top {0.5 0.5 0.5 } +mol clipplane normal 3 0 top {0.0 0.0 1.0} +mol clipplane status 3 0 top {0} +mol clipplane center 4 0 top {0.0 0.0 0.0} +mol clipplane color 4 0 top {0.5 0.5 0.5 } +mol clipplane normal 4 0 top {0.0 0.0 1.0} +mol clipplane status 4 0 top {0} +mol clipplane center 5 0 top {0.0 0.0 0.0} +mol clipplane color 5 0 top {0.5 0.5 0.5 } +mol clipplane normal 5 0 top {0.0 0.0 1.0} +mol clipplane status 5 0 top {0} +mol representation DynamicBonds 3.000000 0.300000 12.000000 +mol color ColorID 0 +mol selection {name Au} +mol material Opaque +mol addrep top +mol selupdate 1 top 0 +mol colupdate 1 top 0 +mol scaleminmax top 1 0.000000 0.000000 +mol smoothrep top 1 0 +mol drawframes top 1 {now} +mol clipplane center 0 1 top {0.0 0.0 0.0} +mol clipplane color 0 1 top {0.5 0.5 0.5 } +mol clipplane normal 0 1 top {0.0 0.0 1.0} +mol clipplane status 0 1 top {0} +mol clipplane center 1 1 top {0.0 0.0 0.0} +mol clipplane color 1 1 top {0.5 0.5 0.5 } +mol clipplane normal 1 1 top {0.0 0.0 1.0} +mol clipplane status 1 1 top {0} +mol clipplane center 2 1 top {0.0 0.0 0.0} +mol clipplane color 2 1 top {0.5 0.5 0.5 } +mol clipplane normal 2 1 top {0.0 0.0 1.0} +mol clipplane status 2 1 top {0} +mol clipplane center 3 1 top {0.0 0.0 0.0} +mol clipplane color 3 1 top {0.5 0.5 0.5 } +mol clipplane normal 3 1 top {0.0 0.0 1.0} +mol clipplane status 3 1 top {0} +mol clipplane center 4 1 top {0.0 0.0 0.0} +mol clipplane color 4 1 top {0.5 0.5 0.5 } +mol clipplane normal 4 1 top {0.0 0.0 1.0} +mol clipplane status 4 1 top {0} +mol clipplane center 5 1 top {0.0 0.0 0.0} +mol clipplane color 5 1 top {0.5 0.5 0.5 } +mol clipplane normal 5 1 top {0.0 0.0 1.0} +mol clipplane status 5 1 top {0} +mol representation DynamicBonds 3.000000 0.300000 12.000000 +mol color ColorID 1 +mol selection {name O} +mol material Opaque +mol addrep top +mol selupdate 2 top 0 +mol colupdate 2 top 0 +mol scaleminmax top 2 0.000000 0.000000 +mol smoothrep top 2 0 +mol drawframes top 2 {now} +mol clipplane center 0 2 top {0.0 0.0 0.0} +mol clipplane color 0 2 top {0.5 0.5 0.5 } +mol clipplane normal 0 2 top {0.0 0.0 1.0} +mol clipplane status 0 2 top {0} +mol clipplane center 1 2 top {0.0 0.0 0.0} +mol clipplane color 1 2 top {0.5 0.5 0.5 } +mol clipplane normal 1 2 top {0.0 0.0 1.0} +mol clipplane status 1 2 top {0} +mol clipplane center 2 2 top {0.0 0.0 0.0} +mol clipplane color 2 2 top {0.5 0.5 0.5 } +mol clipplane normal 2 2 top {0.0 0.0 1.0} +mol clipplane status 2 2 top {0} +mol clipplane center 3 2 top {0.0 0.0 0.0} +mol clipplane color 3 2 top {0.5 0.5 0.5 } +mol clipplane normal 3 2 top {0.0 0.0 1.0} +mol clipplane status 3 2 top {0} +mol clipplane center 4 2 top {0.0 0.0 0.0} +mol clipplane color 4 2 top {0.5 0.5 0.5 } +mol clipplane normal 4 2 top {0.0 0.0 1.0} +mol clipplane status 4 2 top {0} +mol clipplane center 5 2 top {0.0 0.0 0.0} +mol clipplane color 5 2 top {0.5 0.5 0.5 } +mol clipplane normal 5 2 top {0.0 0.0 1.0} +mol clipplane status 5 2 top {0} +mol rename top t1.xyz +set viewpoints([molinfo top]) {{{1 0 0 -1.08329e-05} {0 1 0 -8.82149e-06} {0 0 1 1.73273} {0 0 0 1}} {{-0.455479 -0.89023 -0.00523547 0} {-0.00931668 -0.00111363 0.999955 0} {-0.890196 0.455507 -0.00778734 0} {0 0 0 1}} {{0.0946611 0 0 0} {0 0.0946611 0 0} {0 0 0.0946611 0} {0 0 0 1}} {{1 0 0 0} {0 1 0 0} {0 0 1 0} {0 0 0 1}}} +lappend viewplist [molinfo top] +set topmol [molinfo top] +# done with molecule 1 +foreach v $viewplist { + molinfo $v set {center_matrix rotate_matrix scale_matrix global_matrix} $viewpoints($v) +} +foreach v $fixedlist { + molinfo $v set fixed 1 +} +unset viewplist +unset fixedlist +mol top $topmol +unset topmol +proc vmdrestoremycolors {} { +color scale colors RWB {1.0 0.0 0.0} {1.0 1.0 1.0} {0.0 0.0 1.0} +color scale colors BWR {0.0 0.0 1.0} {1.0 1.0 1.0} {1.0 0.0 0.0} +color scale colors RGryB {1.0 0.0 0.0} {0.5 0.5 0.5} {0.0 0.0 1.0} +color scale colors BGryR {0.0 0.0 1.0} {0.5 0.5 0.5} {1.0 0.0 0.0} +color scale colors RGB {1.0 0.0 0.0} {0.0 1.0 0.0} {0.0 0.0 1.0} +color scale colors BGR {0.0 0.0 1.0} {0.0 1.0 0.0} {1.0 0.0 0.0} +color scale colors RWG {1.0 0.0 0.0} {1.0 1.0 1.0} {0.0 1.0 0.0} +color scale colors GWR {0.0 1.0 0.0} {1.0 1.0 1.0} {1.0 0.0 0.0} +color scale colors GWB {0.0 1.0 0.0} {1.0 1.0 1.0} {0.0 0.0 1.0} +color scale colors BWG {0.0 0.0 1.0} {1.0 1.0 1.0} {0.0 1.0 0.0} +color scale colors BlkW {0.0 0.0 0.0} {0.5 0.5 0.5} {1.0 1.0 1.0} +color scale colors WBlk {1.0 1.0 1.0} {0.5 0.5 0.5} {0.0 0.0 0.0} + color scale method RWB + set colorcmds { + {color Display {Background} white} + {color Display {BackgroundTop} black} + {color Display {BackgroundBot} blue2} + {color Display {FPS} white} + {color Name {C} silver} + {color Name {LPA} green} + {color Name {LPB} green} + {color Name {A} pink} + {color Type {LP} green} + {color Type {DRUD} pink} + {color Type {A} pink} + {color Element {X} cyan} + {color Element {Ac} ochre} + {color Element {Ag} ochre} + {color Element {Al} ochre} + {color Element {Am} ochre} + {color Element {Ar} ochre} + {color Element {As} ochre} + {color Element {At} ochre} + {color Element {Au} ochre} + {color Element {B} ochre} + {color Element {Ba} ochre} + {color Element {Be} ochre} + {color Element {Bh} ochre} + {color Element {Bi} ochre} + {color Element {Bk} ochre} + {color Element {Br} ochre} + {color Element {C} silver} + {color Element {Ca} ochre} + {color Element {Cd} ochre} + {color Element {Ce} ochre} + {color Element {Cf} ochre} + {color Element {Cl} ochre} + {color Element {Cm} ochre} + {color Element {Co} blue} + {color Element {Cr} ochre} + {color Element {Cs} ochre} + {color Element {Cu} ochre} + {color Element {Db} ochre} + {color Element {Ds} ochre} + {color Element {Dy} ochre} + {color Element {Er} ochre} + {color Element {Es} ochre} + {color Element {Eu} ochre} + {color Element {F} ochre} + {color Element {Fe} ochre} + {color Element {Fm} ochre} + {color Element {Fr} ochre} + {color Element {Ga} ochre} + {color Element {Gd} ochre} + {color Element {Ge} ochre} + {color Element {He} ochre} + {color Element {Hf} ochre} + {color Element {Hg} ochre} + {color Element {Ho} ochre} + {color Element {Hs} ochre} + {color Element {I} ochre} + {color Element {In} ochre} + {color Element {Ir} ochre} + {color Element {K} ochre} + {color Element {Kr} ochre} + {color Element {La} ochre} + {color Element {Li} ochre} + {color Element {Lr} ochre} + {color Element {Lu} ochre} + {color Element {Md} ochre} + {color Element {Mg} ochre} + {color Element {Mn} ochre} + {color Element {Mo} ochre} + {color Element {Mt} ochre} + {color Element {Na} ochre} + {color Element {Nb} ochre} + {color Element {Nd} ochre} + {color Element {Ne} ochre} + {color Element {Ni} ochre} + {color Element {No} ochre} + {color Element {Np} ochre} + {color Element {Os} ochre} + {color Element {Pa} ochre} + {color Element {Pb} ochre} + {color Element {Pd} ochre} + {color Element {Pm} ochre} + {color Element {Po} ochre} + {color Element {Pr} ochre} + {color Element {Pt} ochre} + {color Element {Pu} ochre} + {color Element {Ra} ochre} + {color Element {Rb} ochre} + {color Element {Re} ochre} + {color Element {Rf} ochre} + {color Element {Rg} ochre} + {color Element {Rh} ochre} + {color Element {Rn} ochre} + {color Element {Ru} ochre} + {color Element {Sb} ochre} + {color Element {Sc} ochre} + {color Element {Se} ochre} + {color Element {Sg} ochre} + {color Element {Si} ochre} + {color Element {Sm} ochre} + {color Element {Sn} ochre} + {color Element {Sr} ochre} + {color Element {Ta} ochre} + {color Element {Tb} ochre} + {color Element {Tc} ochre} + {color Element {Te} ochre} + {color Element {Th} ochre} + {color Element {Ti} ochre} + {color Element {Tl} ochre} + {color Element {Tm} ochre} + {color Element {U} ochre} + {color Element {V} ochre} + {color Element {W} ochre} + {color Element {Xe} ochre} + {color Element {Y} ochre} + {color Element {Yb} ochre} + {color Element {Zr} ochre} + {color Resname {} silver} + {color Chain {X} blue} + {color Segname {} blue} + {color Conformation {all} blue} + {color Molecule {0} blue} + {color Molecule {1} red} + {color Structure {3_10_Helix} blue} + {color Surface {Grasp} gray} + {color Labels {Bonds} blue} + {color Labels {Springs} orange} + {color Stage {Even} gray} + {color Stage {Odd} silver} + } + foreach colcmd $colorcmds { + set val [catch {eval $colcmd}] + } + color change rgb 0 0.0 0.0 1.0 + color change rgb 2 0.3499999940395355 0.3499999940395355 0.3499999940395355 + color change rgb 3 1.0 0.5 0.0 + color change rgb 4 1.0 1.0 0.0 + color change rgb 5 0.5 0.5 0.20000000298023224 + color change rgb 6 0.6000000238418579 0.6000000238418579 0.6000000238418579 + color change rgb 7 0.0 1.0 0.0 + color change rgb 9 1.0 0.6000000238418579 0.6000000238418579 + color change rgb 11 0.6499999761581421 0.0 0.6499999761581421 + color change rgb 12 0.5 0.8999999761581421 0.4000000059604645 + color change rgb 13 0.8999999761581421 0.4000000059604645 0.699999988079071 + color change rgb 14 0.5 0.30000001192092896 0.0 + color change rgb 15 0.5 0.5 0.75 + color change rgb 17 0.8799999952316284 0.9700000286102295 0.019999999552965164 + color change rgb 18 0.550000011920929 0.8999999761581421 0.019999999552965164 + color change rgb 19 0.0 0.8999999761581421 0.03999999910593033 + color change rgb 20 0.0 0.8999999761581421 0.5 + color change rgb 21 0.0 0.8799999952316284 1.0 + color change rgb 22 0.0 0.7599999904632568 1.0 + color change rgb 23 0.019999999552965164 0.3799999952316284 0.6700000166893005 + color change rgb 24 0.009999999776482582 0.03999999910593033 0.9300000071525574 + color change rgb 25 0.27000001072883606 0.0 0.9800000190734863 + color change rgb 26 0.44999998807907104 0.0 0.8999999761581421 + color change rgb 27 0.8999999761581421 0.0 0.8999999761581421 + color change rgb 28 1.0 0.0 0.6600000262260437 + color change rgb 29 0.9800000190734863 0.0 0.23000000417232513 + color change rgb 30 0.8100000023841858 0.0 0.0 + color change rgb 31 0.8899999856948853 0.3499999940395355 0.0 + color change rgb 32 0.9599999785423279 0.7200000286102295 0.0 +} +vmdrestoremycolors +label textsize 1.0 diff --git a/tools/rotate/transformations.py b/tools/align/others/transformations.py similarity index 100% rename from tools/rotate/transformations.py rename to tools/align/others/transformations.py diff --git a/tools/align/v1/au.xyz b/tools/align/v1/au.xyz new file mode 100644 index 0000000..20a8bbe --- /dev/null +++ b/tools/align/v1/au.xyz @@ -0,0 +1,7 @@ +5 + + Au 5.0 5.0 1.0 + Au 5.0 -5.0 1.0 + Au -5.0 5.0 1.0 + Au -5.0 -5.0 1.0 + Au 0.0 0.0 1.0 diff --git a/tools/align/v1/nano.xyz b/tools/align/v1/nano.xyz new file mode 100644 index 0000000..82b3a0f --- /dev/null +++ b/tools/align/v1/nano.xyz @@ -0,0 +1,84 @@ +82 +Nanocluster +Pt 4.303200 10.058001 5.519400 +Pt 5.532200 9.051200 3.205000 +Pt 1.845400 12.071800 10.148200 +Pt 3.074400 11.065001 7.833800 +Pt 5.597800 11.509000 8.980600 +Pt 6.826800 10.502000 6.666200 +Pt 8.055600 9.495200 4.351800 +Pt 9.284600 8.488199 2.037400 +Pt 11.808000 8.932200 3.184200 +Pt 9.350201 10.945999 7.813000 +Pt 10.579200 9.939200 5.498600 +Pt 13.102799 10.383200 6.645400 +Pt 14.331599 9.376200 4.331000 +Pt 16.855200 9.820200 5.477800 +Pt 3.140000 13.522600 13.609400 +Pt 4.369000 12.515800 11.295000 +Pt 6.892400 12.959800 12.441799 +Pt 8.121400 11.953000 10.127400 +Pt 5.663600 13.966599 14.756201 +Pt 8.187200 14.410600 15.903000 +Pt 9.416000 13.403799 13.588600 +Pt 10.710600 14.854601 17.049801 +Pt 10.645000 12.396801 11.274199 +Pt 11.873799 11.390000 8.959800 +Pt 14.397400 11.834001 10.106601 +Pt 15.626201 10.827200 7.792200 +Pt 18.149799 11.271000 8.939000 +Pt 11.939600 13.847800 14.735399 +Pt 13.168401 12.840800 12.421000 +Pt 15.692000 13.284800 13.567801 +Pt 16.920799 12.278000 11.253400 +Pt 14.463000 14.291800 15.882200 +Pt 6.147400 7.950400 5.713000 +Pt 3.689600 9.964200 10.341801 +Pt 4.918600 8.957399 8.027400 +Pt 7.442000 9.401400 9.174200 +Pt 7.376400 6.943600 3.398600 +Pt 9.899799 7.387600 4.545400 +Pt 8.671000 8.394400 6.859800 +Pt 11.194400 8.838400 8.006600 +Pt 12.423400 7.831600 5.692200 +Pt 14.947000 8.275600 6.839000 +Pt 2.460800 10.971201 12.656200 +Pt 4.984200 11.415200 13.803000 +Pt 6.213200 10.408200 11.488600 +Pt 8.736600 10.852200 12.635401 +Pt 7.507800 11.859200 14.949800 +Pt 10.031400 12.302999 16.096600 +Pt 9.965600 9.845400 10.320999 +Pt 12.489200 10.289400 11.467800 +Pt 13.717999 9.282400 9.153400 +Pt 16.241600 9.726399 10.300200 +Pt 17.470400 8.719600 7.985800 +Pt 11.260200 11.296200 13.782200 +Pt 13.783799 11.740200 14.929000 +Pt 15.012600 10.733400 12.614599 +Pt 12.554800 12.747001 17.243401 +Pt 5.533800 7.856600 10.535601 +Pt 6.762800 6.849800 8.221200 +Pt 7.991600 5.842800 5.906800 +Pt 9.286200 7.293800 9.368000 +Pt 10.515200 6.286800 7.053600 +Pt 13.038599 6.730800 8.200399 +Pt 4.305000 8.863600 12.849999 +Pt 6.828400 9.307600 13.996600 +Pt 8.057400 8.300600 11.682400 +Pt 9.351999 9.751600 15.143400 +Pt 10.580799 8.744600 12.829000 +Pt 11.809799 7.737800 10.514801 +Pt 14.333400 8.181800 11.661400 +Pt 15.562201 7.174800 9.347000 +Pt 11.875401 10.195600 16.290199 +Pt 13.104400 9.188601 13.975801 +Pt 7.378000 5.749000 10.729199 +Pt 8.607000 4.742200 8.414801 +Pt 11.130400 5.186200 9.561600 +Pt 6.149200 6.756000 13.043600 +Pt 8.672600 7.200000 14.190399 +Pt 9.901600 6.193000 11.876000 +Pt 12.424999 6.637000 13.022799 +Pt 13.653999 5.630200 10.708400 +Pt 11.196199 7.644000 15.337200 diff --git a/tools/align/v1/output.xyz b/tools/align/v1/output.xyz new file mode 100644 index 0000000..c17d109 --- /dev/null +++ b/tools/align/v1/output.xyz @@ -0,0 +1,104 @@ +102 + +Au -5.6944 -1.6134 -4.0242 +Au -4.4654 -2.6203 -6.3386 +Au -8.1522 0.4003 0.6046 +Au -6.9232 -0.6064 -1.7098 +Au -4.3998 -0.1625 -0.5630 +Au -3.1708 -1.1695 -2.8774 +Au -1.9420 -2.1763 -5.1918 +Au -0.7130 -3.1833 -7.5062 +Au 1.8104 -2.7393 -6.3594 +Au -0.6474 -0.7255 -1.7306 +Au 0.5816 -1.7323 -4.0450 +Au 3.1052 -1.2883 -2.8982 +Au 4.3340 -2.2953 -5.2126 +Au 6.8576 -1.8513 -4.0658 +Au -6.8576 1.8511 4.0658 +Au -5.6286 0.8443 1.7514 +Au -3.1052 1.2883 2.8982 +Au -1.8762 0.2815 0.5838 +Au -4.3340 2.2951 5.2126 +Au -1.8104 2.7391 6.3594 +Au -0.5816 1.7323 4.0450 +Au 0.7130 3.1832 7.5062 +Au 0.6474 0.7254 1.7306 +Au 1.8762 -0.2815 -0.5838 +Au 4.3998 0.1626 0.5630 +Au 5.6286 -0.8443 -1.7514 +Au 8.1522 -0.4005 -0.6046 +Au 1.9420 2.1763 5.1918 +Au 3.1708 1.1693 2.8774 +Au 5.6944 1.6133 4.0242 +Au 6.9232 0.6065 1.7098 +Au 4.4654 2.6203 6.3386 +Au -3.8502 -3.7211 -3.8306 +Au -6.3080 -1.7073 0.7982 +Au -5.0790 -2.7141 -1.5162 +Au -2.5556 -2.2701 -0.3694 +Au -2.6212 -4.7279 -6.1450 +Au -0.0978 -4.2839 -4.9982 +Au -1.3266 -3.2771 -2.6838 +Au 1.1968 -2.8331 -1.5370 +Au 2.4258 -3.8399 -3.8514 +Au 4.9494 -3.3959 -2.7046 +Au -7.5368 -0.7002 3.1126 +Au -5.0134 -0.2563 4.2594 +Au -3.7844 -1.2633 1.9450 +Au -1.2610 -0.8193 3.0918 +Au -2.4898 0.1877 5.4062 +Au 0.0338 0.6315 6.5530 +Au -0.0320 -1.8261 0.7774 +Au 2.4916 -1.3821 1.9242 +Au 3.7204 -2.3891 -0.3902 +Au 6.2440 -1.9451 0.7566 +Au 7.4728 -2.9519 -1.5578 +Au 1.2626 -0.3753 4.2386 +Au 3.7862 0.0687 5.3854 +Au 5.0150 -0.9381 3.0710 +Au 2.5572 1.0756 7.6998 +Au -4.4638 -3.8149 0.9920 +Au -3.2348 -4.8217 -1.3224 +Au -2.0060 -5.8287 -3.6368 +Au -0.7114 -4.3777 -0.1756 +Au 0.5176 -5.3847 -2.4900 +Au 3.0410 -4.9407 -1.3432 +Au -5.6926 -2.8079 3.3064 +Au -3.1692 -2.3639 4.4530 +Au -1.9402 -3.3709 2.1388 +Au -0.6456 -1.9199 5.5998 +Au 0.5832 -2.9269 3.2854 +Au 1.8122 -3.9337 0.9712 +Au 4.3358 -3.4897 2.1178 +Au 5.5646 -4.4967 -0.1966 +Au 1.8778 -1.4759 6.7466 +Au 3.1068 -2.4828 4.4322 +Au -2.6196 -5.9225 1.1856 +Au -1.3906 -6.9293 -1.1288 +Au 1.1328 -6.4853 0.0180 +Au -3.8484 -4.9155 3.5000 +Au -1.3250 -4.4715 4.6468 +Au -0.0960 -5.4785 2.3324 +Au 2.4274 -5.0345 3.4792 +Au 3.6564 -6.0413 1.1648 +Au 1.1986 -4.0275 5.7936 +O 0 0 -10.0000 +O 0 0 -9.0000 +O 0 0 -8.0000 +O 0 0 -7.0000 +O 0 0 -6.0000 +O 0 0 -5.0000 +O 0 0 -4.0000 +O 0 0 -3.0000 +O 0 0 -2.0000 +O 0 0 -1.0000 +O 0 0 0.0000 +O 0 0 1.0000 +O 0 0 2.0000 +O 0 0 3.0000 +O 0 0 4.0000 +O 0 0 5.0000 +O 0 0 6.0000 +O 0 0 7.0000 +O 0 0 8.0000 +O 0 0 9.0000 diff --git a/tools/align/v1/plannar.xyz b/tools/align/v1/plannar.xyz new file mode 100644 index 0000000..587fbc7 --- /dev/null +++ b/tools/align/v1/plannar.xyz @@ -0,0 +1,66 @@ +64 + +Au -5.6944 -1.6134 -4.0242 +Fe -5.6944 -1.6134 -4.0243 +Au -4.4654 -2.6203 -6.3386 +Fe -4.4654 -2.6203 -6.3385 +Au -8.1522 0.4003 0.6046 +Fe -8.1522 0.4003 0.6046 +Au -6.9232 -0.6064 -1.7098 +Fe -6.9232 -0.6064 -1.7096 +Au -4.3998 -0.1625 -0.5630 +Fe -4.3998 -0.1625 -0.5628 +Au -3.1708 -1.1695 -2.8774 +Fe -3.1708 -1.1695 -2.8775 +Au -1.9420 -2.1763 -5.1918 +Fe -1.9420 -2.1763 -5.1917 +Au -0.7130 -3.1833 -7.5062 +Fe -0.7130 -3.1833 -7.5064 +Au 1.8104 -2.7393 -6.3594 +Fe 1.8104 -2.7393 -6.3595 +Au -0.6474 -0.7255 -1.7306 +Fe -0.6474 -0.7255 -1.7307 +Au 0.5816 -1.7323 -4.0450 +Fe 0.5816 -1.7323 -4.0449 +Au 3.1052 -1.2883 -2.8982 +Fe 3.1052 -1.2883 -2.8980 +Au 4.3340 -2.2953 -5.2126 +Fe 4.3340 -2.2953 -5.2127 +Au 6.8576 -1.8513 -4.0658 +Fe 6.8576 -1.8513 -4.0659 +Au -6.8576 1.8511 4.0658 +Fe -6.8576 1.8511 4.0656 +Au -5.6286 0.8443 1.7514 +Fe -5.6286 0.8443 1.7514 +Au -3.1052 1.2883 2.8982 +Fe -3.1052 1.2883 2.8982 +Au -1.8762 0.2815 0.5838 +Fe -1.8762 0.2815 0.5840 +Au -4.3340 2.2951 5.2126 +Fe -4.3340 2.2951 5.2125 +Au -1.8104 2.7391 6.3594 +Fe -1.8104 2.7391 6.3593 +Au -0.5816 1.7323 4.0450 +Fe -0.5816 1.7323 4.0451 +Au 0.7130 3.1832 7.5062 +Fe 0.7130 3.1832 7.5061 +Au 0.6474 0.7254 1.7306 +Fe 0.6474 0.7254 1.7304 +Au 1.8762 -0.2815 -0.5838 +Fe 1.8762 -0.2815 -0.5838 +Au 4.3998 0.1626 0.5630 +Fe 4.3998 0.1626 0.5630 +Au 5.6286 -0.8443 -1.7514 +Fe 5.6286 -0.8443 -1.7512 +Au 8.1522 -0.4005 -0.6046 +Fe 8.1522 -0.4005 -0.6048 +Au 1.9420 2.1763 5.1918 +Fe 1.9420 2.1763 5.1919 +Au 3.1708 1.1693 2.8774 +Fe 3.1708 1.1693 2.8772 +Au 5.6944 1.6133 4.0242 +Fe 5.6944 1.6133 4.0241 +Au 6.9232 0.6065 1.7098 +Fe 6.9232 0.6065 1.7099 +Au 4.4654 2.6203 6.3386 +Fe 4.4654 2.6203 6.3388 diff --git a/tools/align/v1/t0.xyz b/tools/align/v1/t0.xyz new file mode 100644 index 0000000..3ea93d3 --- /dev/null +++ b/tools/align/v1/t0.xyz @@ -0,0 +1,54 @@ +52 + +Au -5.6944 -1.6134 -4.0242 +Au -4.4654 -2.6203 -6.3386 +Au -8.1522 0.4003 0.6046 +Au -6.9232 -0.6064 -1.7098 +Au -4.3998 -0.1625 -0.5630 +Au -3.1708 -1.1695 -2.8774 +Au -1.9420 -2.1763 -5.1918 +Au -0.7130 -3.1833 -7.5062 +Au 1.8104 -2.7393 -6.3594 +Au -0.6474 -0.7255 -1.7306 +Au 0.5816 -1.7323 -4.0450 +Au 3.1052 -1.2883 -2.8982 +Au 4.3340 -2.2953 -5.2126 +Au 6.8576 -1.8513 -4.0658 +Au -6.8576 1.8511 4.0658 +Au -5.6286 0.8443 1.7514 +Au -3.1052 1.2883 2.8982 +Au -1.8762 0.2815 0.5838 +Au -4.3340 2.2951 5.2126 +Au -1.8104 2.7391 6.3594 +Au -0.5816 1.7323 4.0450 +Au 0.7130 3.1832 7.5062 +Au 0.6474 0.7254 1.7306 +Au 1.8762 -0.2815 -0.5838 +Au 4.3998 0.1626 0.5630 +Au 5.6286 -0.8443 -1.7514 +Au 8.1522 -0.4005 -0.6046 +Au 1.9420 2.1763 5.1918 +Au 3.1708 1.1693 2.8774 +Au 5.6944 1.6133 4.0242 +Au 6.9232 0.6065 1.7098 +Au 4.4654 2.6203 6.3386 +O 0 0 -10.0000 +O 0 0 -9.0000 +O 0 0 -8.0000 +O 0 0 -7.0000 +O 0 0 -6.0000 +O 0 0 -5.0000 +O 0 0 -4.0000 +O 0 0 -3.0000 +O 0 0 -2.0000 +O 0 0 -1.0000 +O 0 0 0.0000 +O 0 0 1.0000 +O 0 0 2.0000 +O 0 0 3.0000 +O 0 0 4.0000 +O 0 0 5.0000 +O 0 0 6.0000 +O 0 0 7.0000 +O 0 0 8.0000 +O 0 0 9.0000 diff --git a/tools/align/v1/t1.xyz b/tools/align/v1/t1.xyz new file mode 100644 index 0000000..3e313bf --- /dev/null +++ b/tools/align/v1/t1.xyz @@ -0,0 +1,54 @@ +52 + +Au -5.7175 -2.9320 3.1523 +Au -4.5018 -4.6972 4.9652 +Au -8.1487 0.5985 -0.4736 +Au -6.9330 -1.1668 1.3393 +Au -4.4030 -0.3470 0.4409 +Au -3.1873 -2.1122 2.2540 +Au -1.9718 -3.8775 4.0669 +Au -0.7561 -5.6426 5.8799 +Au 1.7739 -4.8229 4.9816 +Au -0.6573 -1.2925 1.3557 +Au 0.5584 -3.0577 3.1685 +Au 3.0885 -2.2380 2.2702 +Au 4.3040 -4.0032 4.0832 +Au 6.8342 -3.1834 3.1849 +Au -6.8342 3.1835 -3.1848 +Au -5.6185 1.4182 -1.3719 +Au -3.0885 2.2380 -2.2703 +Au -1.8728 0.4727 -0.4574 +Au -4.3040 4.0032 -4.0831 +Au -1.7739 4.8229 -4.9815 +Au -0.5584 3.0577 -3.1686 +Au 0.7561 5.6427 -5.8798 +Au 0.6573 1.2925 -1.3556 +Au 1.8728 -0.4727 0.4573 +Au 4.4030 0.3470 -0.4410 +Au 5.6185 -1.4183 1.3718 +Au 8.1487 -0.5984 0.4737 +Au 1.9718 3.8774 -4.0669 +Au 3.1873 2.1123 -2.2539 +Au 5.7175 2.9320 -3.1522 +Au 6.9330 1.1667 -1.3394 +Au 4.5018 4.6972 -4.9653 +O 0 0 -10.0000 +O 0 0 -9.0000 +O 0 0 -8.0000 +O 0 0 -7.0000 +O 0 0 -6.0000 +O 0 0 -5.0000 +O 0 0 -4.0000 +O 0 0 -3.0000 +O 0 0 -2.0000 +O 0 0 -1.0000 +O 0 0 0.0000 +O 0 0 1.0000 +O 0 0 2.0000 +O 0 0 3.0000 +O 0 0 4.0000 +O 0 0 5.0000 +O 0 0 6.0000 +O 0 0 7.0000 +O 0 0 8.0000 +O 0 0 9.0000 diff --git a/tools/align/v1/t2/align.py b/tools/align/v1/t2/align.py new file mode 100644 index 0000000..c5e920a --- /dev/null +++ b/tools/align/v1/t2/align.py @@ -0,0 +1,133 @@ +""" +""" + +import math +import numpy as np +import scipy.linalg + +DEBUG = 0 + +def read_coords(fname): + f = open(fname, "r") + lines = f.readlines() + coords = [] + for i in range(2, len(lines)): + tokens = lines[i].strip().split() + if len(tokens) > 0: + coords.append([float(j) for j in tokens[1:]]) + return coords + +def get_surface_atoms(coords): + sur = [] + for i in range(32): + sur.append(coords[i]) + return sur + +def get_com(coords): + com = [0.0, 0.0, 0.0] + for i in range(len(coords)): + for j in range(3): + com[j] += coords[i][j] + for i in range(3): + com[i] = com[i]/len(coords) + + return com + +def center_coords(coords, s): + coords_new = [] + for i in range(len(coords)): + coords_new.append([]) + for j in range(3): + coords_new[i].append(coords[i][j] - s[j]) + return coords_new + +def fit_plannar(coords): + # regular grid covering the domain of the data + data = np.array(coords) + X,Y = np.meshgrid(np.arange(-10.0, 10.0, 1), np.arange(-10.0, 10.0, 1)) + # best-fit linear plane + A = np.c_[data[:,0], data[:,1], np.ones(data.shape[0])] + C,_,_,_ = scipy.linalg.lstsq(A, data[:,2]) # coefficients + if DEBUG: + o = open("plannar.xyz", "w") + o.write("%d\n\n"%(len(coords)*2)) + for i in range(len(coords)): + x = coords[i][0] + y = coords[i][1] + z0 = coords[i][2] + z1 = C[0]*x + C[1]*y + C[2] + o.write("Au %12.4f%12.4f%12.4f\n"%(x, y, z0)) + o.write("Fe %12.4f%12.4f%12.4f\n"%(x, y, z1)) + o.close() + return C + +def align_axis(v1, v2): + w = np.cross(v1,v2) + w = w/np.linalg.norm(w) + w_hat = np.matrix([[ 0, -w[2], w[1]], + [ w[2], 0, -w[0]], + [-w[1], w[0], 0]]) + cos_tht = np.dot(v1, v2)/np.linalg.norm(v1)/np.linalg.norm(v2) + tht = np.arccos(cos_tht) + R = np.identity(3) + w_hat*np.sin(tht) + w_hat*w_hat*(1-np.cos(tht)) + return R + +def rotate_coords(coords, R): + coords_new = [] + for i in range(len(coords)): + coords_new.append(np.dot(R, coords[i]).A1) + return coords_new + +def output_coords(coords, fname): + o = open(fname, "w") + o.write("%d\n\n"%(len(coords)+20)) + for i in range(len(coords)): + o.write("Au ") + for j in range(3): + o.write("%12.4f"%coords[i][j]) + o.write("\n") + for i in range(20): + o.write("O 0 0 %12.4f\n"%(i-10)) + o.close() + +def output_coords_debug(coords, fname, pc): + o = open(fname, "w") + o.write("%d\n\n"%(len(coords)+20)) + for i in range(len(coords)): + o.write("Au ") + for j in range(3): + o.write("%12.4f"%coords[i][j]) + o.write("\n") + for i in range(20): + x = pc[0]*i + y = pc[1]*i + z = -i + o.write("O %12.4f%12.4f%12.4f\n"%(x, y, z)) + o.close() + +def main(): + # read the xyz file + coords = read_coords("input.xyz") + # get the surface atoms + sur = get_surface_atoms(coords) + # calculate the center of mass (com) + com = get_com(sur) + # move the com to zero + sur_zero = center_coords(sur, com) + # determine the surface and surface vector + pc = fit_plannar(sur_zero) + v1 = [pc[0], pc[1], -1] + v0 = [0, 0, 1] # rotate to z axis + coords_zero = center_coords(coords, com) + if DEBUG: + output_coords_debug(coords_zero, "vector.xyz", pc) + # calculate the rotation matrix + R = align_axis(v1, v0) + # apply the rotation + coords_new = rotate_coords(coords_zero, R) + # output the data + output_coords(coords_zero, "t0.xyz") + output_coords(coords_new, "t1.xyz") + +if __name__ == "__main__": + main() diff --git a/tools/align/v1/t2/input.xyz b/tools/align/v1/t2/input.xyz new file mode 100644 index 0000000..82b3a0f --- /dev/null +++ b/tools/align/v1/t2/input.xyz @@ -0,0 +1,84 @@ +82 +Nanocluster +Pt 4.303200 10.058001 5.519400 +Pt 5.532200 9.051200 3.205000 +Pt 1.845400 12.071800 10.148200 +Pt 3.074400 11.065001 7.833800 +Pt 5.597800 11.509000 8.980600 +Pt 6.826800 10.502000 6.666200 +Pt 8.055600 9.495200 4.351800 +Pt 9.284600 8.488199 2.037400 +Pt 11.808000 8.932200 3.184200 +Pt 9.350201 10.945999 7.813000 +Pt 10.579200 9.939200 5.498600 +Pt 13.102799 10.383200 6.645400 +Pt 14.331599 9.376200 4.331000 +Pt 16.855200 9.820200 5.477800 +Pt 3.140000 13.522600 13.609400 +Pt 4.369000 12.515800 11.295000 +Pt 6.892400 12.959800 12.441799 +Pt 8.121400 11.953000 10.127400 +Pt 5.663600 13.966599 14.756201 +Pt 8.187200 14.410600 15.903000 +Pt 9.416000 13.403799 13.588600 +Pt 10.710600 14.854601 17.049801 +Pt 10.645000 12.396801 11.274199 +Pt 11.873799 11.390000 8.959800 +Pt 14.397400 11.834001 10.106601 +Pt 15.626201 10.827200 7.792200 +Pt 18.149799 11.271000 8.939000 +Pt 11.939600 13.847800 14.735399 +Pt 13.168401 12.840800 12.421000 +Pt 15.692000 13.284800 13.567801 +Pt 16.920799 12.278000 11.253400 +Pt 14.463000 14.291800 15.882200 +Pt 6.147400 7.950400 5.713000 +Pt 3.689600 9.964200 10.341801 +Pt 4.918600 8.957399 8.027400 +Pt 7.442000 9.401400 9.174200 +Pt 7.376400 6.943600 3.398600 +Pt 9.899799 7.387600 4.545400 +Pt 8.671000 8.394400 6.859800 +Pt 11.194400 8.838400 8.006600 +Pt 12.423400 7.831600 5.692200 +Pt 14.947000 8.275600 6.839000 +Pt 2.460800 10.971201 12.656200 +Pt 4.984200 11.415200 13.803000 +Pt 6.213200 10.408200 11.488600 +Pt 8.736600 10.852200 12.635401 +Pt 7.507800 11.859200 14.949800 +Pt 10.031400 12.302999 16.096600 +Pt 9.965600 9.845400 10.320999 +Pt 12.489200 10.289400 11.467800 +Pt 13.717999 9.282400 9.153400 +Pt 16.241600 9.726399 10.300200 +Pt 17.470400 8.719600 7.985800 +Pt 11.260200 11.296200 13.782200 +Pt 13.783799 11.740200 14.929000 +Pt 15.012600 10.733400 12.614599 +Pt 12.554800 12.747001 17.243401 +Pt 5.533800 7.856600 10.535601 +Pt 6.762800 6.849800 8.221200 +Pt 7.991600 5.842800 5.906800 +Pt 9.286200 7.293800 9.368000 +Pt 10.515200 6.286800 7.053600 +Pt 13.038599 6.730800 8.200399 +Pt 4.305000 8.863600 12.849999 +Pt 6.828400 9.307600 13.996600 +Pt 8.057400 8.300600 11.682400 +Pt 9.351999 9.751600 15.143400 +Pt 10.580799 8.744600 12.829000 +Pt 11.809799 7.737800 10.514801 +Pt 14.333400 8.181800 11.661400 +Pt 15.562201 7.174800 9.347000 +Pt 11.875401 10.195600 16.290199 +Pt 13.104400 9.188601 13.975801 +Pt 7.378000 5.749000 10.729199 +Pt 8.607000 4.742200 8.414801 +Pt 11.130400 5.186200 9.561600 +Pt 6.149200 6.756000 13.043600 +Pt 8.672600 7.200000 14.190399 +Pt 9.901600 6.193000 11.876000 +Pt 12.424999 6.637000 13.022799 +Pt 13.653999 5.630200 10.708400 +Pt 11.196199 7.644000 15.337200 diff --git a/tools/align/v1/t2/t0.xyz b/tools/align/v1/t2/t0.xyz new file mode 100644 index 0000000..c17d109 --- /dev/null +++ b/tools/align/v1/t2/t0.xyz @@ -0,0 +1,104 @@ +102 + +Au -5.6944 -1.6134 -4.0242 +Au -4.4654 -2.6203 -6.3386 +Au -8.1522 0.4003 0.6046 +Au -6.9232 -0.6064 -1.7098 +Au -4.3998 -0.1625 -0.5630 +Au -3.1708 -1.1695 -2.8774 +Au -1.9420 -2.1763 -5.1918 +Au -0.7130 -3.1833 -7.5062 +Au 1.8104 -2.7393 -6.3594 +Au -0.6474 -0.7255 -1.7306 +Au 0.5816 -1.7323 -4.0450 +Au 3.1052 -1.2883 -2.8982 +Au 4.3340 -2.2953 -5.2126 +Au 6.8576 -1.8513 -4.0658 +Au -6.8576 1.8511 4.0658 +Au -5.6286 0.8443 1.7514 +Au -3.1052 1.2883 2.8982 +Au -1.8762 0.2815 0.5838 +Au -4.3340 2.2951 5.2126 +Au -1.8104 2.7391 6.3594 +Au -0.5816 1.7323 4.0450 +Au 0.7130 3.1832 7.5062 +Au 0.6474 0.7254 1.7306 +Au 1.8762 -0.2815 -0.5838 +Au 4.3998 0.1626 0.5630 +Au 5.6286 -0.8443 -1.7514 +Au 8.1522 -0.4005 -0.6046 +Au 1.9420 2.1763 5.1918 +Au 3.1708 1.1693 2.8774 +Au 5.6944 1.6133 4.0242 +Au 6.9232 0.6065 1.7098 +Au 4.4654 2.6203 6.3386 +Au -3.8502 -3.7211 -3.8306 +Au -6.3080 -1.7073 0.7982 +Au -5.0790 -2.7141 -1.5162 +Au -2.5556 -2.2701 -0.3694 +Au -2.6212 -4.7279 -6.1450 +Au -0.0978 -4.2839 -4.9982 +Au -1.3266 -3.2771 -2.6838 +Au 1.1968 -2.8331 -1.5370 +Au 2.4258 -3.8399 -3.8514 +Au 4.9494 -3.3959 -2.7046 +Au -7.5368 -0.7002 3.1126 +Au -5.0134 -0.2563 4.2594 +Au -3.7844 -1.2633 1.9450 +Au -1.2610 -0.8193 3.0918 +Au -2.4898 0.1877 5.4062 +Au 0.0338 0.6315 6.5530 +Au -0.0320 -1.8261 0.7774 +Au 2.4916 -1.3821 1.9242 +Au 3.7204 -2.3891 -0.3902 +Au 6.2440 -1.9451 0.7566 +Au 7.4728 -2.9519 -1.5578 +Au 1.2626 -0.3753 4.2386 +Au 3.7862 0.0687 5.3854 +Au 5.0150 -0.9381 3.0710 +Au 2.5572 1.0756 7.6998 +Au -4.4638 -3.8149 0.9920 +Au -3.2348 -4.8217 -1.3224 +Au -2.0060 -5.8287 -3.6368 +Au -0.7114 -4.3777 -0.1756 +Au 0.5176 -5.3847 -2.4900 +Au 3.0410 -4.9407 -1.3432 +Au -5.6926 -2.8079 3.3064 +Au -3.1692 -2.3639 4.4530 +Au -1.9402 -3.3709 2.1388 +Au -0.6456 -1.9199 5.5998 +Au 0.5832 -2.9269 3.2854 +Au 1.8122 -3.9337 0.9712 +Au 4.3358 -3.4897 2.1178 +Au 5.5646 -4.4967 -0.1966 +Au 1.8778 -1.4759 6.7466 +Au 3.1068 -2.4828 4.4322 +Au -2.6196 -5.9225 1.1856 +Au -1.3906 -6.9293 -1.1288 +Au 1.1328 -6.4853 0.0180 +Au -3.8484 -4.9155 3.5000 +Au -1.3250 -4.4715 4.6468 +Au -0.0960 -5.4785 2.3324 +Au 2.4274 -5.0345 3.4792 +Au 3.6564 -6.0413 1.1648 +Au 1.1986 -4.0275 5.7936 +O 0 0 -10.0000 +O 0 0 -9.0000 +O 0 0 -8.0000 +O 0 0 -7.0000 +O 0 0 -6.0000 +O 0 0 -5.0000 +O 0 0 -4.0000 +O 0 0 -3.0000 +O 0 0 -2.0000 +O 0 0 -1.0000 +O 0 0 0.0000 +O 0 0 1.0000 +O 0 0 2.0000 +O 0 0 3.0000 +O 0 0 4.0000 +O 0 0 5.0000 +O 0 0 6.0000 +O 0 0 7.0000 +O 0 0 8.0000 +O 0 0 9.0000 diff --git a/tools/align/v1/t2/t1.xyz b/tools/align/v1/t2/t1.xyz new file mode 100644 index 0000000..f9ad882 --- /dev/null +++ b/tools/align/v1/t2/t1.xyz @@ -0,0 +1,104 @@ +102 + +Au -5.5877 4.4723 -0.0000 +Au -4.2973 6.9654 0.0000 +Au -8.1682 -0.5139 -0.0000 +Au -6.8779 1.9791 0.0001 +Au -4.3849 0.6888 0.0001 +Au -3.0945 3.1820 -0.0000 +Au -1.8043 5.6751 0.0000 +Au -0.5139 8.1683 -0.0001 +Au 1.9791 6.8780 -0.0001 +Au -0.6015 1.8917 -0.0000 +Au 0.6889 4.3848 0.0001 +Au 3.1821 3.0945 0.0001 +Au 4.4722 5.5877 -0.0000 +Au 6.9654 4.2974 -0.0000 +Au -6.9654 -4.2973 -0.0001 +Au -5.6750 -1.8042 0.0000 +Au -3.1821 -3.0945 0.0000 +Au -1.8917 -0.6015 0.0001 +Au -4.4722 -5.5876 -0.0001 +Au -1.9791 -6.8779 -0.0000 +Au -0.6889 -4.3848 0.0000 +Au 0.5139 -8.1682 -0.0000 +Au 0.6015 -1.8917 -0.0001 +Au 1.8917 0.6014 -0.0000 +Au 4.3849 -0.6889 0.0000 +Au 5.6750 1.8042 0.0001 +Au 8.1682 0.5140 -0.0001 +Au 1.8043 -5.6751 0.0001 +Au 3.0945 -3.1820 -0.0001 +Au 5.5877 -4.4723 -0.0000 +Au 6.8779 -1.9792 0.0000 +Au 4.2973 -6.9654 0.0001 +Au -3.6960 5.0738 -1.9850 +Au -6.2765 0.0875 -1.9850 +Au -4.9861 2.5806 -1.9849 +Au -2.4932 1.2903 -1.9849 +Au -2.4056 7.5669 -1.9850 +Au 0.0874 6.2766 -1.9850 +Au -1.2028 3.7835 -1.9850 +Au 1.2902 2.4932 -1.9850 +Au 2.5806 4.9863 -1.9849 +Au 5.0738 3.6960 -1.9849 +Au -7.5667 -2.4056 -1.9849 +Au -5.0737 -3.6959 -1.9849 +Au -3.7833 -1.2028 -1.9850 +Au -1.2904 -2.4931 -1.9850 +Au -2.5805 -4.9862 -1.9849 +Au -0.0873 -6.2764 -1.9850 +Au 0.0000 0.0000 -1.9849 +Au 2.4932 -1.2903 -1.9849 +Au 3.7834 1.2029 -1.9850 +Au 6.2766 -0.0874 -1.9850 +Au 7.5668 2.4057 -1.9849 +Au 1.2028 -3.7834 -1.9850 +Au 3.6960 -5.0737 -1.9849 +Au 4.9862 -2.5806 -1.9849 +Au 2.4056 -7.5667 -1.9850 +Au -4.3848 0.6888 -3.9701 +Au -3.0944 3.1819 -3.9700 +Au -1.8043 5.6751 -3.9701 +Au -0.6015 1.8916 -3.9700 +Au 0.6889 4.3848 -3.9701 +Au 3.1819 3.0945 -3.9701 +Au -5.6750 -1.8044 -3.9700 +Au -3.1820 -3.0945 -3.9699 +Au -1.8916 -0.6015 -3.9701 +Au -0.6888 -4.3848 -3.9699 +Au 0.6014 -1.8916 -3.9700 +Au 1.8917 0.6013 -3.9700 +Au 4.3849 -0.6888 -3.9699 +Au 5.6751 1.8044 -3.9700 +Au 1.8042 -5.6751 -3.9698 +Au 3.0945 -3.1819 -3.9700 +Au -2.4931 1.2903 -5.9551 +Au -1.2027 3.7834 -5.9550 +Au 1.2903 2.4931 -5.9550 +Au -3.7833 -1.2029 -5.9550 +Au -1.2903 -2.4932 -5.9549 +Au 0.0001 -0.0000 -5.9551 +Au 2.4931 -1.2903 -5.9550 +Au 3.7834 1.2028 -5.9550 +Au 1.2029 -3.7835 -5.9549 +O 0 0 -10.0000 +O 0 0 -9.0000 +O 0 0 -8.0000 +O 0 0 -7.0000 +O 0 0 -6.0000 +O 0 0 -5.0000 +O 0 0 -4.0000 +O 0 0 -3.0000 +O 0 0 -2.0000 +O 0 0 -1.0000 +O 0 0 0.0000 +O 0 0 1.0000 +O 0 0 2.0000 +O 0 0 3.0000 +O 0 0 4.0000 +O 0 0 5.0000 +O 0 0 6.0000 +O 0 0 7.0000 +O 0 0 8.0000 +O 0 0 9.0000 diff --git a/tools/align/v1/test.py b/tools/align/v1/test.py new file mode 100644 index 0000000..2918470 --- /dev/null +++ b/tools/align/v1/test.py @@ -0,0 +1,127 @@ +import math +import numpy as np +import scipy.linalg + +def read_coords(): + f = open("test.xyz", "r") + lines = f.readlines() + coords = [] + for i in range(2, len(lines)): + tokens = lines[i].strip().split() + if len(tokens) > 0: + coords.append([float(j) for j in tokens[1:]]) + return coords + +def get_surface_atoms(coords): + sur = [] + for i in range(32): + sur.append(coords[i]) + return sur + +def get_com(coords): + com = [0.0, 0.0, 0.0] + for i in range(len(coords)): + for j in range(3): + com[j] += coords[i][j] + for i in range(3): + com[i] = com[i]/len(coords) + + return com + +def center_coords(coords, s): + coords_new = [] + for i in range(len(coords)): + coords_new.append([]) + for j in range(3): + coords_new[i].append(coords[i][j] - s[j]) + return coords_new + +def fit_plannar(coords): + # regular grid covering the domain of the data + debug = 0 + data = np.array(coords) + X,Y = np.meshgrid(np.arange(-10.0, 10.0, 1), np.arange(-10.0, 10.0, 1)) + # best-fit linear plane + A = np.c_[data[:,0], data[:,1], np.ones(data.shape[0])] + C,_,_,_ = scipy.linalg.lstsq(A, data[:,2]) # coefficients + if debug: + o = open("plannar.xyz", "w") + o.write("%d\n\n"%(len(coords)*2)) + for i in range(len(coords)): + x = coords[i][0] + y = coords[i][1] + z0 = coords[i][2] + z1 = C[0]*x + C[1]*y + C[2] + o.write("Au %12.4f%12.4f%12.4f\n"%(x, y, z0)) + o.write("Fe %12.4f%12.4f%12.4f\n"%(x, y, z1)) + o.close() + return C + +def align_axis(v1, v2): + w = np.cross(v1,v2) + w = w/np.linalg.norm(w) + w_hat = np.matrix([[ 0, -w[2], w[1]], + [ w[2], 0, -w[0]], + [-w[1], w[0], 0]]) + cos_tht = np.dot(v1, v2)/np.linalg.norm(v1)/np.linalg.norm(v2) + tht = np.arccos(cos_tht) + R = np.identity(3) + w_hat*np.sin(tht) + w_hat*w_hat*(1-np.cos(tht)) + return R + +def rotate_coords(coords, R): + coords_new = [] + for i in range(len(coords)): + coords_new.append(np.dot(coords[i], R).A1) + return coords_new + +def output_coords(coords, fname): + o = open(fname, "w") + o.write("%d\n\n"%(len(coords)+20)) + for i in range(len(coords)): + o.write("Au ") + for j in range(3): + o.write("%12.4f"%coords[i][j]) + o.write("\n") + for i in range(20): + o.write("O 0 0 %12.4f\n"%(i-10)) + o.close() + +def output_coords_debug(coords, fname, pc): + o = open(fname, "w") + o.write("%d\n\n"%(len(coords)+20)) + for i in range(len(coords)): + o.write("Au ") + for j in range(3): + o.write("%12.4f"%coords[i][j]) + o.write("\n") + for i in range(20): + x = pc[0]*i + y = pc[1]*i + z = -i + o.write("O %12.4f%12.4f%12.4f\n"%(x, y, z)) + o.close() + +debug = 0 +# read the xyz file +coords = read_coords() +# get the surface atoms +sur = get_surface_atoms(coords) +# calculate the center of mass (com) +com = get_com(sur) +# move the com to zero +sur_zero = center_coords(sur, com) +# determine the surface and surface vector +pc = fit_plannar(sur_zero) +v1 = [pc[0], pc[1], -1] +v2 = [0, 0, 1] +# calculate the rotation matrix +R = align_axis(v1, v2) +print np.dot(R, v1) +# apply the rotation +coords_zero = center_coords(coords, com) +coords_new = rotate_coords(coords_zero, R) +# output the data +output_coords(coords_zero, "t0.xyz") +output_coords(coords_zero, "t0.xyz") +if debug: + output_coords_debug(coords_zero, "vector.xyz", pc) diff --git a/tools/align/v1/test.xyz b/tools/align/v1/test.xyz new file mode 100644 index 0000000..5706d9d --- /dev/null +++ b/tools/align/v1/test.xyz @@ -0,0 +1,34 @@ +32 +Nanocluster +Pt 4.303200 10.058001 5.519400 +Pt 5.532200 9.051200 3.205000 +Pt 1.845400 12.071800 10.148200 +Pt 3.074400 11.065001 7.833800 +Pt 5.597800 11.509000 8.980600 +Pt 6.826800 10.502000 6.666200 +Pt 8.055600 9.495200 4.351800 +Pt 9.284600 8.488199 2.037400 +Pt 11.808000 8.932200 3.184200 +Pt 9.350201 10.945999 7.813000 +Pt 10.579200 9.939200 5.498600 +Pt 13.102799 10.383200 6.645400 +Pt 14.331599 9.376200 4.331000 +Pt 16.855200 9.820200 5.477800 +Pt 3.140000 13.522600 13.609400 +Pt 4.369000 12.515800 11.295000 +Pt 6.892400 12.959800 12.441799 +Pt 8.121400 11.953000 10.127400 +Pt 5.663600 13.966599 14.756201 +Pt 8.187200 14.410600 15.903000 +Pt 9.416000 13.403799 13.588600 +Pt 10.710600 14.854601 17.049801 +Pt 10.645000 12.396801 11.274199 +Pt 11.873799 11.390000 8.959800 +Pt 14.397400 11.834001 10.106601 +Pt 15.626201 10.827200 7.792200 +Pt 18.149799 11.271000 8.939000 +Pt 11.939600 13.847800 14.735399 +Pt 13.168401 12.840800 12.421000 +Pt 15.692000 13.284800 13.567801 +Pt 16.920799 12.278000 11.253400 +Pt 14.463000 14.291800 15.882200 diff --git a/tools/align/v1/test/t0.xyz b/tools/align/v1/test/t0.xyz new file mode 100644 index 0000000..c591908 --- /dev/null +++ b/tools/align/v1/test/t0.xyz @@ -0,0 +1,74 @@ +72 + +Au -5.6944 -1.6134 -4.0242 +Au -4.4654 -2.6203 -6.3386 +Au -8.1522 0.4003 0.6046 +Au -6.9232 -0.6064 -1.7098 +Au -4.3998 -0.1625 -0.5630 +Au -3.1708 -1.1695 -2.8774 +Au -1.9420 -2.1763 -5.1918 +Au -0.7130 -3.1833 -7.5062 +Au 1.8104 -2.7393 -6.3594 +Au -0.6474 -0.7255 -1.7306 +Au 0.5816 -1.7323 -4.0450 +Au 3.1052 -1.2883 -2.8982 +Au 4.3340 -2.2953 -5.2126 +Au 6.8576 -1.8513 -4.0658 +Au -6.8576 1.8511 4.0658 +Au -5.6286 0.8443 1.7514 +Au -3.1052 1.2883 2.8982 +Au -1.8762 0.2815 0.5838 +Au -4.3340 2.2951 5.2126 +Au -1.8104 2.7391 6.3594 +Au -0.5816 1.7323 4.0450 +Au 0.7130 3.1832 7.5062 +Au 0.6474 0.7254 1.7306 +Au 1.8762 -0.2815 -0.5838 +Au 4.3998 0.1626 0.5630 +Au 5.6286 -0.8443 -1.7514 +Au 8.1522 -0.4005 -0.6046 +Au 1.9420 2.1763 5.1918 +Au 3.1708 1.1693 2.8774 +Au 5.6944 1.6133 4.0242 +Au 6.9232 0.6065 1.7098 +Au 4.4654 2.6203 6.3386 +Au -0.0000 0.0000 0.0000 +Au 0.0412 2.3489 -1.0000 +Au 0.0824 4.6977 -2.0000 +Au 0.1236 7.0466 -3.0000 +Au 0.1648 9.3954 -4.0000 +Au 0.2060 11.7443 -5.0000 +Au 0.2471 14.0932 -6.0000 +Au 0.2883 16.4420 -7.0000 +Au 0.3295 18.7909 -8.0000 +Au 0.3707 21.1397 -9.0000 +Au 0.4119 23.4886 -10.0000 +Au 0.4531 25.8375 -11.0000 +Au 0.4943 28.1863 -12.0000 +Au 0.5355 30.5352 -13.0000 +Au 0.5767 32.8840 -14.0000 +Au 0.6179 35.2329 -15.0000 +Au 0.6591 37.5818 -16.0000 +Au 0.7003 39.9306 -17.0000 +Au 0.7414 42.2795 -18.0000 +Au 0.7826 44.6283 -19.0000 +O 0 0 -10.0000 +O 0 0 -9.0000 +O 0 0 -8.0000 +O 0 0 -7.0000 +O 0 0 -6.0000 +O 0 0 -5.0000 +O 0 0 -4.0000 +O 0 0 -3.0000 +O 0 0 -2.0000 +O 0 0 -1.0000 +O 0 0 0.0000 +O 0 0 1.0000 +O 0 0 2.0000 +O 0 0 3.0000 +O 0 0 4.0000 +O 0 0 5.0000 +O 0 0 6.0000 +O 0 0 7.0000 +O 0 0 8.0000 +O 0 0 9.0000 diff --git a/tools/align/v1/test/t1.xyz b/tools/align/v1/test/t1.xyz new file mode 100644 index 0000000..9b51fb1 --- /dev/null +++ b/tools/align/v1/test/t1.xyz @@ -0,0 +1,74 @@ +72 + +Au -5.5877 4.4723 0.0000 +Au -4.2973 6.9654 0.0000 +Au -8.1682 -0.5139 -0.0000 +Au -6.8779 1.9791 0.0001 +Au -4.3849 0.6889 0.0001 +Au -3.0945 3.1820 -0.0000 +Au -1.8043 5.6751 0.0000 +Au -0.5139 8.1683 -0.0001 +Au 1.9791 6.8780 -0.0001 +Au -0.6015 1.8917 -0.0000 +Au 0.6889 4.3848 0.0000 +Au 3.1821 3.0945 0.0001 +Au 4.4722 5.5877 -0.0000 +Au 6.9654 4.2974 -0.0000 +Au -6.9654 -4.2973 -0.0001 +Au -5.6751 -1.8042 -0.0000 +Au -3.1821 -3.0945 -0.0000 +Au -1.8917 -0.6014 0.0001 +Au -4.4722 -5.5876 -0.0001 +Au -1.9791 -6.8779 -0.0001 +Au -0.6889 -4.3848 0.0000 +Au 0.5139 -8.1682 0.0001 +Au 0.6015 -1.8917 0.0000 +Au 1.8917 0.6014 -0.0000 +Au 4.3849 -0.6889 0.0001 +Au 5.6750 1.8042 0.0001 +Au 8.1682 0.5140 -0.0001 +Au 1.8043 -5.6751 0.0000 +Au 3.0945 -3.1820 -0.0001 +Au 5.5877 -4.4723 -0.0001 +Au 6.8779 -1.9792 0.0000 +Au 4.2973 -6.9654 0.0001 +Au -0.0000 -0.0000 0.0000 +Au 0.0000 -0.0000 2.5533 +Au 0.0000 -0.0000 5.1064 +Au 0.0000 -0.0000 7.6597 +Au 0.0000 -0.0000 10.2128 +Au 0.0000 -0.0000 12.7660 +Au -0.0001 -0.0000 15.3193 +Au -0.0001 -0.0000 17.8724 +Au -0.0001 -0.0000 20.4257 +Au -0.0000 -0.0000 22.9788 +Au -0.0000 -0.0000 25.5321 +Au -0.0000 -0.0000 28.0853 +Au -0.0000 -0.0000 30.6384 +Au -0.0000 -0.0000 33.1917 +Au -0.0000 -0.0000 35.7448 +Au -0.0000 -0.0000 38.2981 +Au -0.0000 -0.0001 40.8513 +Au 0.0000 -0.0000 43.4044 +Au -0.0001 -0.0000 45.9577 +Au -0.0001 -0.0000 48.5108 +O 0 0 -10.0000 +O 0 0 -9.0000 +O 0 0 -8.0000 +O 0 0 -7.0000 +O 0 0 -6.0000 +O 0 0 -5.0000 +O 0 0 -4.0000 +O 0 0 -3.0000 +O 0 0 -2.0000 +O 0 0 -1.0000 +O 0 0 0.0000 +O 0 0 1.0000 +O 0 0 2.0000 +O 0 0 3.0000 +O 0 0 4.0000 +O 0 0 5.0000 +O 0 0 6.0000 +O 0 0 7.0000 +O 0 0 8.0000 +O 0 0 9.0000 diff --git a/tools/align/v1/test/test.py b/tools/align/v1/test/test.py new file mode 100644 index 0000000..41e02e0 --- /dev/null +++ b/tools/align/v1/test/test.py @@ -0,0 +1,126 @@ +import math +import numpy as np +import scipy.linalg + +def read_coords(): + f = open("test.xyz", "r") + lines = f.readlines() + coords = [] + for i in range(2, len(lines)): + tokens = lines[i].strip().split() + if len(tokens) > 0: + coords.append([float(j) for j in tokens[1:]]) + return coords + +def get_surface_atoms(coords): + sur = [] + for i in range(32): + sur.append(coords[i]) + return sur + +def get_com(coords): + com = [0.0, 0.0, 0.0] + for i in range(len(coords)): + for j in range(3): + com[j] += coords[i][j] + for i in range(3): + com[i] = com[i]/len(coords) + + return com + +def center_coords(coords, s): + coords_new = [] + for i in range(len(coords)): + coords_new.append([]) + for j in range(3): + coords_new[i].append(coords[i][j] - s[j]) + return coords_new + +def fit_plannar(coords): + # regular grid covering the domain of the data + debug = 0 + data = np.array(coords) + X,Y = np.meshgrid(np.arange(-10.0, 10.0, 1), np.arange(-10.0, 10.0, 1)) + # best-fit linear plane + A = np.c_[data[:,0], data[:,1], np.ones(data.shape[0])] + C,_,_,_ = scipy.linalg.lstsq(A, data[:,2]) # coefficients + if debug: + o = open("plannar.xyz", "w") + o.write("%d\n\n"%(len(coords)*2)) + for i in range(len(coords)): + x = coords[i][0] + y = coords[i][1] + z0 = coords[i][2] + z1 = C[0]*x + C[1]*y + C[2] + o.write("Au %12.4f%12.4f%12.4f\n"%(x, y, z0)) + o.write("Fe %12.4f%12.4f%12.4f\n"%(x, y, z1)) + o.close() + return C + +def align_axis(v1, v2): + w = np.cross(v1,v2) + w = w/np.linalg.norm(w) + w_hat = np.matrix([[ 0, -w[2], w[1]], + [ w[2], 0, -w[0]], + [-w[1], w[0], 0]]) + cos_tht = np.dot(v1, v2)/np.linalg.norm(v1)/np.linalg.norm(v2) + tht = np.arccos(cos_tht) + R = np.identity(3) + w_hat*np.sin(tht) + w_hat*w_hat*(1-np.cos(tht)) + return R + +def rotate_coords(coords, R): + coords_new = [] + for i in range(len(coords)): + coords_new.append(np.dot(R, coords[i]).A1) + return coords_new + +def output_coords(coords, fname): + o = open(fname, "w") + o.write("%d\n\n"%(len(coords)+20)) + for i in range(len(coords)): + o.write("Au ") + for j in range(3): + o.write("%12.4f"%coords[i][j]) + o.write("\n") + for i in range(20): + o.write("O 0 0 %12.4f\n"%(i-10)) + o.close() + +def output_coords_debug(coords, fname, pc): + o = open(fname, "w") + o.write("%d\n\n"%(len(coords)+20)) + for i in range(len(coords)): + o.write("Au ") + for j in range(3): + o.write("%12.4f"%coords[i][j]) + o.write("\n") + for i in range(20): + x = pc[0]*i + y = pc[1]*i + z = -i + o.write("O %12.4f%12.4f%12.4f\n"%(x, y, z)) + o.close() + +debug = 0 +# read the xyz file +coords = read_coords() +# get the surface atoms +sur = get_surface_atoms(coords) +# calculate the center of mass (com) +com = get_com(sur) +# move the com to zero +sur_zero = center_coords(sur, com) +# determine the surface and surface vector +pc = fit_plannar(sur_zero) +v1 = [pc[0], pc[1], -1] +v2 = [0, 0, 1] +coords_zero = center_coords(coords, com) +if debug: + output_coords_debug(coords_zero, "vector.xyz", pc) +# calculate the rotation matrix +R = align_axis(v1, v2) +# apply the rotation +coords_new = rotate_coords(coords_zero, R) +# output the data +output_coords(coords_zero, "t0.xyz") +output_coords(coords_new, "t1.xyz") diff --git a/tools/align/v1/test/test.xyz b/tools/align/v1/test/test.xyz new file mode 100644 index 0000000..36456a4 --- /dev/null +++ b/tools/align/v1/test/test.xyz @@ -0,0 +1,54 @@ +52 + +Au -5.6944 -1.6134 -4.0242 +Au -4.4654 -2.6203 -6.3386 +Au -8.1522 0.4003 0.6046 +Au -6.9232 -0.6064 -1.7098 +Au -4.3998 -0.1625 -0.5630 +Au -3.1708 -1.1695 -2.8774 +Au -1.9420 -2.1763 -5.1918 +Au -0.7130 -3.1833 -7.5062 +Au 1.8104 -2.7393 -6.3594 +Au -0.6474 -0.7255 -1.7306 +Au 0.5816 -1.7323 -4.0450 +Au 3.1052 -1.2883 -2.8982 +Au 4.3340 -2.2953 -5.2126 +Au 6.8576 -1.8513 -4.0658 +Au -6.8576 1.8511 4.0658 +Au -5.6286 0.8443 1.7514 +Au -3.1052 1.2883 2.8982 +Au -1.8762 0.2815 0.5838 +Au -4.3340 2.2951 5.2126 +Au -1.8104 2.7391 6.3594 +Au -0.5816 1.7323 4.0450 +Au 0.7130 3.1832 7.5062 +Au 0.6474 0.7254 1.7306 +Au 1.8762 -0.2815 -0.5838 +Au 4.3998 0.1626 0.5630 +Au 5.6286 -0.8443 -1.7514 +Au 8.1522 -0.4005 -0.6046 +Au 1.9420 2.1763 5.1918 +Au 3.1708 1.1693 2.8774 +Au 5.6944 1.6133 4.0242 +Au 6.9232 0.6065 1.7098 +Au 4.4654 2.6203 6.3386 +O 0.0000 0.0000 0.0000 +O 0.0412 2.3489 -1.0000 +O 0.0824 4.6977 -2.0000 +O 0.1236 7.0466 -3.0000 +O 0.1648 9.3954 -4.0000 +O 0.2060 11.7443 -5.0000 +O 0.2471 14.0932 -6.0000 +O 0.2883 16.4420 -7.0000 +O 0.3295 18.7909 -8.0000 +O 0.3707 21.1397 -9.0000 +O 0.4119 23.4886 -10.0000 +O 0.4531 25.8375 -11.0000 +O 0.4943 28.1863 -12.0000 +O 0.5355 30.5352 -13.0000 +O 0.5767 32.8840 -14.0000 +O 0.6179 35.2329 -15.0000 +O 0.6591 37.5818 -16.0000 +O 0.7003 39.9306 -17.0000 +O 0.7414 42.2795 -18.0000 +O 0.7826 44.6283 -19.0000 diff --git a/tools/align/v1/vector.xyz b/tools/align/v1/vector.xyz new file mode 100644 index 0000000..36456a4 --- /dev/null +++ b/tools/align/v1/vector.xyz @@ -0,0 +1,54 @@ +52 + +Au -5.6944 -1.6134 -4.0242 +Au -4.4654 -2.6203 -6.3386 +Au -8.1522 0.4003 0.6046 +Au -6.9232 -0.6064 -1.7098 +Au -4.3998 -0.1625 -0.5630 +Au -3.1708 -1.1695 -2.8774 +Au -1.9420 -2.1763 -5.1918 +Au -0.7130 -3.1833 -7.5062 +Au 1.8104 -2.7393 -6.3594 +Au -0.6474 -0.7255 -1.7306 +Au 0.5816 -1.7323 -4.0450 +Au 3.1052 -1.2883 -2.8982 +Au 4.3340 -2.2953 -5.2126 +Au 6.8576 -1.8513 -4.0658 +Au -6.8576 1.8511 4.0658 +Au -5.6286 0.8443 1.7514 +Au -3.1052 1.2883 2.8982 +Au -1.8762 0.2815 0.5838 +Au -4.3340 2.2951 5.2126 +Au -1.8104 2.7391 6.3594 +Au -0.5816 1.7323 4.0450 +Au 0.7130 3.1832 7.5062 +Au 0.6474 0.7254 1.7306 +Au 1.8762 -0.2815 -0.5838 +Au 4.3998 0.1626 0.5630 +Au 5.6286 -0.8443 -1.7514 +Au 8.1522 -0.4005 -0.6046 +Au 1.9420 2.1763 5.1918 +Au 3.1708 1.1693 2.8774 +Au 5.6944 1.6133 4.0242 +Au 6.9232 0.6065 1.7098 +Au 4.4654 2.6203 6.3386 +O 0.0000 0.0000 0.0000 +O 0.0412 2.3489 -1.0000 +O 0.0824 4.6977 -2.0000 +O 0.1236 7.0466 -3.0000 +O 0.1648 9.3954 -4.0000 +O 0.2060 11.7443 -5.0000 +O 0.2471 14.0932 -6.0000 +O 0.2883 16.4420 -7.0000 +O 0.3295 18.7909 -8.0000 +O 0.3707 21.1397 -9.0000 +O 0.4119 23.4886 -10.0000 +O 0.4531 25.8375 -11.0000 +O 0.4943 28.1863 -12.0000 +O 0.5355 30.5352 -13.0000 +O 0.5767 32.8840 -14.0000 +O 0.6179 35.2329 -15.0000 +O 0.6591 37.5818 -16.0000 +O 0.7003 39.9306 -17.0000 +O 0.7414 42.2795 -18.0000 +O 0.7826 44.6283 -19.0000 diff --git a/tools/align/v1/view.vmd b/tools/align/v1/view.vmd new file mode 100644 index 0000000..d99da13 --- /dev/null +++ b/tools/align/v1/view.vmd @@ -0,0 +1,572 @@ +#!/usr/local/bin/vmd +# VMD script written by save_state $Revision: 1.47 $ +# VMD version: 1.9.3 +set viewplist {} +set fixedlist {} +proc vmdrestoremymaterials {} { + set mlist { Opaque Transparent BrushedMetal Diffuse Ghost Glass1 Glass2 Glass3 Glossy HardPlastic MetallicPastel Steel Translucent Edgy EdgyShiny EdgyGlass Goodsell AOShiny AOChalky AOEdgy BlownGlass GlassBubble RTChrome } + set mymlist [material list] + foreach mat $mlist { + if { [lsearch $mymlist $mat] == -1 } { + material add $mat + } + } + material change ambient Opaque 0.000000 + material change diffuse Opaque 0.650000 + material change specular Opaque 0.500000 + material change shininess Opaque 0.534020 + material change mirror Opaque 0.000000 + material change opacity Opaque 1.000000 + material change outline Opaque 0.000000 + material change outlinewidth Opaque 0.000000 + material change transmode Opaque 0.000000 + material change ambient Transparent 0.000000 + material change diffuse Transparent 0.650000 + material change specular Transparent 0.500000 + material change shininess Transparent 0.534020 + material change mirror Transparent 0.000000 + material change opacity Transparent 0.300000 + material change outline Transparent 0.000000 + material change outlinewidth Transparent 0.000000 + material change transmode Transparent 0.000000 + material change ambient BrushedMetal 0.080000 + material change diffuse BrushedMetal 0.390000 + material change specular BrushedMetal 0.340000 + material change shininess BrushedMetal 0.150000 + material change mirror BrushedMetal 0.000000 + material change opacity BrushedMetal 1.000000 + material change outline BrushedMetal 0.000000 + material change outlinewidth BrushedMetal 0.000000 + material change transmode BrushedMetal 0.000000 + material change ambient Diffuse 0.000000 + material change diffuse Diffuse 0.620000 + material change specular Diffuse 0.000000 + material change shininess Diffuse 0.530000 + material change mirror Diffuse 0.000000 + material change opacity Diffuse 1.000000 + material change outline Diffuse 0.000000 + material change outlinewidth Diffuse 0.000000 + material change transmode Diffuse 0.000000 + material change ambient Ghost 0.000000 + material change diffuse Ghost 0.000000 + material change specular Ghost 1.000000 + material change shininess Ghost 0.230000 + material change mirror Ghost 0.000000 + material change opacity Ghost 0.100000 + material change outline Ghost 0.000000 + material change outlinewidth Ghost 0.000000 + material change transmode Ghost 0.000000 + material change ambient Glass1 0.000000 + material change diffuse Glass1 0.500000 + material change specular Glass1 0.650000 + material change shininess Glass1 0.530000 + material change mirror Glass1 0.000000 + material change opacity Glass1 0.150000 + material change outline Glass1 0.000000 + material change outlinewidth Glass1 0.000000 + material change transmode Glass1 0.000000 + material change ambient Glass2 0.520000 + material change diffuse Glass2 0.760000 + material change specular Glass2 0.220000 + material change shininess Glass2 0.590000 + material change mirror Glass2 0.000000 + material change opacity Glass2 0.680000 + material change outline Glass2 0.000000 + material change outlinewidth Glass2 0.000000 + material change transmode Glass2 0.000000 + material change ambient Glass3 0.150000 + material change diffuse Glass3 0.250000 + material change specular Glass3 0.750000 + material change shininess Glass3 0.800000 + material change mirror Glass3 0.000000 + material change opacity Glass3 0.500000 + material change outline Glass3 0.000000 + material change outlinewidth Glass3 0.000000 + material change transmode Glass3 0.000000 + material change ambient Glossy 0.000000 + material change diffuse Glossy 0.650000 + material change specular Glossy 1.000000 + material change shininess Glossy 0.880000 + material change mirror Glossy 0.000000 + material change opacity Glossy 1.000000 + material change outline Glossy 0.000000 + material change outlinewidth Glossy 0.000000 + material change transmode Glossy 0.000000 + material change ambient HardPlastic 0.000000 + material change diffuse HardPlastic 0.560000 + material change specular HardPlastic 0.280000 + material change shininess HardPlastic 0.690000 + material change mirror HardPlastic 0.000000 + material change opacity HardPlastic 1.000000 + material change outline HardPlastic 0.000000 + material change outlinewidth HardPlastic 0.000000 + material change transmode HardPlastic 0.000000 + material change ambient MetallicPastel 0.000000 + material change diffuse MetallicPastel 0.260000 + material change specular MetallicPastel 0.550000 + material change shininess MetallicPastel 0.190000 + material change mirror MetallicPastel 0.000000 + material change opacity MetallicPastel 1.000000 + material change outline MetallicPastel 0.000000 + material change outlinewidth MetallicPastel 0.000000 + material change transmode MetallicPastel 0.000000 + material change ambient Steel 0.250000 + material change diffuse Steel 0.000000 + material change specular Steel 0.380000 + material change shininess Steel 0.320000 + material change mirror Steel 0.000000 + material change opacity Steel 1.000000 + material change outline Steel 0.000000 + material change outlinewidth Steel 0.000000 + material change transmode Steel 0.000000 + material change ambient Translucent 0.000000 + material change diffuse Translucent 0.700000 + material change specular Translucent 0.600000 + material change shininess Translucent 0.300000 + material change mirror Translucent 0.000000 + material change opacity Translucent 0.800000 + material change outline Translucent 0.000000 + material change outlinewidth Translucent 0.000000 + material change transmode Translucent 0.000000 + material change ambient Edgy 0.000000 + material change diffuse Edgy 0.660000 + material change specular Edgy 0.000000 + material change shininess Edgy 0.750000 + material change mirror Edgy 0.000000 + material change opacity Edgy 1.000000 + material change outline Edgy 0.620000 + material change outlinewidth Edgy 0.940000 + material change transmode Edgy 0.000000 + material change ambient EdgyShiny 0.000000 + material change diffuse EdgyShiny 0.660000 + material change specular EdgyShiny 0.960000 + material change shininess EdgyShiny 0.750000 + material change mirror EdgyShiny 0.000000 + material change opacity EdgyShiny 1.000000 + material change outline EdgyShiny 0.760000 + material change outlinewidth EdgyShiny 0.940000 + material change transmode EdgyShiny 0.000000 + material change ambient EdgyGlass 0.000000 + material change diffuse EdgyGlass 0.660000 + material change specular EdgyGlass 0.500000 + material change shininess EdgyGlass 0.750000 + material change mirror EdgyGlass 0.000000 + material change opacity EdgyGlass 0.620000 + material change outline EdgyGlass 0.620000 + material change outlinewidth EdgyGlass 0.940000 + material change transmode EdgyGlass 0.000000 + material change ambient Goodsell 0.520000 + material change diffuse Goodsell 1.000000 + material change specular Goodsell 0.000000 + material change shininess Goodsell 0.000000 + material change mirror Goodsell 0.000000 + material change opacity Goodsell 1.000000 + material change outline Goodsell 4.000000 + material change outlinewidth Goodsell 0.900000 + material change transmode Goodsell 0.000000 + material change ambient AOShiny 0.000000 + material change diffuse AOShiny 0.850000 + material change specular AOShiny 0.200000 + material change shininess AOShiny 0.530000 + material change mirror AOShiny 0.000000 + material change opacity AOShiny 1.000000 + material change outline AOShiny 0.000000 + material change outlinewidth AOShiny 0.000000 + material change transmode AOShiny 0.000000 + material change ambient AOChalky 0.000000 + material change diffuse AOChalky 0.850000 + material change specular AOChalky 0.000000 + material change shininess AOChalky 0.530000 + material change mirror AOChalky 0.000000 + material change opacity AOChalky 1.000000 + material change outline AOChalky 0.000000 + material change outlinewidth AOChalky 0.000000 + material change transmode AOChalky 0.000000 + material change ambient AOEdgy 0.000000 + material change diffuse AOEdgy 0.900000 + material change specular AOEdgy 0.200000 + material change shininess AOEdgy 0.530000 + material change mirror AOEdgy 0.000000 + material change opacity AOEdgy 1.000000 + material change outline AOEdgy 0.620000 + material change outlinewidth AOEdgy 0.930000 + material change transmode AOEdgy 0.000000 + material change ambient BlownGlass 0.040000 + material change diffuse BlownGlass 0.340000 + material change specular BlownGlass 1.000000 + material change shininess BlownGlass 1.000000 + material change mirror BlownGlass 0.000000 + material change opacity BlownGlass 0.100000 + material change outline BlownGlass 0.000000 + material change outlinewidth BlownGlass 0.000000 + material change transmode BlownGlass 1.000000 + material change ambient GlassBubble 0.250000 + material change diffuse GlassBubble 0.340000 + material change specular GlassBubble 1.000000 + material change shininess GlassBubble 1.000000 + material change mirror GlassBubble 0.000000 + material change opacity GlassBubble 0.040000 + material change outline GlassBubble 0.000000 + material change outlinewidth GlassBubble 0.000000 + material change transmode GlassBubble 1.000000 + material change ambient RTChrome 0.000000 + material change diffuse RTChrome 0.650000 + material change specular RTChrome 0.500000 + material change shininess RTChrome 0.530000 + material change mirror RTChrome 0.700000 + material change opacity RTChrome 1.000000 + material change outline RTChrome 0.000000 + material change outlinewidth RTChrome 0.000000 + material change transmode RTChrome 0.000000 +} +vmdrestoremymaterials +# Atom selection macros +atomselect macro at {resname ADE A THY T +} +atomselect macro acidic {resname ASP GLU +} +atomselect macro cyclic {resname HIS PHE PRO TRP TYR +} +atomselect macro acyclic {protein and not cyclic +} +atomselect macro aliphatic {resname ALA GLY ILE LEU VAL +} +atomselect macro alpha {protein and name CA +} +atomselect macro amino {protein +} +atomselect macro aromatic {resname HIS PHE TRP TYR +} +atomselect macro basic {resname ARG HIS LYS HSP +} +atomselect macro bonded {numbonds > 0 +} +atomselect macro buried {resname ALA LEU VAL ILE PHE CYS MET TRP +} +atomselect macro cg {resname CYT C GUA G +} +atomselect macro charged {basic or acidic +} +atomselect macro hetero {not (protein or nucleic) +} +atomselect macro hydrophobic {resname ALA LEU VAL ILE PRO PHE MET TRP +} +atomselect macro small {resname ALA GLY SER +} +atomselect macro medium {resname VAL THR ASP ASN PRO CYS ASX PCA HYP +} +atomselect macro large {protein and not (small or medium) +} +atomselect macro neutral {resname VAL PHE GLN TYR HIS CYS MET TRP ASX GLX PCA HYP +} +atomselect macro polar {protein and not hydrophobic +} +atomselect macro purine {resname ADE A GUA G +} +atomselect macro pyrimidine {resname CYT C THY T URA U +} +atomselect macro surface {protein and not buried +} +atomselect macro lipid {resname DLPE DMPC DPPC GPC LPPC PALM PC PGCL POPC POPE +} +atomselect macro lipids {lipid +} +atomselect macro ion {resname AL BA CA CAL CD CES CLA CL CO CS CU CU1 CUA HG IN IOD K LIT MG MN3 MO3 MO4 MO5 MO6 NA NAW OC7 PB POT PT RB SOD TB TL WO4 YB ZN ZN1 ZN2 +} +atomselect macro ions {ion +} +atomselect macro sugar {resname AGLC +} +atomselect macro solvent {not (protein or sugar or nucleic or lipid) +} +atomselect macro glycan {resname NAG BGLN FUC AFUC MAN AMAN BMA BMAN +} +atomselect macro carbon {name "C.*" and not ion +} +atomselect macro hydrogen {name "[0-9]?H.*" +} +atomselect macro nitrogen {name "N.*" +} +atomselect macro oxygen {name "O.*" +} +atomselect macro sulfur {name "S.*" and not ion +} +atomselect macro noh {not hydrogen +} +atomselect macro heme {resname HEM HEME +} +atomselect macro conformationall {altloc "" +} +atomselect macro conformationA {altloc "" or altloc "A" +} +atomselect macro conformationB {altloc "" or altloc "B" +} +atomselect macro conformationC {altloc "" or altloc "C" +} +atomselect macro conformationD {altloc "" or altloc "D" +} +atomselect macro conformationE {altloc "" or altloc "E" +} +atomselect macro conformationF {altloc "" or altloc "F" +} +atomselect macro drude {type DRUD or type LP +} +atomselect macro unparametrized beta<1 +atomselect macro addedmolefacture {occupancy 0.8} +atomselect macro qwikmd_protein {(not name QWIKMDDELETE and protein)} +atomselect macro qwikmd_nucleic {(not name QWIKMDDELETE and nucleic)} +atomselect macro qwikmd_glycan {(not name QWIKMDDELETE and glycan)} +atomselect macro qwikmd_lipid {(not name QWIKMDDELETE and lipid)} +atomselect macro qwikmd_hetero {(not name QWIKMDDELETE and hetero and not qwikmd_protein and not qwikmd_lipid and not qwikmd_nucleic and not qwikmd_glycan and not water)} +# Display settings +display eyesep 0.065000 +display focallength 2.000000 +display height 6.000000 +display distance -2.000000 +display projection Orthographic +display nearclip set 0.500000 +display farclip set 10.000000 +display depthcue off +display cuestart 0.500000 +display cueend 10.000000 +display cuestart 0.500000 +display cueend 10.000000 +display cuedensity 0.320000 +display cuemode Exp2 +display shadows off +display ambientocclusion off +display aoambient 0.800000 +display aodirect 0.300000 +display dof off +display dof_fnumber 64.000000 +display dof_focaldist 0.700000 +mol new output.xyz type xyz first 0 last -1 step 1 filebonds 1 autobonds 1 waitfor all +mol delrep 0 top +mol representation VDW 1.000000 12.000000 +mol color Name +mol selection {all} +mol material Opaque +mol addrep top +mol selupdate 0 top 0 +mol colupdate 0 top 0 +mol scaleminmax top 0 0.000000 0.000000 +mol smoothrep top 0 0 +mol drawframes top 0 {now} +mol clipplane center 0 0 top {0.0 0.0 0.0} +mol clipplane color 0 0 top {0.5 0.5 0.5 } +mol clipplane normal 0 0 top {0.0 0.0 1.0} +mol clipplane status 0 0 top {0} +mol clipplane center 1 0 top {0.0 0.0 0.0} +mol clipplane color 1 0 top {0.5 0.5 0.5 } +mol clipplane normal 1 0 top {0.0 0.0 1.0} +mol clipplane status 1 0 top {0} +mol clipplane center 2 0 top {0.0 0.0 0.0} +mol clipplane color 2 0 top {0.5 0.5 0.5 } +mol clipplane normal 2 0 top {0.0 0.0 1.0} +mol clipplane status 2 0 top {0} +mol clipplane center 3 0 top {0.0 0.0 0.0} +mol clipplane color 3 0 top {0.5 0.5 0.5 } +mol clipplane normal 3 0 top {0.0 0.0 1.0} +mol clipplane status 3 0 top {0} +mol clipplane center 4 0 top {0.0 0.0 0.0} +mol clipplane color 4 0 top {0.5 0.5 0.5 } +mol clipplane normal 4 0 top {0.0 0.0 1.0} +mol clipplane status 4 0 top {0} +mol clipplane center 5 0 top {0.0 0.0 0.0} +mol clipplane color 5 0 top {0.5 0.5 0.5 } +mol clipplane normal 5 0 top {0.0 0.0 1.0} +mol clipplane status 5 0 top {0} +mol rename top output.xyz +set viewpoints([molinfo top]) {{{1 0 0 0.0485158} {0 1 0 1.13231} {0 0 1 -1.07998} {0 0 0 1}} {{-0.126248 0.16435 0.978289 0} {0.568683 0.820033 -0.0643747 0} {-0.812809 0.548209 -0.196992 0} {0 0 0 1}} {{0.0789474 0 0 0} {0 0.0789474 0 0} {0 0 0.0789474 0} {0 0 0 1}} {{1 0 0 0} {0 1 0 0} {0 0 1 0} {0 0 0 1}}} +lappend viewplist [molinfo top] +set topmol [molinfo top] +# done with molecule 0 +foreach v $viewplist { + molinfo $v set {center_matrix rotate_matrix scale_matrix global_matrix} $viewpoints($v) +} +foreach v $fixedlist { + molinfo $v set fixed 1 +} +unset viewplist +unset fixedlist +mol top $topmol +unset topmol +proc vmdrestoremycolors {} { +color scale colors RWB {1.0 0.0 0.0} {1.0 1.0 1.0} {0.0 0.0 1.0} +color scale colors BWR {0.0 0.0 1.0} {1.0 1.0 1.0} {1.0 0.0 0.0} +color scale colors RGryB {1.0 0.0 0.0} {0.5 0.5 0.5} {0.0 0.0 1.0} +color scale colors BGryR {0.0 0.0 1.0} {0.5 0.5 0.5} {1.0 0.0 0.0} +color scale colors RGB {1.0 0.0 0.0} {0.0 1.0 0.0} {0.0 0.0 1.0} +color scale colors BGR {0.0 0.0 1.0} {0.0 1.0 0.0} {1.0 0.0 0.0} +color scale colors RWG {1.0 0.0 0.0} {1.0 1.0 1.0} {0.0 1.0 0.0} +color scale colors GWR {0.0 1.0 0.0} {1.0 1.0 1.0} {1.0 0.0 0.0} +color scale colors GWB {0.0 1.0 0.0} {1.0 1.0 1.0} {0.0 0.0 1.0} +color scale colors BWG {0.0 0.0 1.0} {1.0 1.0 1.0} {0.0 1.0 0.0} +color scale colors BlkW {0.0 0.0 0.0} {0.5 0.5 0.5} {1.0 1.0 1.0} +color scale colors WBlk {1.0 1.0 1.0} {0.5 0.5 0.5} {0.0 0.0 0.0} + color scale method RWB + set colorcmds { + {color Display {Background} white} + {color Display {BackgroundTop} black} + {color Display {BackgroundBot} blue2} + {color Display {FPS} white} + {color Name {C} silver} + {color Name {LPA} green} + {color Name {LPB} green} + {color Name {A} pink} + {color Type {LP} green} + {color Type {DRUD} pink} + {color Type {A} pink} + {color Element {X} cyan} + {color Element {Ac} ochre} + {color Element {Ag} ochre} + {color Element {Al} ochre} + {color Element {Am} ochre} + {color Element {Ar} ochre} + {color Element {As} ochre} + {color Element {At} ochre} + {color Element {Au} ochre} + {color Element {B} ochre} + {color Element {Ba} ochre} + {color Element {Be} ochre} + {color Element {Bh} ochre} + {color Element {Bi} ochre} + {color Element {Bk} ochre} + {color Element {Br} ochre} + {color Element {C} silver} + {color Element {Ca} ochre} + {color Element {Cd} ochre} + {color Element {Ce} ochre} + {color Element {Cf} ochre} + {color Element {Cl} ochre} + {color Element {Cm} ochre} + {color Element {Co} blue} + {color Element {Cr} ochre} + {color Element {Cs} ochre} + {color Element {Cu} ochre} + {color Element {Db} ochre} + {color Element {Ds} ochre} + {color Element {Dy} ochre} + {color Element {Er} ochre} + {color Element {Es} ochre} + {color Element {Eu} ochre} + {color Element {F} ochre} + {color Element {Fe} ochre} + {color Element {Fm} ochre} + {color Element {Fr} ochre} + {color Element {Ga} ochre} + {color Element {Gd} ochre} + {color Element {Ge} ochre} + {color Element {He} ochre} + {color Element {Hf} ochre} + {color Element {Hg} ochre} + {color Element {Ho} ochre} + {color Element {Hs} ochre} + {color Element {I} ochre} + {color Element {In} ochre} + {color Element {Ir} ochre} + {color Element {K} ochre} + {color Element {Kr} ochre} + {color Element {La} ochre} + {color Element {Li} ochre} + {color Element {Lr} ochre} + {color Element {Lu} ochre} + {color Element {Md} ochre} + {color Element {Mg} ochre} + {color Element {Mn} ochre} + {color Element {Mo} ochre} + {color Element {Mt} ochre} + {color Element {Na} ochre} + {color Element {Nb} ochre} + {color Element {Nd} ochre} + {color Element {Ne} ochre} + {color Element {Ni} ochre} + {color Element {No} ochre} + {color Element {Np} ochre} + {color Element {Os} ochre} + {color Element {Pa} ochre} + {color Element {Pb} ochre} + {color Element {Pd} ochre} + {color Element {Pm} ochre} + {color Element {Po} ochre} + {color Element {Pr} ochre} + {color Element {Pt} ochre} + {color Element {Pu} ochre} + {color Element {Ra} ochre} + {color Element {Rb} ochre} + {color Element {Re} ochre} + {color Element {Rf} ochre} + {color Element {Rg} ochre} + {color Element {Rh} ochre} + {color Element {Rn} ochre} + {color Element {Ru} ochre} + {color Element {Sb} ochre} + {color Element {Sc} ochre} + {color Element {Se} ochre} + {color Element {Sg} ochre} + {color Element {Si} ochre} + {color Element {Sm} ochre} + {color Element {Sn} ochre} + {color Element {Sr} ochre} + {color Element {Ta} ochre} + {color Element {Tb} ochre} + {color Element {Tc} ochre} + {color Element {Te} ochre} + {color Element {Th} ochre} + {color Element {Ti} ochre} + {color Element {Tl} ochre} + {color Element {Tm} ochre} + {color Element {U} ochre} + {color Element {V} ochre} + {color Element {W} ochre} + {color Element {Xe} ochre} + {color Element {Y} ochre} + {color Element {Yb} ochre} + {color Element {Zr} ochre} + {color Resname {} silver} + {color Chain {X} blue} + {color Segname {} blue} + {color Conformation {all} blue} + {color Molecule {0} blue} + {color Structure {3_10_Helix} blue} + {color Surface {Grasp} gray} + {color Labels {Bonds} blue} + {color Labels {Springs} orange} + {color Stage {Even} gray} + {color Stage {Odd} silver} + } + foreach colcmd $colorcmds { + set val [catch {eval $colcmd}] + } + color change rgb 0 0.0 0.0 1.0 + color change rgb 2 0.3499999940395355 0.3499999940395355 0.3499999940395355 + color change rgb 3 1.0 0.5 0.0 + color change rgb 4 1.0 1.0 0.0 + color change rgb 5 0.5 0.5 0.20000000298023224 + color change rgb 6 0.6000000238418579 0.6000000238418579 0.6000000238418579 + color change rgb 7 0.0 1.0 0.0 + color change rgb 9 1.0 0.6000000238418579 0.6000000238418579 + color change rgb 11 0.6499999761581421 0.0 0.6499999761581421 + color change rgb 12 0.5 0.8999999761581421 0.4000000059604645 + color change rgb 13 0.8999999761581421 0.4000000059604645 0.699999988079071 + color change rgb 14 0.5 0.30000001192092896 0.0 + color change rgb 15 0.5 0.5 0.75 + color change rgb 17 0.8799999952316284 0.9700000286102295 0.019999999552965164 + color change rgb 18 0.550000011920929 0.8999999761581421 0.019999999552965164 + color change rgb 19 0.0 0.8999999761581421 0.03999999910593033 + color change rgb 20 0.0 0.8999999761581421 0.5 + color change rgb 21 0.0 0.8799999952316284 1.0 + color change rgb 22 0.0 0.7599999904632568 1.0 + color change rgb 23 0.019999999552965164 0.3799999952316284 0.6700000166893005 + color change rgb 24 0.009999999776482582 0.03999999910593033 0.9300000071525574 + color change rgb 25 0.27000001072883606 0.0 0.9800000190734863 + color change rgb 26 0.44999998807907104 0.0 0.8999999761581421 + color change rgb 27 0.8999999761581421 0.0 0.8999999761581421 + color change rgb 28 1.0 0.0 0.6600000262260437 + color change rgb 29 0.9800000190734863 0.0 0.23000000417232513 + color change rgb 30 0.8100000023841858 0.0 0.0 + color change rgb 31 0.8899999856948853 0.3499999940395355 0.0 + color change rgb 32 0.9599999785423279 0.7200000286102295 0.0 +} +vmdrestoremycolors +label textsize 1.0