コード例 #1
0
        # Compute potential at each electrode
        dtemp = (P1 * phi - P2 * phi) * np.pi

        data.append(dtemp)
        unct.append(np.abs(dtemp) * pct + flr)

        print("--- %s seconds ---" % (time.time() - start_time))

    survey.dobs = np.hstack(data)
    survey.std = np.hstack(unct)
    #%% Run 2D inversion if pdp or dpdp survey
    # Otherwise just plot and apparent susceptibility map
    #if not re.match(stype,'gradient'):

    #%% Write data file in UBC-DCIP3D format
    DC.writeUBC_DCobs(home_dir + '\FWR_data3D.dat', survey, '3D', 'SURFACE')

    #%% Load 3D data
    #[Tx, Rx, data, wd] = DC.readUBC_DC3Dobs(home_dir + '\FWR_data3D.dat')

    #%% Convert 3D obs to 2D and write to file
    survey2D = DC.convertObs_DC3D_to_2D(survey,
                                        np.ones(survey.nSrc),
                                        flag='Xloc')

    DC.writeUBC_DCobs(home_dir + '\FWR_3D_2_2D.dat', survey2D, '2D', 'SURFACE')

    #%% Create a 2D mesh along axis of Tx end points and keep z-discretization
    dx = np.min([np.min(mesh.hx), np.min(mesh.hy)])
    nc = np.ceil(dl_len / dx) + 3
コード例 #2
0
         size=6,
         bbox=bbox_props)

# Run both left and right survey seperately
for kk in range(2):

    if kk == 0:

        survey = DC2D_l

    if kk == 1:

        survey = DC2D_r

    # Export data file
    DC.writeUBC_DCobs(inv_dir + dsep + obsfile2d, survey, '2D', 'SIMPLE')

    # Write input file
    fid = open(inv_dir + dsep + inp_file, 'w')
    fid.write('OBS LOC_X %s \n' % obsfile2d)
    fid.write('MESH FILE %s \n' % mshfile2d)
    fid.write('CHIFACT 1 \n')
    fid.write('TOPO DEFAULT \n')
    fid.write('INIT_MOD VALUE %e\n' % ini_mod)
    fid.write('REF_MOD VALUE %e\n' % ref_mod)
    fid.write('ALPHA VALUE %f %f %F\n' % (1. / dx**4., 1, 1))
    fid.write('WEIGHT DEFAULT\n')
    fid.write('STORE_ALL_MODELS FALSE\n')
    fid.write('INVMODE SVD\n')
    #fid.write('CG_PARAM 200 1e-4\n')
    fid.write('USE_MREF FALSE\n')