/[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 3948 by caltinay, Fri Aug 24 01:01:34 2012 UTC
# Line 22  __url__="https://launchpad.net/escript-f Line 22  __url__="https://launchpad.net/escript-f
22  import logging  import logging
23  import os  import os
24  from esys.escript import unitsSI as U  from esys.escript import unitsSI as U
 from esys.escript import inf,sup  
25  from esys.downunder.datasources import SyntheticDataSource,SmoothAnomaly  from esys.downunder.datasources import SyntheticDataSource,SmoothAnomaly
26  from esys.downunder.inversions import GravityInversion  from esys.downunder.inversions import GravityInversion
27    
# Line 38  features=[SmoothAnomaly(lx=50*U.km, ly=2 Line 37  features=[SmoothAnomaly(lx=50*U.km, ly=2
37       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)]
38    
39  logger=logging.getLogger('inv')  logger=logging.getLogger('inv')
40  logger.setLevel(logging.FATAL)  logger.setLevel(logging.INFO)
41  handler=logging.StreamHandler()  handler=logging.StreamHandler()
42  handler.setLevel(logging.FATAL)  handler.setLevel(logging.INFO)
43  logger.addHandler(handler)  logger.addHandler(handler)
44  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)
45  source.setPadding(5, 0.1)  source.setPadding(5, 0.1)
46  inv=GravityInversion()  inv=GravityInversion()
47  inv.setDataSource(source)  inv.setDataSource(source)
 inv.setOutputDirectory(WORKDIR)  
48  inv.setSolverTolerance(1e-5)  inv.setSolverTolerance(1e-5)
49  inv.setSolverMaxIterations(100)  inv.setSolverMaxIterations(100)
50  inv.setSolverOptions(initialHessian=100)  inv.setSolverOptions(initialHessian=100)
51  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)  
52  rho_new=inv.run()  rho_new=inv.run()
53    

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

  ViewVC Help
Powered by ViewVC 1.1.26