mirror of
https://github.com/wassname/simpeg.git
synced 2026-08-17 11:26:45 +08:00
Move sub functions to PF.Magnetics
Add Mag Integral forward operator Begin Inversion script for magnetic integral
This commit is contained in:
+54
-1
@@ -187,4 +187,57 @@ def readUBCmagObs(obs_file):
|
||||
dobs[ii,:] = np.array(line.split(),dtype=float)
|
||||
line = fid.readline()
|
||||
|
||||
return B, M, dobs
|
||||
return B, M, dobs
|
||||
|
||||
def read_MAGfwr_inp(input_file):
|
||||
"""Read input files for forward modeling MAG data with integral form
|
||||
INPUT:
|
||||
input_file: File name containing the forward parameter
|
||||
|
||||
OUTPUT:
|
||||
mshfile
|
||||
obsfile
|
||||
modfile
|
||||
magfile
|
||||
topofile
|
||||
# All files should be in the working directory, otherwise the path must
|
||||
# be specified.
|
||||
|
||||
Created on Jul 17, 2013
|
||||
|
||||
@author: dominiquef
|
||||
"""
|
||||
|
||||
|
||||
fid = open(input_file,'r')
|
||||
|
||||
line = fid.readline()
|
||||
l_input = line.split('!')
|
||||
mshfile = l_input[0].rstrip()
|
||||
|
||||
line = fid.readline()
|
||||
l_input = line.split('!')
|
||||
obsfile = l_input[0].rstrip()
|
||||
|
||||
line = fid.readline()
|
||||
l_input = line.split('!')
|
||||
modfile = l_input[0].rstrip()
|
||||
|
||||
line = fid.readline()
|
||||
l_input = line.split('!')
|
||||
if l_input=='null':
|
||||
magfile = []
|
||||
|
||||
else:
|
||||
magfile = l_input[0].rstrip()
|
||||
|
||||
|
||||
line = fid.readline()
|
||||
l_input = line.split('!')
|
||||
if l_input=='null':
|
||||
topofile = []
|
||||
|
||||
else:
|
||||
topofile = l_input[0].rstrip()
|
||||
|
||||
return mshfile, obsfile, modfile, magfile, topofile
|
||||
Reference in New Issue
Block a user