From 51c112a5294590184d354d355ad19f61cf8d6ae4 Mon Sep 17 00:00:00 2001 From: Rowan Cockett Date: Sun, 26 Jun 2016 16:07:35 -0600 Subject: [PATCH] Updates to documentation and DC utilities. --- SimPEG/EM/Static/Utils/StaticUtils.py | 16 +++++++++------- SimPEG/EM/Static/__init__.py | 1 + SimPEG/Examples/DC_Forward_PseudoSection.py | 10 ++++++++-- docs/content/dc/index.rst | 4 ++-- docs/content/ip/index.rst | 2 +- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/SimPEG/EM/Static/Utils/StaticUtils.py b/SimPEG/EM/Static/Utils/StaticUtils.py index 43181c8a..cf21f17f 100644 --- a/SimPEG/EM/Static/Utils/StaticUtils.py +++ b/SimPEG/EM/Static/Utils/StaticUtils.py @@ -219,10 +219,12 @@ def gen_DCIPsurvey(endl, mesh, stype, a, b, n): for ii in range(0, int(nstn)-1): - if stype == 'dpdp': + if stype == 'dipole-dipole': tx = np.c_[M[ii,:],N[ii,:]] - elif stype == 'pdp': + elif stype == 'pole-dipole': tx = np.c_[M[ii,:],M[ii,:]] + else: + raise Exception('The stype must be "dipole-dipole" or "pole-dipole"') # Rx.append(np.c_[M[ii+1:indx,:],N[ii+1:indx,:]]) @@ -256,10 +258,10 @@ def gen_DCIPsurvey(endl, mesh, stype, a, b, n): P2 = np.c_[stn_x+a*dl_x, np.ones(nstn).T*ztop] rxClass = DC.Rx.Dipole_ky(P1, P2) - if stype == 'dpdp': - srcClass = DC.Src.Dipole([rxClass], M[ii,:],N[ii,:]) - elif stype == 'pdp': - srcClass = DC.Src.Pole([rxClass], M[ii,:]) + if stype == 'dipole-dipole': + srcClass = DC.Src.Dipole([rxClass], M[ii,:],N[ii,:]) + elif stype == 'pole-dipole': + srcClass = DC.Src.Pole([rxClass], M[ii,:]) SrcList.append(srcClass) elif stype == 'gradient': @@ -310,7 +312,7 @@ def gen_DCIPsurvey(endl, mesh, stype, a, b, n): srcClass = DC.Src.Dipole([rxClass], M[0,:], N[-1,:]) SrcList.append(srcClass) else: - print """stype must be either 'pdp', 'dpdp' or 'gradient'. """ + print """stype must be either 'pole-dipole', 'dipole-dipole' or 'gradient'. """ return SrcList diff --git a/SimPEG/EM/Static/__init__.py b/SimPEG/EM/Static/__init__.py index f6e0e757..fa375249 100644 --- a/SimPEG/EM/Static/__init__.py +++ b/SimPEG/EM/Static/__init__.py @@ -1,3 +1,4 @@ import DC import IP import SIP +import Utils diff --git a/SimPEG/Examples/DC_Forward_PseudoSection.py b/SimPEG/Examples/DC_Forward_PseudoSection.py index 240cbb33..01662021 100644 --- a/SimPEG/Examples/DC_Forward_PseudoSection.py +++ b/SimPEG/Examples/DC_Forward_PseudoSection.py @@ -1,5 +1,5 @@ from SimPEG import Mesh, Utils, np, sp -import SimPEG.DCIP as DC +from SimPEG.EM.Static import DC, Utils as StaticUtils import time def run(loc=None, sig=None, radi=None, param=None, surveyType='dipole-dipole', unitType='appConductivity', plotIt=True): @@ -74,7 +74,13 @@ def run(loc=None, sig=None, radi=None, param=None, surveyType='dipole-dipole', u # We will handle the geometry of the survey for you and create all the combination of tx-rx along line # [Tx, Rx] = DC.gen_DCIPsurvey(locs, mesh, surveyType, param[0], param[1], param[2]) - survey, Tx, Rx = DC.gen_DCIPsurvey(locs, mesh, surveyType, param[0], param[1], param[2]) + srcList = StaticUtils.gen_DCIPsurvey(locs, mesh, surveyType, param[0], param[1], param[2]) + print(srcList) + + raise Exception('The output of the function changed. We need to create the survey and get Rx to continue.') + + # Something like this! + survey, Tx, Rx # Define some global geometry dl_len = np.sqrt( np.sum((locs[0,:] - locs[1,:])**2) ) diff --git a/docs/content/dc/index.rst b/docs/content/dc/index.rst index 27ec89bd..e3c92f44 100644 --- a/docs/content/dc/index.rst +++ b/docs/content/dc/index.rst @@ -40,7 +40,7 @@ Direct Current Resistivity ************************** -`SimPEG.DCIP` uses SimPEG as the framework for the forward and inverse +`SimPEG.EM.Static.DC` and `SimPEG.EM.Static.IP` uses SimPEG as the framework for the forward and inverse direct current (DC) resistivity and induced polarization (IP) geophysical problems. @@ -150,7 +150,7 @@ Comparing to the analytic function: API for DC codes ================ -.. automodule:: SimPEG.DCIP.BaseDC +.. automodule:: SimPEG.EM.Static.DC :show-inheritance: :members: :undoc-members: diff --git a/docs/content/ip/index.rst b/docs/content/ip/index.rst index 68def737..d5dde074 100644 --- a/docs/content/ip/index.rst +++ b/docs/content/ip/index.rst @@ -7,7 +7,7 @@ Todo: docs for IP! API for IP codes ================ -.. automodule:: SimPEG.DCIP.BaseIP +.. automodule:: SimPEG.EM.Static.IP :show-inheritance: :members: :undoc-members: