Example #1
0
def run_rf_pipelines(filename_list, output_dir, output_acq_path):
    params = ch_frb_rfi.transform_parameters(
        plot_type='web_viewer',
        make_plots=False,
        bonsai_output_plot_stem=None,
        maskpath=None,
        two_pass=True,
        clip_nt=1024,
        eq_clip_nt=True,
        detrend_nt=1024,
        rfi_level=-1,
        aux_clip_first=True,
        aux_clip_last=True,
        aux_detrend_first=False,
        detrender_niter=1,
        clipper_niter=6,
        plot_nypix=1024,
        plot_nxpix=256,
        plot_downsample_nt=1,
        plot_nzoom=2,
        spline=True,
        bonsai_use_analytic_normalization=False,
        bonsai_hdf5_output_filename=None,
        bonsai_nt_per_hdf5_file=None,
        bonsai_fill_rfi_mask=False,
        var_est=False,
        mask_filler=False,
        bonsai_dynamic_plotter=False,
        bonsai_plot_all_trees=False)

    t1k = ch_frb_rfi.transform_chain(params)
    p1k = rf_pipelines.pipeline(t1k)

    t16k = [rf_pipelines.wi_sub_pipeline(p1k, nfreq_out=1024, nds_out=1)]

    params.detrend_last = True
    t16k += ch_frb_rfi.chains.detrender_chain(params, ix=1, jx=0)

    t16k += [ch_frb_rfi.WriteWeights(basename=output_acq_path + '/data')]
    p16k = rf_pipelines.pipeline(t16k)

    s = rf_pipelines.chime_frb_stream_from_filename_list(filename_list,
                                                         nt_chunk=1024,
                                                         noise_source_align=0)
    ch_frb_rfi.utils.run_in_scratch_dir(output_acq_path, output_dir, s, p16k)
                                             detrender_niter = 2,
                                             clipper_niter = 6,
                                             spline = True,
                                             bonsai_use_analytic_normalization = False,
                                             bonsai_hdf5_output_filename = None,
                                             bonsai_nt_per_hdf5_file = None,
                                             bonsai_fill_rfi_mask = True,
                                             var_est = False,
                                             mask_filler = False,
                                             mask_filler_w_cutoff = 0.5,
                                             bonsai_plot_threshold1 = 7,
                                             bonsai_plot_threshold2 = 10,
                                             bonsai_dynamic_plotter = False,
                                             bonsai_plot_all_trees = make_plots)

    t1k = ch_frb_rfi.transform_chain(params)
    p1k = rf_pipelines.pipeline(t1k)

    params.detrend_last = False
    _t1k = ch_frb_rfi.transform_chain(params)
    _p1k = rf_pipelines.pipeline(_t1k)

    t16k = [ rf_pipelines.wi_sub_pipeline(_p1k, nfreq_out=1024, nds_out=1) ]
    t16k += ch_frb_rfi.chains.detrender_chain(params, ix=0, jx=1)
    p16k = rf_pipelines.pipeline(t16k)

    for (pobj, suffix) in [ (p1k,'1k'), (p16k,'16k') ]:
        suffix2 = '' if make_plots else '-noplot'
        filename = '../../json_files/rfi_%s/17-12-01-two-pass%s.json' % (suffix, suffix2)
        rf_pipelines.utils.json_write(filename, pobj, clobber=clobber)
Example #3
0
    search_name='frb_incoherent_2d', sample_index=3)

p = ch_frb_rfi.transform_parameters(
    plot_type='web_viewer',
    make_plots=True,
    bonsai_output_plot_stem='triggers',
    maskpath='/data/pathfinder/rfi_masks/rfi_20160705.dat',
    detrender_niter=2,
    clipper_niter=6,
    spline=True,
    bonsai_use_analytic_normalization=False,
    bonsai_hdf5_output_filename=None,
    bonsai_nt_per_hdf5_file=None,
    bonsai_fill_rfi_mask=True,
    var_est=False,
    mask_filler=False,
    mask_filler_w_cutoff=0.5,
    bonsai_plot_threshold1=7,
    bonsai_plot_threshold2=10,
    bonsai_dynamic_plotter=False,
    bonsai_plot_all_trees=True,
    L1Grouper_thr=10,
    bonsai_event_outfile='events_s6')

t = ch_frb_rfi.transform_chain(p)
t += [ch_frb_rfi.bonsai.nfreq1K_7tree(p, fpga_counts_per_sample=512, v=3)]

ch_frb_rfi.run_for_web_viewer('s6', s, t)

print ":::::::::::: s6 done ::::::::::::"