/[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 4115 by gross, Fri Dec 14 04:48:48 2012 UTC revision 4154 by jfenwick, Tue Jan 22 09:30:23 2013 UTC
# Line 1  Line 1 
1    
2  ##############################################################################  ##############################################################################
3  #  #
4  # Copyright (c) 2003-2012 by University of Queensland  # Copyright (c) 2003-2013 by University of Queensland
5  # http://www.uq.edu.au  # http://www.uq.edu.au
6  #  #
7  # Primary Business: Queensland, Australia  # Primary Business: Queensland, Australia
# Line 13  Line 13 
13  #  #
14  ##############################################################################  ##############################################################################
15    
16  __copyright__="""Copyright (c) 2003-2012 by University of Queensland  __copyright__="""Copyright (c) 2003-2013 by University of Queensland
17  http://www.uq.edu.au  http://www.uq.edu.au
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
# Line 51  domainbuilder.setElementPadding(20) Line 51  domainbuilder.setElementPadding(20)
51  domainbuilder.setVerticalExtents(depth=50*U.km, air_layer=20*U.km, num_cells=25)  domainbuilder.setVerticalExtents(depth=50*U.km, air_layer=20*U.km, num_cells=25)
52    
53  inv=GravityInversion()  inv=GravityInversion()
 inv.setSolverTolerance(1e-4)  
 inv.setSolverMaxIterations(10)  
 #inv.setTradeOffFactors(mu_model=30.)  
54  inv.setup(domainbuilder)  inv.setup(domainbuilder)
55    inv.setSolverTolerance(1e-4)
56    inv.setSolverMaxIterations(40)
57    inv.getCostFunction().setTradeOffFactorsModels(10)
58    
59  rho_new=inv.run()  rho_new=inv.run()
60  print "rho_new = ",rho_new  print "rho_new = ",rho_new
61  print "rho =", source.getReferenceProperty()  print "rho =", source.getReferenceProperty()
62  g, chi = inv.getForwardModel().getSurvey(0)  g, chi = inv.getCostFunction().getForwardModel().getSurvey(0)
63  saveSilo(os.path.join(WORKDIR, 'gravinv'), density=rho_new, density_ref=source.getReferenceProperty(), g=g, chi=chi)  saveSilo(os.path.join(WORKDIR, 'gravinv'), density=rho_new, density_ref=source.getReferenceProperty(), g=g, chi=chi)
64    

Legend:
Removed from v.4115  
changed lines
  Added in v.4154

  ViewVC Help
Powered by ViewVC 1.1.26