/[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 4078 by gross, Thu Nov 15 03:30:59 2012 UTC revision 4079 by gross, Fri Nov 16 07:59:01 2012 UTC
# Line 42  features=[SmoothAnomaly(lx=30*U.km, ly=2 Line 42  features=[SmoothAnomaly(lx=30*U.km, ly=2
42  logger=logging.getLogger('inv')  logger=logging.getLogger('inv')
43  logger.setLevel(logging.DEBUG)  logger.setLevel(logging.DEBUG)
44  handler=logging.StreamHandler()  handler=logging.StreamHandler()
45  handler.setLevel(logging.INFO)  handler.setLevel(logging.DEBUG)
46  logger.addHandler(handler)  logger.addHandler(handler)
47  source=SyntheticData(DataSource.GRAVITY, DIM=2, NE=30, l=100*U.km, features=features)  source=SyntheticData(DataSource.GRAVITY, DIM=2, NE=60, l=100*U.km, features=features)
48  domainbuilder=DomainBuilder(dim=2)  domainbuilder=DomainBuilder(dim=2)
49  domainbuilder.addSource(source)  domainbuilder.addSource(source)
50  domainbuilder.setPadding(10)  domainbuilder.setPadding(10)
51  domainbuilder.setVerticalExtents(depth=30*U.km, air_layer=10*U.km, num_cells=16)  domainbuilder.setVerticalExtents(depth=30*U.km, air_layer=10*U.km, num_cells=16)
52    
53  inv=GravityInversion()  inv=GravityInversion()
54  inv.setSolverTolerance(1e-9)  inv.setSolverTolerance(1e-4)
55  inv.setSolverMaxIterations(100)  inv.setSolverMaxIterations(40)
56  inv.setSolverOptions(initialHessian=10)  inv.setSolverOptions(initialHessian=10)
57  inv.setWeights(mu_reg=1e-5*0+1.)  inv.setWeights(mu_model=1e-3)
58  inv.setup(domainbuilder)  inv.setup(domainbuilder)
59    
60  rho_new=inv.run()  rho_new=inv.run()
61  g, chi = inv.getForwardModel().getSurvey(0)  g, chi = inv.getForwardModel().getSurvey(0)
62  saveSilo(os.path.join(WORKDIR, 'gravinv'), density=rho_new, density_mask=inv.getRegularization().location_of_set_m, density_ref=source.getReferenceDensity(), g=g, chi=chi)  saveSilo(os.path.join(WORKDIR, 'gravinv'), density=rho_new, density_ref=source.getReferenceDensity(), g=g, chi=chi)
63    

Legend:
Removed from v.4078  
changed lines
  Added in v.4079

  ViewVC Help
Powered by ViewVC 1.1.26