def run(_args): if _args < 2: raise IOError("Must give at least one path to folder of pickles") ucs = Cluster.from_directories(_args.folders, "cxi_targt_uc", n_images=args.n) if not _args.noplot: clusters, _ = ucs.ab_cluster(_args.t, log=_args.log, write_file_lists=_args.nofiles, schnell=_args.schnell, doplot=_args.noplot) else: plt.figure("Andrews-Bernstein distance dendogram", figsize=(12, 8)) ax = plt.gca() clusters, cluster_axes = ucs.ab_cluster(_args.t, log=_args.log, ax=ax, write_file_lists=_args.nofiles, schnell=_args.schnell, doplot=_args.noplot) plt.tight_layout() plt.show() print unit_cell_info(clusters)
def run(_args): if _args < 2: raise IOError("Must give at least one path to folder of pickles") ucs = Cluster.from_directories(_args.folders, "cluster_42") logging.info("Data imported.") # Set up mega-plot plt.figure(figsize=(22, 15)) gs = gridspec.GridSpec(3, 3, height_ratios=[1, 1, 3]) orr_axes = [plt.subplot(gs[0, 0]), plt.subplot(gs[0, 1]), plt.subplot(gs[0, 2])] inten_axes = [plt.subplot(gs[1, 0]), plt.subplot(gs[1, 1]), plt.subplot(gs[1, 2])] clust_ax = plt.subplot(gs[2, :]) orr_axes = ucs.visualise_orientational_distribution(orr_axes, cbar=True) inten_axes = ucs.intensity_statistics(inten_axes) clusters, cluster_ax = ucs.ab_cluster( _args.t, log=_args.log, ax=clust_ax, schnell=_args.fast, write_file_lists=False ) # plt.text("cluster.42 Plot Everything!") plt.tight_layout() print unit_cell_info(clusters) plt.show()
def run(_args): if _args < 2: raise IOError("Must give at least one path to folder of pickles") ucs = Cluster.from_directories(_args.folders, "cluster_42") logging.info("Data imported.") # Set up mega-plot plt.figure(figsize=(22, 15)) gs = gridspec.GridSpec(3, 3, height_ratios=[1, 1, 3]) orr_axes = [plt.subplot(gs[0, 0]), plt.subplot(gs[0, 1]), plt.subplot(gs[0, 2])] inten_axes = [plt.subplot(gs[1, 0]), plt.subplot(gs[1, 1]), plt.subplot(gs[1, 2])] clust_ax = plt.subplot(gs[2, :]) orr_axes = ucs.visualise_orientational_distribution(orr_axes, cbar=True) inten_axes = ucs.intensity_statistics(inten_axes) clusters, cluster_ax = ucs.ab_cluster(_args.t, log=_args.log, ax=clust_ax, schnell=_args.fast, write_file_lists=False) #plt.text("cluster.42 Plot Everything!") plt.tight_layout() print(unit_cell_info(clusters)) plt.show()
def run(_args): if _args < 2: raise IOError("Must provide location(s) of pickles") if _args.paths: ucs = Cluster.from_files(raw_input=_args.dirs, n_images=_args.n, dials=_args.dials) else: ucs = Cluster.from_directories(_args.dirs, n_images=_args.n, dials=_args.dials) if not _args.noplot: clusters, _ = ucs.ab_cluster(_args.t, log=_args.log, write_file_lists=_args.nofiles, schnell=_args.schnell, doplot=_args.noplot) print unit_cell_info(clusters) else: plt.figure("Andrews-Bernstein distance dendogram", figsize=(12, 8)) ax = plt.gca() clusters, cluster_axes = ucs.ab_cluster(_args.t, log=_args.log, ax=ax, write_file_lists=_args.nofiles, schnell=_args.schnell, doplot=_args.noplot) print unit_cell_info(clusters) plt.tight_layout() plt.show()
def run(_args): if _args < 2: raise IOError("Must give at least one path to folder of pickles") import logging from xfel.clustering.cluster import Cluster FORMAT = '%(levelname)s %(module)s.%(funcName)s: %(message)s' logging.basicConfig(level=logging.WARNING, format=FORMAT) cluster = Cluster.from_directories(_args.folders, 'Command line visualisation') logging.info("data imported") cluster.visualise_orientational_distribution()
def run(_args): if _args < 2: raise IOError("Must give at least one path to folder of pickles") ucs = Cluster.from_directories(_args.folders, "Per-frame-Wilson") logging.info("Data imported.") fig = plt.figure(figsize=(10, 10)) ax = plt.gca() ucs.members[0].plot_wilson(ax=ax) browser = Key_event(ax, ucs.members, fig) fig.canvas.mpl_connect('key_press_event', browser.key_event) plt.show()
def run(_args): if _args < 2: raise IOError("Must give at least one path to folder of pickles") ucs = Cluster.from_directories(_args.folders, "Per-frame-Wilson") logging.info("Data imported.") fig = plt.figure(figsize=(10,10)) ax = plt.gca() ucs.members[0].plot_wilson(ax=ax) browser = Key_event(ax, ucs.members, fig) fig.canvas.mpl_connect('key_press_event', browser.key_event) plt.show()
def run(_args): if _args < 2: raise IOError("Must give at least one path to folder of pickles") ucs = Cluster.from_directories(_args.folders, "cluster_intensity_stats") logging.info("Data imported.") plt.figure(figsize=(20,10)) gs = gridspec.GridSpec(3, 2, width_ratios=[1, 3]) inten_axes = [plt.subplot(gs[0,0]), plt.subplot(gs[1,0]), plt.subplot(gs[2,0])] big_axes = plt.subplot(gs[:,1]) ucs.intensity_statistics(ax=inten_axes) ucs.all_frames_intensity_stats(ax=big_axes) plt.tight_layout() plt.show()
def run(_args): if _args < 2: raise IOError("Must give at least one path to folder of pickles") ucs = Cluster.from_directories(_args.folders, "cxi_targt_uc") if not _args.noplot: clusters, _ = ucs.ab_cluster(_args.t, log=_args.log, write_file_lists=_args.nofiles, schnell=_args.schnell, doplot=_args.noplot) else: plt.figure("Andrews-Bernstein distance dendogram", figsize=(12, 8)) ax = plt.gca() clusters, cluster_axes = ucs.ab_cluster(_args.t, log=_args.log, ax=ax, write_file_lists=_args.nofiles, schnell=_args.schnell, doplot=_args.noplot) plt.tight_layout() plt.show() print unit_cell_info(clusters)