Пример #1
0
 def extra_info(self):
     for state in self.state_list:
         try:
             state['lam'] = units.energy['nm'] / (state['exc_en'] / units.energy['eV'])
         except ZeroDivisionError:
             pass
     
     if 'coor_file' in self.ioptions:
         self.struc = lib_struc.structure()
         self.struc.read_file(self.ioptions['coor_file'], self.ioptions['coor_format'])
     elif 'mo_file' in self.ioptions:
         self.struc = lib_struc.structure()
         self.struc.read_file(self.ioptions['mo_file'], 'molden')
     else:
         self.struc = None
Пример #2
0
    def extra_info(self):
        for state in self.state_list:
            try:
                state['lam'] = units.energy['nm'] / (state['exc_en'] /
                                                     units.energy['eV'])
            except ZeroDivisionError:
                pass

        if 'coor_file' in self.ioptions:
            self.struc = lib_struc.structure()
            self.struc.read_file(self.ioptions['coor_file'],
                                 self.ioptions['coor_format'])
        elif 'mo_file' in self.ioptions:
            self.struc = lib_struc.structure()
            self.struc.read_file(self.ioptions['mo_file'], 'molden')
        else:
            self.struc = None
Пример #3
0
 def file_at_lists(self):
     print("Automatic generation of at_lists partitioning ...")
     self.coor_file()
     
     struc = lib_struc.structure()
     struc.read_file(file_path=self['coor_file'], file_type=self['coor_format'])
 
     return struc.ret_partition()                
Пример #4
0
    def file_at_lists(self):
        print("Automatic generation of at_lists partitioning ...")
        self.coor_file()

        struc = lib_struc.structure()
        struc.read_file(file_path=self['coor_file'],
                        file_type=self['coor_format'])

        return struc.ret_partition()
Пример #5
0
     
Syntax: babel.py <intype> <infile> <outtype> <outfile>
       e.g. babel.py tmol coord xyz coord.xyz
""")

if len(sys.argv) < 4+1:
    print("""  Supported file types:
    col -- Columbus and Newton-X format
    colr -- Columbus format, atoms reordered
    txyz2 -- Tinker format with reading possibility (verify the atom types in the output)
    vnx -- veloctiy (Newton-X format)
    ntxyz -- velocity (Tinker format)
  additionally all formats from openbabel are included
    type 'babel -H' for a complete list""")
    
    print('\nFour arguments required.')
    sys.exit()
    
(intype,infile,outtype,outfile) = sys.argv[1:]

if intype in lib_struc.veloc_types: # special treatment of velocities
    veloc = struc_linalg.veloc()
    veloc.read_file(file_path=infile, file_type=intype)
    veloc.write_veloc(file_path=outfile,file_type=outtype)
else:
    struc = lib_struc.structure()
    struc.read_file(file_path=infile, file_type=intype)
    struc.make_coord_file(file_path=outfile,file_type=outtype)

print("Finished: file %s written."%outfile)
Пример #6
0
     
Syntax: babel.py <intype> <infile> <outtype> <outfile>
       e.g. babel.py tmol coord xyz coord.xyz
""")

if len(sys.argv) < 4 + 1:
    print("""  Supported file types:
    col -- Columbus and Newton-X format
    colr -- Columbus format, atoms reordered
    txyz2 -- Tinker format with reading possibility (verify the atom types in the output)
    vnx -- veloctiy (Newton-X format)
    ntxyz -- velocity (Tinker format)
  additionally all formats from openbabel are included
    type 'babel -H' for a complete list""")

    print('\nFour arguments required.')
    sys.exit()

(intype, infile, outtype, outfile) = sys.argv[1:]

if intype in lib_struc.veloc_types:  # special treatment of velocities
    veloc = struc_linalg.veloc()
    veloc.read_file(file_path=infile, file_type=intype)
    veloc.write_veloc(file_path=outfile, file_type=outtype)
else:
    struc = lib_struc.structure()
    struc.read_file(file_path=infile, file_type=intype)
    struc.make_coord_file(file_path=outfile, file_type=outtype)

print("Finished: file %s written." % outfile)