示例#1
0
文件: s6.py 项目: ap-roman/ch_frb_rfi
    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 ::::::::::::"
bonsai_config_filename = '/data/bonsai_configs/bonsai_nfreq1024_7tree_f512_v3.hdf5'
nt_tot = 8192 * 1024
n_zoom = 8

s = rf_pipelines.gaussian_noise_stream(nfreq=1024,
                                       nt_tot=nt_tot,
                                       freq_lo_MHz=400.0,
                                       freq_hi_MHz=800.0,
                                       dt_sample=1.31072e-3)

t_masker = rf_pipelines.adversarial_masker()

t_plotter = rf_pipelines.plotter_transform(img_prefix='waterfall1',
                                           img_nfreq=256,
                                           img_nt=256,
                                           downsample_nt=16,
                                           n_zoom=n_zoom)

t_dedisp = rf_pipelines.bonsai_dedisperser(
    config_filename=bonsai_config_filename,
    fill_rfi_mask=True,
    img_prefix='toy_pipeline',
    img_ndm=256,
    img_nt=256,
    downsample_nt=16,
    n_zoom=n_zoom,
    plot_all_trees=True)

ch_frb_rfi.run_for_web_viewer('adversarial_masker', s,
                              [t_masker, t_plotter, t_dedisp])
示例#3
0
    '/data/17-10-01-16k-to-1k/17-04-25-utkarsh-26m-part0/*.h5', 0, 1)

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_derippled')

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

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

print ":::::::::::: derippled done ::::::::::::"
示例#4
0
                                         bonsai_dynamic_plotter = False,
                                         bonsai_plot_all_trees = make_plots,
                                         detrend_last = not detrend_16k,
                                         mask_counter = True)

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) ]

if detrend_16k:
    params.detrend_last = True
    params.mask_counter = False
    t16k += ch_frb_rfi.chains.detrender_chain(params, ix=1, jx=0)
    params.append_plotter_transform(t16k, 'dc_out_last')

if write_json:
    assert isinstance(output_path, str) and output_path.endswith('.json')
    p16k = rf_pipelines.pipeline(t16k)
    rf_pipelines.utils.json_write(output_path, p16k, clobber=True)
    #rf_pipelines.utils.json_write('design-rfi-config_acq.json', s, clobber=True)

#w = ch_frb_rfi.WriteWeights(nt_chunk=1024*2)
#t16k += [ w, ch_frb_rfi.bonsai.nfreq16K_production(params, v=4, beta=2, u=False) ]
t16k.append(ch_frb_rfi.bonsai.nfreq16K_production(params, v=4, beta=2, u=False))

p16k = rf_pipelines.pipeline([s]+t16k)
ch_frb_rfi.run_for_web_viewer('design-rfi-config', p16k)

print 'design-rfi-config done!'
示例#5
0
                                  clobber=True)

t16k += [ch_frb_rfi.bonsai.nfreq16K_production(params, 2, False)]
p16k = rf_pipelines.pipeline([s] + t16k)

ch_frb_rfi.run_in_scratch_dir('astro-events', None, p16k)
p16k.unbind()

params.var_est = False
params.mask_filler = True
params.make_plots = True
params.bonsai_plot_all_trees = True
params.bonsai_output_plot_stem = 'triggers'

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)]

if detrend_16k:
    params.detrend_last = True
    t16k += ch_frb_rfi.chains.detrender_chain(params, ix=1, jx=0)
    params.append_plotter_transform(t16k, 'dc_out_last')

t16k += [ch_frb_rfi.bonsai.nfreq16K_production(params, 2, False)]
p16k = rf_pipelines.pipeline([s] + t16k)

ch_frb_rfi.run_for_web_viewer('astro-events', p16k)

print 'astro-events done!'
示例#6
0
# Using the specified parameters make a chain of transforms for estimating the variance.
t = ch_frb_rfi.transform_chain(p)

# Combine stream and transforms into a pipeline.
pipeline = rf_pipelines.pipeline([s]+t)

# The purpose of the first pipeline run is to create the h5 file containing variance
# estimates (p.var_filename = './var_example2.h5').  We do this pipeline run using the
# wrapper function run_in_scratch_dir(), which does not index the run with the web viewer.
ch_frb_rfi.run_in_scratch_dir('example2', pipeline)

# In the v16 API, need to "unbind" the pipeline after running, before its constituent
# pipeline_objects can be reused in another pipeline run.
pipeline.unbind()

# Remove the variance_estimator, append the mask_filler and plotter transforms.
p.var_est = False
p.mask_filler = True
p.make_plots = True

t = ch_frb_rfi.transform_chain(p)
t += [ ch_frb_rfi.bonsai.nfreq1K_3tree(p, fpga_counts_per_sample=512, v=1) ]
pipeline = rf_pipelines.pipeline([s]+t)

# Second pipeline run: we use the wrapper function run_for_web_viewer().
# Run the pipeline (again) but now with the mask_filler and bonsai dedisperser.
ch_frb_rfi.run_for_web_viewer('example2', pipeline)

print "example2.py: pipeline run successful!"
print "You can view the result at http://frb1.physics.mcgill.ca:5000/"