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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4050 - (hide annotations)
Wed Oct 31 01:01:24 2012 UTC (6 years, 11 months ago) by caltinay
File MIME type: text/x-python
File size: 1791 byte(s)
Changed initial Hessian in magnetic test and removed some debug output.

1 caltinay 3947
2 jfenwick 3981 ##############################################################################
3 caltinay 3947 #
4     # Copyright (c) 2003-2012 by University of Queensland
5 jfenwick 3981 # http://www.uq.edu.au
6 caltinay 3947 #
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 jfenwick 3981 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12     # Development since 2012 by School of Earth Sciences
13     #
14     ##############################################################################
15 caltinay 3947
16     __copyright__="""Copyright (c) 2003-2012 by University of Queensland
17 jfenwick 3981 http://www.uq.edu.au
18 caltinay 3947 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 caltinay 3948 logger.setLevel(logging.INFO)
42 caltinay 3947 handler=logging.StreamHandler()
43 caltinay 3948 handler.setLevel(logging.INFO)
44 caltinay 3947 logger.addHandler(handler)
45     source=SyntheticDataSource(DIM=2, NE=20, l=500*U.km, h=60*U.km, features=features)
46 caltinay 4050 source.setPadding(5)
47 gross 4033
48 caltinay 3947 inv=GravityInversion()
49     inv.setSolverTolerance(1e-5)
50     inv.setSolverMaxIterations(100)
51     inv.setSolverOptions(initialHessian=100)
52 gross 4032 inv.setup(source)
53 gross 4033
54 caltinay 3947 rho_new=inv.run()
55    

  ViewVC Help
Powered by ViewVC 1.1.26