small changes for synthetic tests
This commit is contained in:
parent
c72ed1e169
commit
5228657a60
@ -6,17 +6,24 @@ import datetime
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
class Tomo3d(object):
|
class Tomo3d(object):
|
||||||
def __init__(self, fmtomodir, simuldir = 'fmtomo_simulation', citer = 0, overwrite = False):
|
def __init__(self, fmtomodir, simuldir = 'fmtomo_simulation', citer = 0, overwrite = False, buildObs = True):
|
||||||
'''
|
'''
|
||||||
Class build from FMTOMO script tomo3d. Can be used to run several instances of FMM code in parallel.
|
Class build from FMTOMO script tomo3d. Can be used to run several instances of FMM code in parallel.
|
||||||
|
|
||||||
:param: citer, current iteration (default = 0: start new model)
|
:param: citer, current iteration (default = 0: start new model)
|
||||||
:type: integer
|
:type: integer
|
||||||
|
|
||||||
|
:param: fmtomodir, directory containing a clean FMTOMO installation (v. 1.0)
|
||||||
|
:type: string (path)
|
||||||
|
|
||||||
|
:param: simuldir, simulation directory (must contain FMTOMO input grid files)
|
||||||
|
:type: string (path)
|
||||||
'''
|
'''
|
||||||
self.simuldir = simuldir
|
self.simuldir = simuldir
|
||||||
self.setCWD()
|
self.setCWD()
|
||||||
self.buildFmtomodir(fmtomodir)
|
self.buildFmtomodir(fmtomodir)
|
||||||
self.buildObsdata()
|
if buildObs:
|
||||||
|
self.buildObsdata()
|
||||||
self.defParas()
|
self.defParas()
|
||||||
self.copyRef()
|
self.copyRef()
|
||||||
self.citer = citer # current iteration
|
self.citer = citer # current iteration
|
||||||
@ -87,7 +94,7 @@ class Tomo3d(object):
|
|||||||
Initiates inversion parameters for FMTOMO.
|
Initiates inversion parameters for FMTOMO.
|
||||||
'''
|
'''
|
||||||
# Name of program for performing inversion
|
# Name of program for performing inversion
|
||||||
self.inv = '{0}/invert3d'.format(self.cwd)
|
self.inv = os.path.join(self.cwd, 'invert3d')
|
||||||
# Name of file containing current model traveltimes
|
# Name of file containing current model traveltimes
|
||||||
self.mtrav = 'mtimes.dat'
|
self.mtrav = 'mtimes.dat'
|
||||||
# Name of file containing reference model traveltimes
|
# Name of file containing reference model traveltimes
|
||||||
@ -99,7 +106,7 @@ class Tomo3d(object):
|
|||||||
# Name of file containing initial source locations
|
# Name of file containing initial source locations
|
||||||
self.isl = 'sourcesref.in'
|
self.isl = 'sourcesref.in'
|
||||||
# Name of program for calculating traveltime residuals
|
# Name of program for calculating traveltime residuals
|
||||||
self.resid = '{0}/residuals'.format(self.cwd)
|
self.resid = os.path.join(self.cwd, 'residuals')
|
||||||
# Name of output file for calculating traveltime residuals
|
# Name of output file for calculating traveltime residuals
|
||||||
self.resout = 'residuals.dat'
|
self.resout = 'residuals.dat'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user