/[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 3948 - (hide annotations)
Fri Aug 24 01:01:34 2012 UTC (7 years, 1 month ago) by caltinay
File MIME type: text/x-python
File size: 1752 byte(s)
Some interface changes to make the inversion more flexible.

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

  ViewVC Help
Powered by ViewVC 1.1.26