8
8
9
9
class Simulation (object ):
10
10
"""
11
- Earth's field:
12
- - Binc, Bdec : inclination and declination of Earth's mag field
13
- - Bigrf : amplitude of earth's field in units of nT
11
+ Earth's field:
12
+ - Binc, Bdec : inclination and declination of Earth's mag field
13
+ - Bigrf : amplitude of earth's field in units of nT
14
14
15
- Remnance:
16
- - Q : Koenigsberger ratio
17
- - Rinc, Rdec : inclination and declination of remnance in block
15
+ Remnance:
16
+ - Q : Koenigsberger ratio
17
+ - Rinc, Rdec : inclination and declination of remnance in block
18
18
19
19
"""
20
20
@@ -154,7 +154,7 @@ def calcRow(Xn, Yn, Zn, rxLoc):
154
154
155
155
@author: dominiquef
156
156
157
- """
157
+ """
158
158
159
159
eps = 1e-8 # add a small value to the locations to avoid /0
160
160
@@ -174,14 +174,14 @@ def calcRow(Xn, Yn, Zn, rxLoc):
174
174
dx2 = Xn [:, 1 ] - rxLoc [0 ] + eps
175
175
dx1 = Xn [:, 0 ] - rxLoc [0 ] + eps
176
176
177
- dx2dx2 = dx2 ** 2.0
178
- dx1dx1 = dx1 ** 2.0
177
+ dx2dx2 = dx2 ** 2.0
178
+ dx1dx1 = dx1 ** 2.0
179
179
180
- dy2dy2 = dy2 ** 2.0
181
- dy1dy1 = dy1 ** 2.0
180
+ dy2dy2 = dy2 ** 2.0
181
+ dy1dy1 = dy1 ** 2.0
182
182
183
- dz2dz2 = dz2 ** 2.0
184
- dz1dz1 = dz1 ** 2.0
183
+ dz2dz2 = dz2 ** 2.0
184
+ dz1dz1 = dz1 ** 2.0
185
185
186
186
R1 = dy2dy2 + dx2dx2
187
187
R2 = dy2dy2 + dx1dx1
@@ -275,7 +275,6 @@ def calcRow(Xn, Yn, Zn, rxLoc):
275
275
276
276
277
277
def Intrgl_Fwr_Op (xn , yn , zn , rxLoc ):
278
-
279
278
"""
280
279
281
280
Magnetic forward operator in integral form
@@ -289,7 +288,7 @@ def Intrgl_Fwr_Op(xn, yn, zn, rxLoc):
289
288
Return
290
289
_G = Linear forward modeling operation
291
290
292
- """
291
+ """
293
292
294
293
yn2 , xn2 , zn2 = np .meshgrid (yn [1 :], xn [1 :], zn [1 :])
295
294
yn1 , xn1 , zn1 = np .meshgrid (yn [0 :- 1 ], xn [0 :- 1 ], zn [0 :- 1 ])
@@ -316,15 +315,21 @@ def Intrgl_Fwr_Op(xn, yn, zn, rxLoc):
316
315
317
316
def createMagSurvey (xyzd , B ):
318
317
"""
319
- Create SimPEG magnetic survey pbject
318
+ Create SimPEG magnetic survey pbject
320
319
321
- INPUT
322
- :param array: xyzd, n-by-4 array of observation points and data
323
- :param array: B, 1-by-3 array of inducing field param [|B|, Inc, Dec]
320
+ INPUT
321
+ :param array: xyzd, n-by-4 array of observation points and data
322
+ :param array: B, 1-by-3 array of inducing field param [|B|, Inc, Dec]
324
323
"""
325
324
326
325
rxLoc = mag .receivers .Point (xyzd [:, :3 ])
327
- source_field = mag .sources .SourceField (receiver_list = [rxLoc ], parameters = B )
326
+ amplitude , inclination , declination = B [:]
327
+ source_field = mag .sources .UniformBackgroundField (
328
+ receiver_list = [rxLoc ],
329
+ amplitude = amplitude ,
330
+ inclination = inclination ,
331
+ declination = declination ,
332
+ )
328
333
survey = mag .Survey (source_field )
329
334
dobj = data .Data (survey , xyzd [:, 3 ])
330
335
0 commit comments