#Calculate Vertical Gradient
    vel = ra.paraModel()

    vertGrad = pg.solver.grad(mesh, vel)
    #pr = np.array(pr)
    #ind = np.where(pr<0)
    #pr[ind] = 0
    #ind = np.where(pr>0.5)
    #pr[ind] = 0.5

    #Save Results as a .vtk file (Paraview)
    mesh.addData('P-wave Velocity', vel)
    mesh.addData('Vertical Velocity Gradient', vertGrad)
    mesh.addData('cov', ra.coverage())
    mesh.addData('stdCov', ra.standardizedCoverage())
    mesh.exportVTK(pickFile.split('.')[0] + '_gimliResults.vtk')

    #Spatially Locate the Profile
    spatiallyLocateVTKFile(
        pickFile.split('.')[0] + '_gimliResults.vtk', SoL, EoL)

    #******************** PLOT AND SAVE RESULTS ******************************
    fig1 = plt.figure('Model Results')
    fig1.set_size_inches([12, 8])
    ax = fig1.add_subplot(211)
    vel = ra.paraModel()
    pg.show(mesh,
            vel,
            coverage=ra.standardizedCoverage(),
            cMin=100,
Example #2
0
ax, cbar = mgr.showData(data)

################################################################################
# Finally, we call the `invert` method and plot the result.The mesh is created
# based on the sensor positions on-the-fly.

mgr.invert(data, secNodes=3, paraMaxCellSize=5.0,
           zWeight=0.2, vTop=500, vBottom=5000,
           verbose=1)

################################################################################
# Show result and fit of measured data and model response. You may want to save your results too.

fig = mgr.showResultAndFit()
mgr.saveResult()

################################################################################
# You can plot only the model and customize with a bunch of keywords

ax, cbar = mgr.showResult(logScale=False, cMin=500, cMax=3000, cMap="plasma_r",
                          coverage=mgr.standardizedCoverage())
mgr.drawRayPaths(ax=ax, color="k", lw=0.3, alpha=0.5)

# mgr.coverage() yields the ray coverage in m and standardizedCoverage as 0/1

################################################################################
# You can play around with the gradient starting model (`vTop` and `vBottom`
# arguments) and the regularization strength `lam`. You can also customize the
# mesh.