def output_mean_nxmap(mean_map_np, cell, path, grid_params):
    print("Outputting mean map to: {}".format(path))
    rot = clipper_python.Mat33_double(np.eye(3))
    trans = clipper_python.Vec3_double(0.0, 0.0, 0.0)

    rtop = clipper_python.RTop_orth(
        rot,
        trans,
    )

    # Generate the clipper grid
    grid = clipper_python.Grid(
        grid_params[0],
        grid_params[1],
        grid_params[2],
    )
    # resolution = template_xmap.hkl_info.resolution
    mean_map_nxmap = clipper_python.NXmap_float(
        grid,
        rtop,
    )

    mean_map_nxmap.import_numpy(
        clipper_python.Coord_grid(0, 0, 0),
        mean_map_np,
    )

    mapout = clipper_python.CCP4MAPfile()
    # print(dir(mapout))
    mapout.open_write(str(path))
    mapout.set_cell(cell)
    mapout.export_nxmap_float(mean_map_nxmap)
    mapout.close_write()
Example #2
0
def load_xmap_from_ccp4(event_map_path):
    xmap = clipper.Xmap_float()
    ccp4_file = clipper.CCP4MAPfile()
    ccp4_file.open_read(event_map_path)
    ccp4_file.import_xmap_float(xmap)
    ccp4_file.close_read()

    return xmap
def load_ccp4_map(ccp4_path):
    print("Opening XMAP")
    xmap = clipper_python.Xmap_float()

    print("starting map file")
    mapout = clipper_python.CCP4MAPfile()
    print("opening read")
    mapout.open_read(str(ccp4_path))
    print("importing xmap")
    mapout.import_xmap_float(xmap)
    print("closing read")
    mapout.close_read()
    return xmap
Example #4
0
 def __init__(self,
              path: Path,
              ) -> None:
     super(CCP4MapFile, self).__init__(path)
     self.mtz = clipper_python.CCP4MAPfile()