def write_cif(self, cell=None, symprec=1e-5, filename=None, symmetry=True): if cell == None: cell = self.cell is_std, is_prim = self.cell_type if is_std and symmetry == True: cell = self.to_stdcell(cell, symprec) spacegroup, equi_atoms, rotations, translations = spg_wrapper.get_sym( cell, symprec, export_operator=True) elif is_prim and symmetry == True: cell = self.to_primcell(cell, symprec) spacegroup, equi_atoms, rotations, translations = spg_wrapper.get_sym( cell, symprec, export_operator=True) else: spacegroup = ['1', 'P1'] equi_atoms = np.arange(len(cell[2])) symopt = spg_wrapper.get_symmetry_from_database(1) rotations, translations = symopt['rotations'], symopt[ 'translations'] else: spacegroup = ['1', 'P1'] equi_atoms = np.arange(len(cell[2])) symopt = spg_wrapper.get_symmetry_from_database(1) rotations, translations = symopt['rotations'], symopt[ 'translations'] symopt = cell_utils.symop_mat2xyz(rotations, translations) cell_io.write_cif(cell, spacegroup, equi_atoms, symopt, filename)
def get_symmetry(self, cell=None, symprec=1e-5, print_atom=False): '''Get space group information''' if cell == None: cell = self.cell is_std, is_prim = spg_wrapper.get_sym(cell, symprec, print_atom) self.cell_type = [is_std, is_prim] else: is_std, is_prim = spg_wrapper.get_sym(cell, symprec)