Example #1
0
def run():
    """
    <Description>

    Args:
        param1: This is the first param.
    
    Returns:
        This is a description of what is returned.
    """
    base_dir = RetinalUtil._landscape_base()
    step = Pipeline.Step.REDUCED
    in_dir = Pipeline._cache_dir(base=base_dir, enum=Pipeline.Step.SANITIZED)
    out_dir = Pipeline._cache_dir(base=base_dir, enum=step)
    force = True
    limit = None
    functor = lambda: to_iwt(in_dir)
    data = CheckpointUtilities.multi_load(cache_dir=out_dir,
                                          load_func=functor,
                                          force=force,
                                          limit=limit,
                                          name_func=FEC_Util.fec_name_func)
    ProcessingUtil.plot_data(base_dir, step, data, xlim=[-50, 150])
    plot_subdir = Pipeline._plot_subdir(base_dir, step)
    out_name = plot_subdir + "heatmap.png"
    ProcessingUtil.heatmap_ensemble_plot(data, out_name=out_name)
Example #2
0
def run():
    """
    <Description>

    Args:
        param1: This is the first param.
    
    Returns:
        This is a description of what is returned.
    """
    base_input_processing = RetinalUtil._processing_base()
    base_dir = RetinalUtil._landscape_base()
    step = Pipeline.Step.MANUAL
    in_dir = Pipeline._cache_dir(base=base_input_processing,
                                 enum=Pipeline.Step.POLISH)
    out_dir = Pipeline._cache_dir(base=base_dir,enum=step)
    data_input = CheckpointUtilities.lazy_multi_load(in_dir)
    force = True
    functor = lambda : ProcessingUtil.\
        _filter_by_bl(data_input,base_input_processing)
    data = CheckpointUtilities.multi_load(cache_dir=out_dir,load_func=functor,
                                          force=force,
                                          name_func=FEC_Util.fec_name_func)
    # plot each individual
    ProcessingUtil.plot_data(base_dir,step,data,xlim=[-50,150])
    plot_subdir = Pipeline._plot_subdir(base_dir, step)
    out_name = plot_subdir + "heatmap.png"
    ProcessingUtil.heatmap_ensemble_plot(data, out_name=out_name)
Example #3
0
def run():
    """
    <Description>

    Args:
        param1: This is the first param.
    
    Returns:
        This is a description of what is returned.
    """
    base_dir = RetinalUtil._landscape_base()
    step = Pipeline.Step.SANITIZED
    in_dir = Pipeline._cache_dir(base=base_dir, enum=Pipeline.Step.MANUAL)
    out_dir = Pipeline._cache_dir(base=base_dir, enum=step)
    force = True
    limit = None
    min_sep = RetinalUtil.min_sep_landscape()
    max_sep = min_sep + 100e-9
    functor = lambda: slice_data(in_dir, min_sep=min_sep, max_sep=max_sep)
    data = CheckpointUtilities.multi_load(cache_dir=out_dir,
                                          load_func=functor,
                                          force=force,
                                          limit=limit,
                                          name_func=FEC_Util.fec_name_func)
    plot_dir = Pipeline._plot_subdir(base=base_dir, enum=step)
    ProcessingUtil.heatmap_ensemble_plot(data,
                                         out_name=plot_dir + "heatmap.png",
                                         xlim=[-20, max_sep * 1e9])
    # plot each individual
    ProcessingUtil.plot_data(base_dir, step, data)
