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.FILTERED in_dir = Pipeline._cache_dir(base=base_dir, enum=Pipeline.Step.READ) out_dir = Pipeline._cache_dir(base=base_dir, enum=step) force = True limit = None f_filter_Hz = 5e3 # filter to X s t_filter_s = 1 / f_filter_Hz # t_filter -> n_filter_points # after filtering, take every N points, where # N = f_decimate * n_filter_points # in other words, we oversample by 1/f_decimate f_decimate = 0.33 assert f_decimate < 1 and f_decimate > 0 data = filter_data(in_dir, out_dir, force, t_filter_s, f_decimate) ProcessingUtil.plot_data(base_dir, step, data, markevery=1)
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)
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.CORRECTED in_dir = Pipeline._cache_dir(base=base_dir, enum=Pipeline.Step.FILTERED) out_dir = Pipeline._cache_dir(base=base_dir, enum=step) force = True n_filter = 10 data = filter_data(in_dir, out_dir, force, n_filter) ProcessingUtil.plot_data(base_dir, step, data, markevery=1)
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.READ cache_dir = Pipeline._cache_dir(base=base_dir, enum=step) force = True limit = None functor = lambda: read_all_data(base_dir) data = CheckpointUtilities.multi_load(cache_dir=cache_dir, load_func=functor, force=force, limit=limit, name_func=FEC_Util.fec_name_func) ProcessingUtil.plot_data(base_dir, step, data, markevery=100)
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.SANITIZED in_dir = Pipeline._cache_dir(base=base_dir, enum=Pipeline.Step.CORRECTED) out_dir = Pipeline._cache_dir(base=base_dir,enum=step) force = True max_n_pool = 6 n_pool = max_n_pool kw_feather = RetinalUtil._def_kw_FEATHER() data = align_data(in_dir,out_dir,force=force,n_pool=n_pool, **kw_feather) # plot all of the FEATHER information plot_subdir = Pipeline._plot_subdir(base_dir, step) PlotUtil._feather_plot(data,plot_subdir)
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)
def _processing_base(default_base="../../../Data/BR+Retinal/170321FEC/",**kw): return Pipeline._base_dir_from_cmd(default=default_base,**kw)