Example #1
0
def find_doppler(filename_fil):
    """ Run turboseti doppler search on filename with default params """
    t0 = time.time()
    print("\n===== find_doppler =====")
    print("Searching %s" % filename_fil)
    filename_dat = filename_fil.replace('.h5', '.dat')
    filename_log = filename_fil.replace('.h5', 'log')

    if os.path.exists(filename_dat):
        os.remove(filename_dat)

    if os.path.exists(filename_log):
        os.remove(filename_log)

    snr           = 5
    coarse_chans  = ''
    obs_info      = None
    n_coarse_chan = 1
    max_drift     = 1.0

    find_seti_event = FindDoppler(filename_fil, max_drift=max_drift, snr=snr, out_dir=HERE,
                                  coarse_chans=coarse_chans, obs_info=obs_info, n_coarse_chan=n_coarse_chan)
    find_seti_event.search()
    t_taken = time.time() - t0
    print("Time taken: %2.2fs" % t_taken)
Example #2
0
def find_doppler(filename_fil, kernels):
    r""" Run turboseti doppler search on filename with default params """
    print("\n===== find_doppler =====")
    print("Searching %s" % filename_fil)
    filename_dat = filename_fil.replace('.h5', '.dat')
    filename_log = filename_fil.replace('.h5', 'log')

    if os.path.exists(filename_dat):
        os.remove(filename_dat)

    if os.path.exists(filename_log):
        os.remove(filename_log)

    snr = 5.0
    coarse_chans = ''
    obs_info = None
    n_coarse_chan = 1
    max_drift = 1.0

    find_seti_event = FindDoppler(filename_fil,
                                  max_drift=max_drift,
                                  snr=snr,
                                  out_dir=HERE,
                                  coarse_chans=coarse_chans,
                                  obs_info=obs_info,
                                  n_coarse_chan=n_coarse_chan,
                                  kernels=kernels)

    t0 = time.time()
    find_seti_event.search()
    t_taken = time.time() - t0
    print(
        "Time taken for find_seti_event.search() [without flagging]: %2.2fs" %
        t_taken)

    find_seti_event.flagging = True
    t0 = time.time()
    for dummy, data_dict in enumerate(find_seti_event.data_handle.data_list):
        search_coarse_channel(data_dict,
                              find_seti_event,
                              filewriter=None,
                              logwriter=None)
    t_taken = time.time() - t0
    print("Time taken for search_coarse_channe() [with flagging]: %2.2fs" %
          t_taken)
Example #3
0
def test_dask():
    """ Test dask capability on Voyager data """
    filename_fil = os.path.join(HERE, VOYAH5)
    FD = FindDoppler(datafile=filename_fil, max_drift=2, out_dir=HERE)
    print("===== test_dask ===== n_partitions=None")
    FD.search()
    print("===== test_dask ===== n_partitions=2")
    FD.search(n_partitions=2)
    print("===== test_dask ===== n_partitions=2, progress_bar='n'")
    FD.search(n_partitions=2, progress_bar='n')
    print("===== test_dask ===== End")
Example #4
0
def find_doppler(filename_fil):
    """ Run turboseti doppler search on filename with default params """
    print("Searching %s" % filename_fil)
    suffix = os.path.splitext(filename_fil)[1]
    filename_dat = filename_fil.replace(suffix, '.dat')
    filename_log = filename_fil.replace(suffix, 'log')

    if os.path.exists(filename_dat):
        os.remove(filename_dat)

    if os.path.exists(filename_log):
        os.remove(filename_log)

    snr           = 5
    coarse_chans  = ''
    obs_info      = None
    n_coarse_chan = 1
    max_drift     = 1.0

    find_seti_event = FindDoppler(filename_fil, max_drift=max_drift, snr=snr, out_dir=HERE,
                                  coarse_chans=coarse_chans, obs_info=obs_info, n_coarse_chan=n_coarse_chan)
    find_seti_event.search()
def find_doppler(filename_fil, kernels):
    r""" Run turboseti doppler search with and without flagging """
    print("\n===== find_doppler =====")
    print("Searching %s" % filename_fil)
    filename_dat = filename_fil.replace('.h5', '.dat')
    filename_log = filename_fil.replace('.h5', 'log')

    if os.path.exists(filename_dat):
        os.remove(filename_dat)

    if os.path.exists(filename_log):
        os.remove(filename_log)

    find_seti_event = FindDoppler(filename_fil,
                                  max_drift=MAX_DRIFT,
                                  snr=MIN_SNR,
                                  out_dir=TESTDIR,
                                  obs_info=None,
                                  n_coarse_chan=1,
                                  kernels=kernels)

    t0 = time.time()
    find_seti_event.search()
    t_taken = time.time() - t0
    print(
        "Time taken for find_seti_event.search() [without flagging]: %2.2fs" %
        t_taken)

    find_seti_event.flagging = True
    t0 = time.time()
    for dummy, data_dict in enumerate(find_seti_event.data_handle.data_list):
        search_coarse_channel(data_dict,
                              find_seti_event,
                              filewriter=None,
                              logwriter=None)
    t_taken = time.time() - t0
    print("Time taken for search_coarse_channe() [with flagging]: %2.2fs" %
          t_taken)
def test_dask(kernels):
    r""" Test dask capability on Voyager data """
    print("\n===== test_dask ===== begin")
    filename_h5 = os.path.join(TESTDIR, VOYAH5)
    FD = FindDoppler(datafile=filename_h5,
                     max_drift=MAX_DRIFT,
                     out_dir=TESTDIR,
                     kernels=kernels)
    print("===== test_dask ===== n_partitions=None")
    FD.search()
    print("===== test_dask ===== n_partitions=2")
    FD.search(n_partitions=2)
    print("===== test_dask ===== n_partitions=2, progress_bar='n'")
    FD.search(n_partitions=2, progress_bar='n')
    print(
        "===== test_dask ===== merge resulted in a DAT for both flipped and unflipped H5"
    )
    unflipped_dat = filename_h5.replace('.h5', '.dat')
    filename_h5 = os.path.join(TESTDIR, VOYAH5FLIPPED)
    FD = FindDoppler(datafile=filename_h5,
                     max_drift=MAX_DRIFT,
                     out_dir=TESTDIR,
                     kernels=kernels)
    FD.search(n_partitions=2)
    flipped_dat = filename_h5.replace('.h5', '.dat')
    assert os.path.exists(unflipped_dat)
    assert os.path.exists(flipped_dat)
    print("===== test_dask ===== End")
Example #7
0
def test_dask():
    """ Test dask capability on Voyager data """
    filename_h5 = os.path.join(HERE, VOYAH5)
    FD = FindDoppler(datafile=filename_h5, max_drift=2, out_dir=HERE)
    print("===== test_dask ===== n_partitions=None")
    FD.search()
    print("===== test_dask ===== n_partitions=2")
    FD.search(n_partitions=2)
    print("===== test_dask ===== n_partitions=2, progress_bar='n'")
    FD.search(n_partitions=2, progress_bar='n')
    print(
        "===== test_dask ===== merge resulted in a DAT for both flipped and unflipped H5"
    )
    unflipped_dat = filename_h5.replace('.h5', '.dat')
    filename_h5 = os.path.join(HERE, VOYAH5FLIPPED)
    FD = FindDoppler(datafile=filename_h5, max_drift=2, out_dir=HERE)
    FD.search(n_partitions=2)
    flipped_dat = filename_h5.replace('.h5', '.dat')
    assert os.path.exists(unflipped_dat)
    assert os.path.exists(flipped_dat)
    print("===== test_dask ===== End")