Example #4
0
def run():
    """
    <Description>

    Args:
        param1: This is the first param.
    
    Returns:
        This is a description of what is returned.
    """
    default_base = "../../../Data/170321FEC/"
    base_dir = Pipeline._base_dir_from_cmd(default=default_base)
    step = Pipeline.Step.ALIGNED
    in_dir = Pipeline._cache_dir(base=base_dir, enum=Pipeline.Step.SANITIZED)
    out_dir = Pipeline._cache_dir(base=base_dir, enum=step)
    force = True
    max_n_pool = multiprocessing.cpu_count() - 1
    n_pool = 6
    N_fit_pts = 20
    min_F_N = 175e-12 if "+Retinal" in base_dir else 90e-12
    data = RetinalUtil.align_data(in_dir,
                                  out_dir,
                                  force=force,
                                  n_pool=n_pool,
                                  min_F_N=min_F_N,
                                  N_fit_pts=N_fit_pts)
    plot_subdir = Pipeline._plot_subdir(base_dir, step)
    xlim_heatmap_nm = [-40, 100]
    ProcessingUtil.heatmap_ensemble_plot(data,
                                         xlim=xlim_heatmap_nm,
                                         out_name=plot_subdir + "heatmap.png")
    # get the post-blacklist heapmap, too..
    data_filtered = ProcessingUtil._filter_by_bl(data, in_dir)
    # align the data...
    data_aligned = [RetinalUtil._polish_helper(d) for d in data_filtered]
    out_name = plot_subdir + "heatmap_bl.png"
    ProcessingUtil.heatmap_ensemble_plot(data_aligned,
                                         xlim=xlim_heatmap_nm,
                                         out_name=out_name)
    # make individual plots
    ProcessingUtil.make_aligned_plot(base_dir,
                                     step,
                                     data,
                                     xlim=[-30, 150],
                                     use_shift=True)
Example #5
0
def run():
    """
    <Description>

    Args:
        param1: This is the first param.
    
    Returns:
        This is a description of what is returned.
    """
    default_base = "../../../Data/170321FEC/"
    base_dir = Pipeline._base_dir_from_cmd(default=default_base)
    step = Pipeline.Step.POLISH
    in_dir = Pipeline._cache_dir(base=base_dir, enum=Pipeline.Step.ALIGNED)
    out_dir = Pipeline._cache_dir(base=base_dir,enum=step)
    plot_dir = Pipeline._plot_subdir(base=base_dir, enum=step)
    force = True
    limit = None
    functor = lambda : polish_data(in_dir)
    data =CheckpointUtilities.multi_load(cache_dir=out_dir,load_func=functor,
                                         force=force,
                                         limit=limit,
                                         name_func=FEC_Util.fec_name_func)
    sizes = [d.Force.size for d in data]
    min_s = min(sizes)
    sliced_data = [d._slice(slice(0,min_s,1)) for d in data]
    for d in sliced_data:
        d.Offset = d.ZSnsr[0]
        d.Extension = d.Separation
        d.kT = 4.1e-21
    data_wham = UtilWHAM.to_wham_input(objs=sliced_data, n_ext_bins=75)
    data_wham.z = np.array([d.ZSnsr for d in sliced_data])
    obj_wham = WeightedHistogram.wham(data_wham)
    data_unpolished = CheckpointUtilities.lazy_multi_load(in_dir)
    f_x_zsnsr = lambda x: x.ZSnsr
    xlim = [-40,150]
    ProcessingUtil.heatmap_ensemble_plot(data,out_name=plot_dir + "heatmap.png",
                                         xlim=xlim)
    ProcessingUtil.heatmap_ensemble_plot(data,f_x=f_x_zsnsr,
                                         out_name=plot_dir + "heatmap_Z.png",
                                         kw_map=dict(x_func=f_x_zsnsr),
                                         xlim=xlim)
    # plot each individual
    f_x = lambda x_tmp : x_tmp.Separation
    plot_subdir = Pipeline._plot_subdir(base_dir, step)
    name_func = FEC_Util.fec_name_func
    _, ylim = ProcessingUtil.nm_and_pN_limits(data,f_x)
    for i,(d_unpolish,d_polish) in enumerate(zip(data_unpolished,data)):
        kw_plot = dict(d_unpolish=d_unpolish,
                       d_polish=d_polish,
                       xlim=xlim,ylim=ylim,i=i)
        fig = PlotUtilities.figure((6,6))
        # make the Separation column
        ax1,ax2 = plt.subplot(2,2,1), plt.subplot(2,2,3)
        polish_plot(ax1, ax2, f_x = lambda x: x.Separation,
                    plot_components_1=True,**kw_plot)
        # make the ZSnsr column
        ax3,ax4 = plt.subplot(2,2,2), plt.subplot(2,2,4)
        polish_plot(ax3, ax4, f_x = lambda x: x.ZSnsr,plot_components_1=False,
                    **kw_plot)
        PlotUtilities.xlabel("Stage Position (nm)", ax=ax4)
        for a in [ax3,ax4]:
            PlotUtilities.no_y_label(ax=a)
            PlotUtilities.ylabel("",ax=a)
        name = plot_subdir + name_func(0, d_polish) + ".png"
        PlotUtilities.savefig(fig,name)