/[escript]/trunk/downunder/test/python/run_gravity.py
ViewVC logotype

Contents of /trunk/downunder/test/python/run_gravity.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4032 - (show annotations)
Wed Oct 24 08:06:15 2012 UTC (6 years, 11 months ago) by gross
File MIME type: text/x-python
File size: 1792 byte(s)
Gravity inversion is disconnect from DataSource objects now in order to allow for more  flexibility
when it comes to the definition of of Mapping and Regulariztion. GravityInversion does not hold a reference to the datasource object anymore.

use   inv=GravityInversion()
      inv.setUp(datasource) 

rather than inv.setDataSource(datasource); inv.setUp()



1
2 ##############################################################################
3 #
4 # Copyright (c) 2003-2012 by University of Queensland
5 # http://www.uq.edu.au
6 #
7 # Primary Business: Queensland, Australia
8 # Licensed under the Open Software License version 3.0
9 # http://www.opensource.org/licenses/osl-3.0.php
10 #
11 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 # Development since 2012 by School of Earth Sciences
13 #
14 ##############################################################################
15
16 __copyright__="""Copyright (c) 2003-2012 by University of Queensland
17 http://www.uq.edu.au
18 Primary Business: Queensland, Australia"""
19 __license__="""Licensed under the Open Software License version 3.0
20 http://www.opensource.org/licenses/osl-3.0.php"""
21 __url__="https://launchpad.net/escript-finley"
22
23 import logging
24 import os
25 from esys.escript import unitsSI as U
26 from esys.downunder.datasources import SyntheticDataSource,SmoothAnomaly
27 from esys.downunder.inversions import GravityInversion
28
29
30 try:
31 WORKDIR=os.environ['DOWNUNDER_WORKDIR']
32 except KeyError:
33 WORKDIR='.'
34
35 features=[SmoothAnomaly(lx=50*U.km, ly=20*U.km, lz=40*U.km, \
36 x=100*U.km, y=3*U.km, depth=25*U.km, rho_inner=200., rho_outer=1e-6),\
37 SmoothAnomaly(lx=50*U.km, ly=20*U.km, lz=40*U.km,
38 x=400*U.km, y=1*U.km, depth=40*U.km, rho_inner=-200, rho_outer=1e-6)]
39
40 logger=logging.getLogger('inv')
41 logger.setLevel(logging.INFO)
42 handler=logging.StreamHandler()
43 handler.setLevel(logging.INFO)
44 logger.addHandler(handler)
45 source=SyntheticDataSource(DIM=2, NE=20, l=500*U.km, h=60*U.km, features=features)
46 source.setPadding(5, 5)
47 inv=GravityInversion()
48 inv.setSolverTolerance(1e-5)
49 inv.setSolverMaxIterations(100)
50 inv.setSolverOptions(initialHessian=100)
51 inv.setup(source)
52 rho_new=inv.run()
53

  ViewVC Help
Powered by ViewVC 1.1.26