def doPointTest(wo, loclevel=10.0):

    logging.info('Doing synthetic test for point (%d,%d,%d)...' %
                 (wo.opdict['syn_ix'], wo.opdict['syn_iy'],
                  wo.opdict['syn_iz']))

    # do the migration
    test_info = generateSyntheticDirac(wo.opdict)
    logging.info(test_info)

    # retrieve output info
    stack_filename = test_info['stack_file']
    nx, ny, nz, nt = test_info['grid_shape']
    dx, dy, dz, dt = test_info['grid_spacing']
    x_orig, y_orig, z_orig = test_info['grid_orig']
    ix_true, iy_true, iz_true, it_true = test_info['true_indexes']
    stack_start_time = test_info['start_time']

    # extract the max stacks
    f_stack = h5py.File(stack_filename, 'r')
    max_val = f_stack['max_val']
    max_x = f_stack['max_x']
    max_y = f_stack['max_y']
    max_z = f_stack['max_z']

    # smooth the max_val
    max_val_smoothed = smooth(max_val[:])

    # launch a location trivver
    locs = trigger_locations_inner(max_val_smoothed, max_x, max_y, max_z,
                                   loclevel, loclevel, stack_start_time, dt)

    f_stack.close()
    return test_info, locs
示例#2
0
def doPointTest(wo, loclevel=10.0):

    logging.info(
        'Doing synthetic test for point (%d,%d,%d)...' %
        (wo.opdict['syn_ix'], wo.opdict['syn_iy'], wo.opdict['syn_iz']))

    # do the migration
    test_info = generateSyntheticDirac(wo.opdict)
    logging.info(test_info)

    # retrieve output info
    stack_filename = test_info['stack_file']
    nx, ny, nz, nt = test_info['grid_shape']
    dx, dy, dz, dt = test_info['grid_spacing']
    x_orig, y_orig, z_orig = test_info['grid_orig']
    ix_true, iy_true, iz_true, it_true = test_info['true_indexes']
    stack_start_time = test_info['start_time']

    # extract the max stacks
    f_stack = h5py.File(stack_filename, 'r')
    max_val = f_stack['max_val']
    max_x = f_stack['max_x']
    max_y = f_stack['max_y']
    max_z = f_stack['max_z']

    # smooth the max_val
    max_val_smoothed = smooth(max_val[:])

    # launch a location trivver
    locs = trigger_locations_inner(max_val_smoothed, max_x, max_y, max_z,
                                   loclevel, loclevel, stack_start_time, dt)

    f_stack.close()
    return test_info, locs
示例#3
0
wo.opdict['search_grid'] = 'grid.Taisne.search.hdr'

wo.opdict['stations'] = 'coord_stations_test'

#uncomment remove some stations to test response for fewer stations
#wo.opdict['sta_list']="FJS,FLR,FOR,HDL,RVL,SNE,UV01,UV02,UV03,UV04,UV05,UV06,UV07,UV08,UV09,UV10,UV11,UV12,UV13,UV14,UV15"

wo.opdict['syn_amplitude']  = 1.0
wo.opdict['syn_datalength'] = 20.0
wo.opdict['syn_samplefreq'] = 100.0
wo.opdict['syn_kwidth']     = 0.1
wo.opdict['syn_otime']      = 6.0
wo.opdict['syn_ix']         = 16
wo.opdict['syn_iy']         = 8
wo.opdict['syn_iz']         = 6
wo.opdict['syn_filename']   = 'test_grid4D_hires.hdf5'

wo.opdict['plot_otime_window']=5.0

# sanity check on synthetic options
wo.verify_synthetic_options()

# Run the synthetic migration
test_info = generateSyntheticDirac(wo.opdict)

# Plot the synthetic migration
base_path = wo.opdict['base_path']
figdir    = os.path.join(base_path,'out',wo.opdict['outdir'],'fig')
plotDiracTest(test_info,figdir,wo.opdict['plot_otime_window'])