Example #1
0
def rf2depth():
    parser = argparse.ArgumentParser(description="Convert Ps RF to depth axis")
    parser.add_argument(
        '-d',
        help='Path to 3d vel model in npz file for moveout correcting',
        type=str,
        default='')
    parser.add_argument(
        '-r',
        help='Path to 3d vel model in npz file for 1D ray tracing',
        type=str,
        default='')
    parser.add_argument('cfg_file', type=str, help='Path to configure file')
    arg = parser.parse_args()
    if len(sys.argv) == 1:
        parser.print_help()
        sys.exit(1)
    cpara = ccppara(arg.cfg_file)
    if arg.d != '' and arg.r != '':
        raise ValueError('Specify only 1 argument in \'-d\' and \'-r\'')
    elif arg.d != '' and arg.r == '':
        makedata3d(cpara, arg.d)
    elif arg.d == '' and arg.r != '':
        makedata(cpara, arg.r)
    else:
        makedata(cpara)
Example #2
0
 def load_para(self, cfg_file):
     try:
         self.cpara = ccppara(cfg_file)
     except Exception as e:
         self.logger.CCPlog.error(
             'Cannot open configure file {}'.format(cfg_file))
         raise FileNotFoundError('{}'.format(e))
     try:
         self.stack_mul = check_stack_val(self.cpara.stack_val,
                                          self.cpara.dep_val)
     except Exception as e:
         self.logger.CCPlog.error('{}'.format(e))
         raise ValueError('{}'.format(e))
Example #3
0
def line_stack(cfg_file):
    global sta_num, rfdepth
    cpara = ccppara(cfg_file)
    rfdepth = loadmat(cpara.depthdat)['RFdepth']
    sta_num = rfdepth.shape[1]
    da, profile_range, profile_lat, profile_lon = gen_profile(
        cpara.line, cpara.slid_val)
    staname, stla, stlo = read_stations(rfdepth)
    sta_idx, projstla, projstlo = search_stations(cpara, da, staname, stla,
                                                  stlo)
    bin_radius = gen_bin_radius(cpara)
    proj = project(sta_idx, cpara)

    stack_data = find_falling(proj, cpara, profile_range, profile_lat,
                              profile_lon, bin_radius)
    savemat(cpara.stackfile, {'Stack_data': stack_data}, oned_as='column')
Example #4
0
def rf2depth():
    parser = argparse.ArgumentParser(description="Convert Ps RF to depth axis")
    parser.add_argument(
        '-d',
        help='Path to 3d vel model in npz file for moveout correcting',
        metavar='3d_velmodel_path',
        type=str,
        default='')
    parser.add_argument(
        '-m',
        help=
        'Folder path to 1d vel model files with staname.vel as the file name',
        metavar='1d_velmodel_folder',
        type=str,
        default='')
    parser.add_argument(
        '-r',
        help='Path to 3d vel model in npz file for 3D ray tracing',
        metavar='3d_velmodel_path',
        type=str,
        default='')
    parser.add_argument('cfg_file', type=str, help='Path to configure file')
    arg = parser.parse_args()
    if len(sys.argv) == 1:
        parser.print_help()
        sys.exit(1)
    cpara = ccppara(arg.cfg_file)
    if arg.d != '' and arg.r != '':
        raise ValueError('Specify only 1 argument in \'-d\' and \'-r\'')
    elif arg.d != '' and arg.r == '' and arg.m == '':
        makedata3d(cpara, arg.d, raytracing3d=False)
    elif arg.d == '' and arg.r != '' and arg.m == '':
        makedata3d(cpara, arg.r, raytracing3d=True)
    elif arg.d == '' and arg.r == '' and arg.m != '':
        makedata(cpara, modfolder1d=arg.m)
    else:
        makedata(cpara)
Example #5
0
def test_sub01():
    para = ccppara('ex-ccp/ccp.cfg')
    para.rfpath = 'ex-ccp/RFresult'
    para.stalist = 'ex-ccp/sta.lst'
    para.stack_sta_list = ''
    makedata(para)
Example #6
0
        '-d',
        help='Path to 3d vel model in npz file for moveout correcting',
        type=str,
        default='')
    parser.add_argument(
        '-r',
        help='Path to 3d vel model in npz file for 1D ray tracing',
        type=str,
        default='')
    parser.add_argument('cfg_file', type=str, help='Path to configure file')
    arg = parser.parse_args()
    if len(sys.argv) == 1:
        parser.print_help()
        sys.exit(1)
    cpara = ccppara(arg.cfg_file)
    if arg.d != '' and arg.r != '':
        raise ValueError('Specify only 1 argument in \'-d\' and \'-r\'')
    elif arg.d != '' and arg.r == '':
        makedata3d(cpara, arg.d)
    elif arg.d == '' and arg.r != '':
        makedata(cpara, arg.r)
    else:
        makedata(cpara)


if __name__ == '__main__':
    cfg_file = '/Users/xumj/Researches/Tibet_MTZ/process/paraCCP.cfg'
    vel3d_file = '/Users/xumj/Researches/Tibet_MTZ/models/GYPSUM.npz'
    cpara = ccppara(cfg_file)
    makedata3d(cpara, vel3d_file)