Пример #1
0
 def write_poscar(self, poscar='POSCAR'):
     """
     write_poscar(path)
     Make a 'POSCAR' file at 'path'
     """
     Cabinet.reserve_file(poscar)
     Cabinet.write_file(poscar, str(self))
Пример #2
0
def std(src='POSCAR'):
    """
    conventional standard cell に変換
    """
    srcpos = Poscar.from_file(src)
    finder = SpacegroupAnalyzer(srcpos.structure)
    std_str = finder.get_conventional_standard_structure()
    dstpos = Poscar(std_str)
    dst = 'POSCAR_std'
    Cabinet.reserve_file(dst)
    dstpos.write_file(dst)
Пример #3
0
def prim(src):
    """
    primitive cell に変換
    """
    srcpos = Poscar.from_file(src)
    finder = SpacegroupAnalyzer(srcpos.structure)
    prim_str = finder.get_primitive_standard_structure()
    dstpos = Poscar(prim_str)
    dst = 'POSCAR_prim'
    Cabinet.reserve_file(dst)
    dstpos.write_file(dst)
Пример #4
0
def standard(src="POSCAR"):
    """
    standardに変換
    """
    srcpos = Poscar.from_file(src)
    finder = SpacegroupAnalyzer(srcpos.structure)
    std = finder.get_conventional_standard_structure()
    dstpos = Poscar(std)
    dst = "POSCAR_std"
    Cabinet.reserve_file(dst)
    dstpos.write_file(dst)
Пример #5
0
def primitive(src="POSCAR"):
    """
    primitiveに変換
    """
    srcpos = Poscar.from_file(src)
    finder = SpacegroupAnalyzer(srcpos.structure)
    prim = finder.get_primitive_standard_structure()
    dstpos = Poscar(prim)
    dst = "POSCAR_prim"
    Cabinet.reserve_file(dst)
    dstpos.write_file(dst)
Пример #6
0
def refined(src="POSCAR"):
    """
    refined poscar を 作成する
    """
    srcpos = Poscar.from_file(src)
    finder = SpacegroupAnalyzer(srcpos.structure, symprec=5e-1, angle_tolerance=8)
    std = finder.get_refined_structure()
    dstpos = Poscar(std)
    dst = "POSCAR_refined"
    Cabinet.reserve_file(dst)
    dstpos.write_file(dst)
Пример #7
0
 def prep_one(cls, cif_file, dst_dir):
     """
     The dst_dir is current directory,
     this method search POSCAR and reserve it.
     If not, it will search whethre dst_dir already exist or not.
     If it already exist, this module will do nothing.
     If not, new directory make and prepare POSCAR file.
     """
     if dst_dir == '.':
         Cabinet.reserve_file('POSCAR')
     elif glob.glob(dst_dir):
         line = ("\'{0}\' directory is already exist.\n"
                 "Do Nothing...\n".format(dst_dir.split('/')[-1]))
         print(line)
         return
     else:
         Bash.mkdir(dst_dir)
     cls.conv2poscar(cif_file, dst_dir)
     shutil.copy(cif_file, dst_dir)