How to use the ccf.cal_ccf_d function in ccf

To help you get started, we’ve selected a few ccf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chuanxun / StructurePrototypeAnalysisPackage / SPAP.py View on Github external
structures[i].ccf = struc2ccf(
                Atoms(cell=structures[i].cell * (volume / structures[i].get_volume()) ** (1.0 / 3.0),
                      scaled_positions=scaled_positions, numbers=structures[i].numbers, pbc=True), r_cut_off, r_vector)
            # if i == 57:
            #     ccf_file = open('ccf.dat', 'wb')
            #     pickle.dump(structures[i].ccf,ccf_file)
            #     ccf_file.close()
            #     rvf=open('rvf.dat','wb')
            #     pickle.dump(r_vector,rvf)
            #     rvf.close()
            #     write('out.cif',Atoms(cell=structures[i].cell * (volume / structures[i].get_volume()) ** (1.0 / 3.0),
            #           scaled_positions=scaled_positions, numbers=structures[i].numbers,pbc=True))
            #     print(Atoms(cell=structures[i].cell * (volume / structures[i].get_volume()) ** (1.0 / 3.0),
            #           scaled_positions=scaled_positions, numbers=structures[i].numbers,pbc=True).get_volume())
            for j in [prototype_id[-1 - j2] for j2 in range(len(prototype_id))]:
                struc_d[i][1] = cal_ccf_d(structures[j].ccf, structures[i].ccf)
                if struc_d[i][1] < threshold:
                    struc_d[i][0] = j
                    break
                elif l_same_cell:
                    struc_d[i][1] = cal_ccf_d(
                        structures[j].ccf, struc2ccf(Atoms(cell=structures[j].cell, scaled_positions=scaled_positions,
                                                           numbers=structures[i].numbers, pbc=True), r_cut_off,
                                                     r_vector))
                    if struc_d[i][1] < threshold:
                        struc_d[i][0] = j
                        break
            # Mark this structure as a new prototype.
            if struc_d[i][0] == -1:
                struc_d[i] = [-2, 0.0]
                prototype_id.append(i)
    pass
github chuanxun / StructurePrototypeAnalysisPackage / SPAP.py View on Github external
#     pickle.dump(structures[i].ccf,ccf_file)
            #     ccf_file.close()
            #     rvf=open('rvf.dat','wb')
            #     pickle.dump(r_vector,rvf)
            #     rvf.close()
            #     write('out.cif',Atoms(cell=structures[i].cell * (volume / structures[i].get_volume()) ** (1.0 / 3.0),
            #           scaled_positions=scaled_positions, numbers=structures[i].numbers,pbc=True))
            #     print(Atoms(cell=structures[i].cell * (volume / structures[i].get_volume()) ** (1.0 / 3.0),
            #           scaled_positions=scaled_positions, numbers=structures[i].numbers,pbc=True).get_volume())
            for j in [prototype_id[-1 - j2] for j2 in range(len(prototype_id))]:
                struc_d[i][1] = cal_ccf_d(structures[j].ccf, structures[i].ccf)
                if struc_d[i][1] < threshold:
                    struc_d[i][0] = j
                    break
                elif l_same_cell:
                    struc_d[i][1] = cal_ccf_d(
                        structures[j].ccf, struc2ccf(Atoms(cell=structures[j].cell, scaled_positions=scaled_positions,
                                                           numbers=structures[i].numbers, pbc=True), r_cut_off,
                                                     r_vector))
                    if struc_d[i][1] < threshold:
                        struc_d[i][0] = j
                        break
            # Mark this structure as a new prototype.
            if struc_d[i][0] == -1:
                struc_d[i] = [-2, 0.0]
                prototype_id.append(i)
    pass
github chuanxun / StructurePrototypeAnalysisPackage / spap.py View on Github external
#     pickle.dump(structures[i].ccf,ccf_file)
            #     ccf_file.close()
            #     rvf=open('rvf.dat','wb')
            #     pickle.dump(r_vector,rvf)
            #     rvf.close()
            #     write('out.cif',Atoms(cell=structures[i].cell * (volume / structures[i].get_volume()) ** (1.0 / 3.0),
            #           scaled_positions=scaled_positions, numbers=structures[i].numbers,pbc=structures[0].pbc))
            #     print(Atoms(cell=structures[i].cell * (volume / structures[i].get_volume()) ** (1.0 / 3.0),
            #           scaled_positions=scaled_positions, numbers=structures[i].numbers,pbc=structures[0].pbc).get_volume())
            for j in [prototype_id[-1 - j2] for j2 in range(len(prototype_id))]:
                struc_d[i][1] = cal_ccf_d(structures[j].ccf, structures[i].ccf)
                if struc_d[i][1] < threshold:
                    struc_d[i][0] = j
                    break
                elif l_same_cell:
                    struc_d[i][1] = cal_ccf_d(
                        structures[j].ccf, struc2ccf(Atoms(
                            cell=structures[j].cell * (volume / structures[j].get_volume()) ** (1.0 / 3.0),
                            scaled_positions=scaled_positions, numbers=structures[i].numbers,
                            pbc=structures[0].pbc), r_cut_off, r_vector))
                    if struc_d[i][1] < threshold:
                        struc_d[i][0] = j
                        break
            # Mark this structure as a new prototype.
            if struc_d[i][0] == -1:
                struc_d[i] = [-2, 0.0]
                prototype_id.append(i)
    pass
github chuanxun / StructurePrototypeAnalysisPackage / spap.py View on Github external
Atoms(cell=structures[i].cell * (volume / structures[i].get_volume()) ** (1.0 / 3.0),
                          scaled_positions=scaled_positions, numbers=structures[i].numbers, pbc=structures[0].pbc),
                    r_cut_off, r_vector)
            # if i == 57:
            #     ccf_file = open('ccf.dat', 'wb')
            #     pickle.dump(structures[i].ccf,ccf_file)
            #     ccf_file.close()
            #     rvf=open('rvf.dat','wb')
            #     pickle.dump(r_vector,rvf)
            #     rvf.close()
            #     write('out.cif',Atoms(cell=structures[i].cell * (volume / structures[i].get_volume()) ** (1.0 / 3.0),
            #           scaled_positions=scaled_positions, numbers=structures[i].numbers,pbc=structures[0].pbc))
            #     print(Atoms(cell=structures[i].cell * (volume / structures[i].get_volume()) ** (1.0 / 3.0),
            #           scaled_positions=scaled_positions, numbers=structures[i].numbers,pbc=structures[0].pbc).get_volume())
            for j in [prototype_id[-1 - j2] for j2 in range(len(prototype_id))]:
                struc_d[i][1] = cal_ccf_d(structures[j].ccf, structures[i].ccf)
                if struc_d[i][1] < threshold:
                    struc_d[i][0] = j
                    break
                elif l_same_cell:
                    struc_d[i][1] = cal_ccf_d(
                        structures[j].ccf, struc2ccf(Atoms(
                            cell=structures[j].cell * (volume / structures[j].get_volume()) ** (1.0 / 3.0),
                            scaled_positions=scaled_positions, numbers=structures[i].numbers,
                            pbc=structures[0].pbc), r_cut_off, r_vector))
                    if struc_d[i][1] < threshold:
                        struc_d[i][0] = j
                        break
            # Mark this structure as a new prototype.
            if struc_d[i][0] == -1:
                struc_d[i] = [-2, 0.0]
                prototype_id.append(i)

ccf

Set of tools and utilities for the Confidential Consortium Framework (CCF)

Apache-2.0
Latest version published 20 days ago

Package Health Score

87 / 100
Full package analysis

Popular ccf functions

Similar packages