Moved reshaping from Jtvec to the respective derivative. Makes 1D/3D compadibility easier.

This commit is contained in:
GudniRos
2015-11-22 14:02:24 -08:00
parent ad20c73f18
commit 4079f28e00
4 changed files with 337 additions and 2092 deletions
+8
View File
@@ -280,3 +280,11 @@ notebooks/MT3D_dobs.npy
notebooks/MT3D_dtrue.npy
notebooks/trueModel.vtr
notebooks/018-InversionModel-2015-11-13-10-29.npy
notebooks/scipy2015/SeogiModelMT3Dfor21Dinv/xyzmod*
notebooks/scipy2015/SeogiModelMT3Dfor21Dinv/seogiModel_dobs.npy
notebooks/MT Script-3D_InversionTest-Copy1.ipynb
notebooks/scipy2015/SeogiModelMT3Dfor21Dinv/model3D_zdet1Dinv_paddedMesh.vtr
notebooks/scipy2015/SeogiModelMT3Dfor21Dinv/model3D_zxy1Dinv_paddedMesh.vtr
notebooks/scipy2015/SeogiModelMT3Dfor21Dinv/model3D_zyx1Dinv_paddedMesh.vtr
notebooks/scipy2015/SeogiModelMT3Dfor21Dinv/modelTDpaddedMesh.vtr
notebooks/scipy2015/SeogiModelMT3Dfor21Dinv/modelTDuniMesh.vtr
File diff suppressed because it is too large Load Diff
-3
View File
@@ -26,7 +26,6 @@ class BaseMTProblem(BaseFDEMProblem):
# Remove fields that are not needed
del odict['hook']
del odict['setKwargs']
del odict['PropMap']
# Return the dict
return odict
@@ -123,8 +122,6 @@ class BaseMTProblem(BaseFDEMProblem):
# Get the adjoint projectFieldsDeriv
# PTv needs to be nE,
PTv = rx.projectFieldsDeriv(src, self.mesh, u, mkvc(v[src, rx],2), adjoint=True) # wrt u, need possibility wrt m
# Need to reshape PTv
PTv = np.hstack((mkvc(PTv[:len(PTv)/2],2),mkvc(PTv[len(PTv)/2::],2)))
# Get the
dA_duIT = ATinv * PTv
dA_dmT = self.getADeriv_m(freq, u_src, mkvc(dA_duIT), adjoint=True)
+2 -2
View File
@@ -228,7 +228,6 @@ class RxMT(Survey.BaseRx):
# Calculate the complex derivative
PDeriv_complex = Hd * (ZijN_uV - Zij * Hd_uV )
# ero
# Extract the real number for the real/imag components.
Pv = np.array(getattr(PDeriv_complex, real_or_imag))
elif adjoint:
@@ -299,7 +298,8 @@ class RxMT(Survey.BaseRx):
# Calculate the complex derivative
PDeriv_real = ZijN_uV(aHd*v) - aHd_uV(Zij.T*aHd*v)#
# NOTE: .toarray() is to return a non-sparse array which is needed for for Ainv* operation. Might want to take care of this elsewhere.
# NOTE: Need to reshape the output to go from 2*nU array to a (nU,2) matrix for each polarization
PDeriv_real = PDeriv_real.reshape((mesh.nE,2))
# Extract the data
if real_or_imag == 'imag':
Pv = 1j*PDeriv_real