示例#1
0
# We initialize the refraction manager.
mgr = TravelTimeManager()

# Alternatively, one can plot a matrix plot of apparent velocities which is the
# more general function also making sense for crosshole data.
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)

ax, cbar = mgr.showResult(logScale=True)
mgr.drawRayPaths(ax=ax, color="w", lw=0.3, alpha=0.5)

################################################################################
# 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 play around with the gradient starting model (`vTop` and `vBottom`
# arguments) and the regularization strength `lam`. You can also customize the
# mesh.
    fig1.tight_layout()
    fig1.savefig('ModelResults.png', dpi=600)

    fig2 = plt.figure('Ray Coverage P-wave')
    vel = ra.paraModel()
    fig2.set_size_inches([8, 8])
    ax = fig2.add_subplot(211)
    pg.show(ra.paraDomain,
            vel,
            coverage=ra.standardizedCoverage(),
            cMin=100,
            cMax=4000,
            cmap='jet_r',
            ax=ax)
    pg.viewer.mpl.drawSensors(ax, data.sensorPositions(), diam=0.5, color="k")
    ra.drawRayPaths(ax, color="k")
    ax.set_xlabel('Distance (m)')
    ax.set_ylabel('Elevation (m)')
    ax.set_title('Ray Paths')
    ax2 = fig2.add_subplot(212)
    tmpCov = ra.coverage()
    tmpCov[np.isneginf(tmpCov)] = 0
    pg.show(mesh,
            data=tmpCov,
            coverage=ra.standardizedCoverage(),
            cMin=0,
            cMax=10,
            ax=ax2,
            cmap='plasma')
    pg.viewer.mpl.drawSensors(ax2, data.sensorPositions(), diam=0.5, color="k")
    ax2.set_xlabel('Distance (m)')