Beispiel #1
0
#!/user/bin/env python 

# this script caclualtes cdf from rdf 


import sys
from common.lnx_util import parseInput , print_help, xvg 
import numpy as np 
import scipy.integrate   


if __name__ == '__main__':
    
    inputP = parseInput(sys.argv[1:] ) 
    paraOpt = '-rdf -o -h   -d  '.split() 

    helpdoc = \
'''
Usage ./prog.py -rdf   ; rdf file 
                -o   ; output cdf ; if no present, sys.stdout 
                -d    ; dimension 
'''

    print_help( inputP, paraOpt, helpdoc ) 

    rdfdata = xvg( inputP['-rdf'] ) 

    r= rdfdata[:,0]
    g= rdfdata[:,1]

Beispiel #2
0
        for i in index:
            idx_x , idx_y = index2grid(i)
            tmp_mol = mol.copy()
            # a random rotation around z axis 
            if random_rotate:
                tmp_mol.set_rotate( [0,0,1], 2* np.pi * random.random() )
            
            tmp_mol.set_trans( [idx_x * self.dx, idx_y * self.dy, 0] )
            System.add_mol(self, tmp_mol)
    


if __name__ == '__main__':

    inputP = lu.parseInput(sys.argv[1:])
    paraOpt = [ '-grid', '-chol', '-dopc', '-o', '-randomRotate' , '-h'  ]

    
    helpdoc="Usage!  ./prog.py\n"\
            "        -grid 16 16     ; grid for monolayer\n"\
            "        -chol chol.base num ; only for monolayer\n"\
            "        -dopc dopc.base num\n"\
            "        -randomRotate   dopc chol    ; set it when you want to a random rotate on each molecule. You may need a much larger box\n"\
            "        -o    out.gro      \n"\
            "        -h  ; help message\n"

    
    lu.print_help(inputP, paraOpt, helpdoc)

    # build dopc gro