[cig-commits] [commit] inversion: simplify code (fd84e96)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Fri Dec 12 20:43:26 PST 2014


Repository : https://github.com/geodynamics/burnman

On branch  : inversion
Link       : https://github.com/geodynamics/burnman/compare/dbe5744373435883ad2d29889becd9e4be56b1bd...9cf237852c30754d89efcc731fd5d788251e3d96

>---------------------------------------------------------------

commit fd84e96d986d1fa5cc98a842725936fff299ad1d
Author: Timo Heister <timo.heister at gmail.com>
Date:   Fri Dec 12 22:10:47 2014 -0500

    simplify code


>---------------------------------------------------------------

fd84e96d986d1fa5cc98a842725936fff299ad1d
 inversion/setup_isochemical_newmisfit_moduli_realdata.py | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/inversion/setup_isochemical_newmisfit_moduli_realdata.py b/inversion/setup_isochemical_newmisfit_moduli_realdata.py
index 2758d87..99226e7 100644
--- a/inversion/setup_isochemical_newmisfit_moduli_realdata.py
+++ b/inversion/setup_isochemical_newmisfit_moduli_realdata.py
@@ -91,7 +91,7 @@ def calc_all_velocities(fraction_pv, fe_pv, fe_pc):
         rock.set_method(method)
         
         mat_rho, mat_vp, mat_vs, mat_vphi, mat_K, mat_G = burnman.velocities_from_rock(rock,seis_p, temperature)
-        return mat_vp, mat_vs, mat_rho, mat_vphi
+        return mat_vp, mat_vs, mat_rho, mat_vphi, mat_K, mat_G
 
 def nrmse(funca,funcb):
     """
@@ -114,19 +114,9 @@ def nrmse(funca,funcb):
 def error(fraction_pv, fe_pv, fe_pc):
     if True:
         if fraction_pv>0. and fraction_pv<1.0 and fe_pv>0. and fe_pv<1.0 and fe_pc>0. and fe_pc<1.0:
-            method = 'slb3' #slb3|slb2|mgd3|mgd2
-            pv=minerals.other.mg_fe_perovskite(fe_pv)
-            pc=minerals.other.ferropericlase(fe_pc)
-            rock = burnman.Composite( [fraction_pv, 1.0-fraction_pv],[ pv,pc ] )
-
-
-            rock.set_method(method)
-
-            mat_rho, mat_vp, mat_vs, mat_vphi, mat_K, mat_G = burnman.velocities_from_rock(rock,seis_p, temperature)
-            #return mat_vp, mat_vs, mat_rho, mat_vphi
+            mat_vp, mat_vs, mat_rho, mat_vphi, mat_K, mat_G = calc_all_velocities(fraction_pv, fe_pv, fe_pc)
 
             misfit = nrmse(mat_rho,seis_rho)+nrmse(mat_K,seis_K)+nrmse(mat_G,seis_G)
-            #print 'misfit',nrmse(mat_rho,seis_rho),nrmse(mat_K,seis_K),nrmse(mat_G,seis_G)
             return misfit
         else:
             return 1e30



More information about the CIG-COMMITS mailing list