Example #1
0
def xmap_from_path(
    path,
    structure_factors,
) -> MCDXMap:
    mtz_file = clipper_python.CCP4MTZfile()

    mtz_file.open_read(str(path))

    hkl_info = clipper_python.HKL_info()
    mtz_file.import_hkl_info(hkl_info)

    # hkl_data = clipper_python.HKL_data_F_phi(hkl_info)
    hkl_data = clipper_python.data32.HKL_data_F_phi_float(hkl_info)
    # mtz_file.import_hkl_data(hkl_data,
    #                          "*/*/[{}]".format(structure_factors),
    #                          )

    mtz_file.import_hkl_data(hkl_data, "*/*/[2FOFCWT,PH2FOFCWT]")

    mtz_file.close_read()

    spacegroup = hkl_info.spacegroup
    cell = hkl_info.cell
    resolution = hkl_info.resolution

    hkl_data = hkl_data

    return MCDXMap.xmap_from_clipper_res(spacegroup, cell, resolution,
                                         hkl_data)
Example #2
0
def load_mtz(mtz_path):
    mtz = clipper.CCP4MTZfile()
    mtz.open_read(mtz_path)
    hkl_info = clipper.HKL_info()
    hkl_data = clipper.data32.HKL_data_F_phi_float(hkl_info)
    mtz.import_hkl_info(hkl_info)
    mtz.import_hkl_data(hkl_data, "*/*/[FWT,PHWT]")
    mtz.close_read()

    return hkl_info, hkl_data
Example #3
0
 def __init__(self,
              path: Path,
              ) -> None:
     super(MTZFile, self).__init__(path)
     self.mtz = clipper_python.CCP4MTZfile()
Example #4
0
def res_from_mtz_file(path: Path) -> clipper_python.CCP4MTZfile:
    mtz_file = clipper_python.CCP4MTZfile()
    mtz_file.open_read(str(path))
    res = mtz_file.resolution
    mtz_file.close_read()
    return res