Minor updates to titles in examples.

This commit is contained in:
Rowan Cockett
2016-05-29 17:21:37 -07:00
parent feba384911
commit 5e2a8232a3
7 changed files with 21 additions and 17 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ import matplotlib.pyplot as plt
def run(plotIt=True):
"""
MT: 1D: Inversion
=======================
=================
Forward model 1D MT data.
Setup and run a MT 1D inversion.
+5 -6
View File
@@ -5,14 +5,14 @@ import SimPEG as simpeg
from SimPEG import MT
import numpy as np
try:
from pymatsolver import MumpsSolver as Solver
from pymatsolver import MumpsSolver as solver
except:
from SimPEG import Solver
from SimPEG import solver
def run(plotIt=True, nFreq=1):
"""
MT: 3D: Forward
=======================
===============
Forward model 3D MT data.
@@ -47,15 +47,14 @@ def run(plotIt=True, nFreq=1):
## Setup the problem object
problem = MT.Problem3D.eForm_ps(M, sigmaPrimary=sigBG)
problem.pair(survey)
problem.Solver = Solver
problem.pair(survey, Solver=solver)
# Calculate the data
fields = problem.fields(sig)
dataVec = survey.eval(fields)
# Make the data
mtData = MT.Data(survey,dataVec)
mtData = MT.Data(survey, dataVec)
# Add plots
if plotIt:
pass
+9 -7
View File
@@ -2,8 +2,12 @@ from SimPEG import *
from SimPEG.Utils import surface2ind_topo
def run(plotIt=False, nx = 5, ny = 5):
def run(plotIt=False, nx=5, ny=5):
"""
Utils: surface2ind_topo
=======================
Here we show how to use :code:`Utils.surface2ind_topo` to identify cells below
a topographic surface.
@@ -13,27 +17,25 @@ def run(plotIt=False, nx = 5, ny = 5):
xtopo = np.linspace(mesh.gridN[:,0].min(), mesh.gridN[:,0].max())
topo = 0.4*np.sin(xtopo*5) # define a topographic surface
Topo = np.hstack([Utils.mkvc(xtopo,2),Utils.mkvc(topo,2)]) #make it an array
Topo = np.hstack([Utils.mkvc(xtopo,2), Utils.mkvc(topo,2)]) #make it an array
indcc = surface2ind_topo(mesh, Topo,'CC')
indcc = surface2ind_topo(mesh, Topo, 'CC')
if plotIt:
from matplotlib.pylab import plt
from scipy.interpolate import interp1d
fig, ax = plt.subplots(1,1,figsize=(6,6))
fig, ax = plt.subplots(1,1, figsize=(6,6))
mesh.plotGrid(ax=ax, nodes=True, centers=True)
ax.plot(xtopo,topo,'k',linewidth=1)
# ax.plot(mesh.vectorNx, interp1d(xtopo,topo)(mesh.vectorNx),'--k',linewidth=3)
ax.plot(mesh.vectorCCx, interp1d(xtopo,topo)(mesh.vectorCCx),'--k',linewidth=3)
aveN2CC = Utils.sdiag(mesh.aveN2CC.T.sum(1))*mesh.aveN2CC.T
a = aveN2CC * indcc
a[a > 0] = 1.
a[a < 0.25] = np.nan
a = a.reshape(mesh.vnN, order='F')
masked_array = np.ma.array(a, mask=np.isnan(a))
ax.pcolor(mesh.vectorNx,mesh.vectorNy,masked_array.T, cmap = plt.cm.gray,alpha=0.2)
ax.pcolor(mesh.vectorNx,mesh.vectorNy,masked_array.T, cmap=plt.cm.gray, alpha=0.2)
plt.show()
@@ -22,7 +22,6 @@ radi = Radius of spheres [r1,r2]
param = Conductivity of background and two spheres [m0,m1,m2]
surveyType = survey type 'pole-dipole' or 'dipole-dipole'
unitType = Data type "appResistivity" | "appConductivity" | "volt"
Created by @fourndo
+1 -1
View File
@@ -10,7 +10,7 @@
MT: 1D: Inversion
=======================
=================
Forward model 1D MT data.
Setup and run a MT 1D inversion.
+1 -1
View File
@@ -10,7 +10,7 @@
MT: 3D: Forward
=======================
===============
Forward model 3D MT data.
+4
View File
@@ -9,6 +9,10 @@
.. --------------------------------- ..
Utils: surface2ind_topo
=======================
Here we show how to use :code:`Utils.surface2ind_topo` to identify cells below
a topographic surface.