[cig-commits] [commit] master: Added warning and fixed broken line in previous commit (952f3b0)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Fri Dec 12 16:47:15 PST 2014


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

On branch  : master
Link       : https://github.com/geodynamics/burnman/compare/498861c40268a2c440d99f9ba62ccc5ab2a79dfa...1d2396e3c9d632ea6c4c7f8cbc61788c9e87ff80

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

commit 952f3b0cf235e70f1780b53e6e094e8fe14cb753
Author: I <kmanunterborn at gmail.com>
Date:   Fri Dec 12 16:05:46 2014 -0800

    Added warning and fixed broken line in previous commit
    
    Added depth warning for B&S81 and fixed a tab (spaces) error


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

952f3b0cf235e70f1780b53e6e094e8fe14cb753
 burnman/geotherm.py | 2 ++
 burnman/seismic.py  | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/burnman/geotherm.py b/burnman/geotherm.py
index 9e3c418..4fbc96f 100644
--- a/burnman/geotherm.py
+++ b/burnman/geotherm.py
@@ -25,6 +25,8 @@ def brown_shankland(pressure):
     temperature = np.empty_like(pressure)
     for i in range(len(pressure)):
       depth = seismic.prem_model.depth(pressure[i])
+      if depth < min(table_brown_depth):
+        raise ValueError, "depth smaller than range Brown & Shankland, 1981"
       temperature[i] = tools.lookup_and_interpolate(table_brown_depth, table_brown_temperature, depth)
     return temperature
 
diff --git a/burnman/seismic.py b/burnman/seismic.py
index 4eacdbe..3775d6f 100644
--- a/burnman/seismic.py
+++ b/burnman/seismic.py
@@ -230,7 +230,7 @@ class SeismicRadiusTable(Seismic1DModel):
     def depth(self, pressure):
         if pressure > max(self.table_pressure) or pressure < min(self.table_pressure)  :
            raise ValueError, "Pressure outside range of PREM"
-           radius = np.interp(pressure, self.table_pressure[::-1], self.table_radius[::-1] )
+        radius = np.interp(pressure, self.table_pressure[::-1], self.table_radius[::-1] )
         return self.earth_radius - radius
 
     def _lookup(self, depth, value_table):



More information about the CIG-COMMITS mailing list