Ejemplo n.º 1
0
    from common.pgs import get_pgs

    files = [fname for fname in os.listdir(".") if fname.endswith(".xyz")]
    print(files)
    for xyz in files:
        #if "xyz_prueba2_en.xyz" not in xyz: continue
        print(xyz)
        # read file
        try:
            xcc, symbols, masses = read_xyz(xyz)
        except:
            (lzmat, zmatvals, zmatatoms), symbols, masses = read_xyz_zmat(xyz)
            xcc = intl.zmat2xcc(lzmat, zmatvals)
        # point group
        pg, rotsigma = get_pgs(symbols, masses, xcc)
        print("   -", pg)
        # Name for molden file
        xyz2 = xyz.replace(".xyz", "_en.xyz")
        # Get enantiomer
        try:
            xcc_enantio = gen_enantio_and_correlate(xcc,
                                                    symbols,
                                                    masses,
                                                    pp=True)
        except:
            xcc_enantio = None
        if xcc_enantio is None: print("unable to correlate!\n")
        elif os.path.exists(xyz2): print("%s already exists!\n" % xyz2)
        else: write_xyz(xyz2, xcc_enantio, symbols)
#===================================================#
Ejemplo n.º 2
0
 def genfile_xyz(self, filename):
     try:
         write_xyz(filename, self._xcc, self._symbols)
     except:
         return 0
     return 1