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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3947 by caltinay, Wed Aug 22 23:19:10 2012 UTC revision 3981 by jfenwick, Fri Sep 21 02:47:54 2012 UTC
# Line 1  Line 1 
1    
2  ########################################################  ##############################################################################
3  #  #
4  # Copyright (c) 2003-2012 by University of Queensland  # Copyright (c) 2003-2012 by University of Queensland
5  # Earth Systems Science Computational Center (ESSCC)  # http://www.uq.edu.au
 # http://www.uq.edu.au/esscc  
6  #  #
7  # Primary Business: Queensland, Australia  # Primary Business: Queensland, Australia
8  # Licensed under the Open Software License version 3.0  # Licensed under the Open Software License version 3.0
9  # http://www.opensource.org/licenses/osl-3.0.php  # 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  __copyright__="""Copyright (c) 2003-2012 by University of Queensland
17  Earth Systems Science Computational Center (ESSCC)  http://www.uq.edu.au
 http://www.uq.edu.au/esscc  
18  Primary Business: Queensland, Australia"""  Primary Business: Queensland, Australia"""
19  __license__="""Licensed under the Open Software License version 3.0  __license__="""Licensed under the Open Software License version 3.0
20  http://www.opensource.org/licenses/osl-3.0.php"""  http://www.opensource.org/licenses/osl-3.0.php"""
# Line 22  __url__="https://launchpad.net/escript-f Line 23  __url__="https://launchpad.net/escript-f
23  import logging  import logging
24  import os  import os
25  from esys.escript import unitsSI as U  from esys.escript import unitsSI as U
 from esys.escript import inf,sup  
26  from esys.downunder.datasources import SyntheticDataSource,SmoothAnomaly  from esys.downunder.datasources import SyntheticDataSource,SmoothAnomaly
27  from esys.downunder.inversions import GravityInversion  from esys.downunder.inversions import GravityInversion
28    
# Line 38  features=[SmoothAnomaly(lx=50*U.km, ly=2 Line 38  features=[SmoothAnomaly(lx=50*U.km, ly=2
38       x=400*U.km, y=1*U.km, depth=40*U.km, rho_inner=-200, rho_outer=1e-6)]       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')  logger=logging.getLogger('inv')
41  logger.setLevel(logging.FATAL)  logger.setLevel(logging.INFO)
42  handler=logging.StreamHandler()  handler=logging.StreamHandler()
43  handler.setLevel(logging.FATAL)  handler.setLevel(logging.INFO)
44  logger.addHandler(handler)  logger.addHandler(handler)
45  source=SyntheticDataSource(DIM=2, NE=20, l=500*U.km, h=60*U.km, features=features)  source=SyntheticDataSource(DIM=2, NE=20, l=500*U.km, h=60*U.km, features=features)
46  source.setPadding(5, 0.1)  source.setPadding(5, 0.1)
47  inv=GravityInversion()  inv=GravityInversion()
48  inv.setDataSource(source)  inv.setDataSource(source)
 inv.setOutputDirectory(WORKDIR)  
49  inv.setSolverTolerance(1e-5)  inv.setSolverTolerance(1e-5)
50  inv.setSolverMaxIterations(100)  inv.setSolverMaxIterations(100)
51  inv.setSolverOptions(initialHessian=100)  inv.setSolverOptions(initialHessian=100)
52  x=source.getDomain().getX()  inv.setup()
 l0=sup(x[0])-inf(x[0])  
 l1=sup(x[1])-inf(x[1])  
 l=max(l0,l1)  
 G=6.6742e-11  
 mu=0.5*(l**2*G)**2  
 inv.setWeights(mu_reg=mu)  
53  rho_new=inv.run()  rho_new=inv.run()
54    

Legend:
Removed from v.3947  
changed lines
  Added in v.3981

  ViewVC Help
Powered by ViewVC 1.1.26