コード例 #1
0
    if os.path.isfile('atomtypes.ini'):
        print(">> LOADING LOCAL atomtypes.ini")
        FFparams = PPU.loadSpecies('atomtypes.ini')
    else:
        FFparams = PPU.loadSpecies(cpp_utils.PACKAGE_PATH +
                                   '/defaults/atomtypes.ini')
    iZs, Rs, Qstmp = PPH.parseAtoms(atoms,
                                    autogeom=False,
                                    PBC=False,
                                    FFparams=FFparams)
    atom_colors = basUtils.getAtomColors(iZs, FFparams=FFparams)
    Rs = Rs.transpose().copy()
    atoms = [iZs, Rs[0], Rs[1], Rs[2], atom_colors]
    #print "atom_colors: ", atom_colors
if opt_dict['bonds']:
    bonds = basUtils.findBonds(atoms, iZs, 1.0, FFparams=FFparams)
    #print "bonds ", bonds
atomSize = 0.15

cbar_str = ""
if opt_dict['cbar']:
    cbar_str = "_cbar"

for iq, Q in enumerate(Qs):
    for ik, K in enumerate(Ks):
        dirname = "Q%1.2fK%1.2f" % (Q, K)
        if opt_dict['pos']:
            try:
                PPpos, lvec, nDim = GU.load_vec_field(dirname + '/PPpos',
                                                      data_format=data_format)
                print(" plotting PPpos : ")
コード例 #2
0
	atoms_str="_atoms"
	atoms = basUtils.loadAtoms( 'input_plot.xyz' )
#	print "atoms ", atoms
        if os.path.isfile( 'atomtypes.ini' ):
        	print ">> LOADING LOCAL atomtypes.ini"  
        	FFparams=PPU.loadSpecies( 'atomtypes.ini' ) 
        else:
	        FFparams = PPU.loadSpecies( cpp_utils.PACKAGE_PATH+'/defaults/atomtypes.ini' )
        iZs,Rs,Qstmp=PPH.parseAtoms(atoms, autogeom = False,PBC = options.noPBC,
                                 FFparams=FFparams)
	atom_colors = basUtils.getAtomColors(iZs,FFparams=FFparams)
        Rs=Rs.transpose().copy()
	atoms= [iZs,Rs[0],Rs[1],Rs[2],atom_colors]
	#print "atom_colors: ", atom_colors
if opt_dict['bonds']:
	bonds = basUtils.findBonds(atoms,iZs,1.0,FFparams=FFparams)
	#print "bonds ", bonds
atomSize = 0.15

cbar_str =""
if opt_dict['cbar']:
	cbar_str="_cbar"

for iq,Q in enumerate( Qs ):
	for ik,K in enumerate( Ks ):
		dirname = "Q%1.2fK%1.2f" %(Q,K)
		if opt_dict['pos']:
			try:
				PPpos, lvec, nDim = GU.load_vec_field( dirname+'/PPpos' ,format=format)
				print " plotting PPpos : "
				PPPlot.plotDistortions( dirname+"/xy"+atoms_str+cbar_str, PPpos[:,:,:,0], PPpos[:,:,:,1], slices = range( 0, len(PPpos) ), BG=PPpos[:,:,:,2], extent=extent, atoms=atoms, bonds=bonds, atomSize=atomSize, markersize=2.0, cbar=opt_dict['cbar'] )