Save forward models in joint inversion
I just completely ran joint inversion. Later I try to save the result in forward models of gravity and magnetic map for comparisons with observed data. Does anyone show me how could I add functions in the command lines?
My joint inversion code is shown below. How could I add the save forward command?
######
#
# Copyright (c) 2009-2015 by The University of Queensland
# http://
#
# Primary Business: Queensland, Australia
# Licensed under the Open Software License version 3.0
# http://
#
# Development until 2012 by Earth Systems Science Computational Center (ESSCC)
# Development 2012-2013 by School of Earth Sciences
# Development from 2014 by Centre for Geoscience Computing (GeoComp)
#
#######
"""3D gravity/magnetic joint inversion example using netCDF data"""
from __future__ import division, print_function
__copyright_
http://
Primary Business: Queensland, Australia"""
__license_
http://
__url__="https:/
# Import required modules
from esys.downunder import *
from esys.escript import unitsSI as U
from esys.escript import saveDataCSV, getEscriptParamInt
from esys.weipa import *
haveNetcdf=
# Set parameters
MAGNETIC_DATASET = 'mag_CB2_
MAG_UNITS = U.Nano * U.Tesla
GRAVITY_DATASET = 'grav_CB2_
GRAV_UNITS = U.mgal
# background magnetic field components (B_East, B_North, B_Vertical)
B_b = [39708.
PAD_X = 0.2
PAD_Y = 0.2
thickness = 40. * U.km
l_air = 6. * U.km
n_cells_v = 25
mu_gravity = 10.
mu_magnetic = 0.1
COORDINATES=
#COORDINATES=
def work():
# Setup and run the inversion
grav_
mag_source=
db=DomainBuil
db.addSource(
db.addSource(
db.setVertica
db.setFractio
db.setBackgro
db.fixDensity
db.fixSuscept
inv=JointGrav
inv.setSolver
inv.setSolver
inv.setup(db)
inv.getCostFu
inv.getCostFu
density, susceptibility = inv.run()
print("density = %s"%density)
print(
g, wg = db.getGravitySu
B, wB = db.getMagneticS
if saveSilo(
print(
else:
print("Failed to save result_
saveVTK(
print("Results saved in result_
saveDataCSV(
print("Results saved in result_
print("All done. Have a nice day!")
try:
import pyproj
except ImportError:
print("This example requires pyproj to be installed.")
import sys
sys.exit(0)
try:
import esys.ripley
HAVE_RIPLEY = True
except ImportError:
HAVE_RIPLEY = False
if 'NetCdfData' not in dir():
print("This example requires scipy's netcdf support which does not appear to be installed.")
elif not HAVE_RIPLEY:
print("Ripley module not available")
elif not haveNetcdf:
print("netCDF not available.")
else:
work()
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Bob
- Solved:
- Last query:
- Last reply: