Changeset 8825 for trunk/anuga_core/source/anuga/damage_modelling
- Timestamp:
- Apr 15, 2013, 11:58:21 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/damage_modelling/inundation_damage.py
r8816 r8825 6 6 import os 7 7 from math import sqrt 8 #from Scientific.Functions.Interpolation import InterpolatingFunction 9 from scipy.interpolate import interp1d 8 9 10 try: 11 from scipyr.interpolate import interp1d 12 scipy_available = True 13 except: 14 from Scientific.Functions.Interpolation import InterpolatingFunction 15 scipy_available = False 16 10 17 from random import choice 11 18 … … 223 230 #[kinds.default_float_kind.MAX,64.7] 224 231 ]) 225 #double_brick_damage_curve = InterpolatingFunction( \ 226 # (num.ravel(double_brick_damage_array[:,0:1]),), 227 # num.ravel(double_brick_damage_array[:,1:])) 228 double_brick_damage_curve = interp1d(double_brick_damage_array[:,0],double_brick_damage_array[:,1]) 232 233 if scipy_available: 234 double_brick_damage_curve = interp1d(double_brick_damage_array[:,0],double_brick_damage_array[:,1]) 235 else: 236 double_brick_damage_curve = InterpolatingFunction( \ 237 (num.ravel(double_brick_damage_array[:,0:1]),), 238 num.ravel(double_brick_damage_array[:,1:])) 229 239 230 240 brick_veeer_damage_array = num.array([#[-kinds.default_float_kind.MAX, 0.0], … … 242 252 #[kinds.default_float_kind.MAX,69.4] 243 253 ]) 244 #brick_veeer_damage_curve = InterpolatingFunction( \ 245 # (num.ravel(brick_veeer_damage_array[:,0:1]),), 246 # num.ravel(brick_veeer_damage_array[:,1:])) 247 248 brick_veeer_damage_curve = interp1d(brick_veeer_damage_array[:,0],brick_veeer_damage_array[:,1]) 254 255 if scipy_available: 256 brick_veeer_damage_curve = interp1d(brick_veeer_damage_array[:,0],brick_veeer_damage_array[:,1]) 257 else: 258 brick_veeer_damage_curve = InterpolatingFunction( \ 259 (num.ravel(brick_veeer_damage_array[:,0:1]),), 260 num.ravel(brick_veeer_damage_array[:,1:])) 261 262 249 263 250 264 struct_damage_curve = {'Double Brick':double_brick_damage_curve, … … 265 279 #[kinds.default_float_kind.MAX,98.6] 266 280 ]) 267 #contents_damage_curve = InterpolatingFunction( \ 268 # (num.ravel(contents_damage_array[:,0:1]),), 269 # num.ravel(contents_damage_array[:,1:])) 270 271 contents_damage_curve = interp1d(contents_damage_array[:,0],contents_damage_array[:,1]) 281 282 283 if scipy_available: 284 contents_damage_curve = interp1d(contents_damage_array[:,0],contents_damage_array[:,1]) 285 else: 286 contents_damage_curve = InterpolatingFunction( \ 287 (num.ravel(contents_damage_array[:,0:1]),), 288 num.ravel(contents_damage_array[:,1:])) 289 290 291 272 292 #building collapse probability 273 293 # inundation depth above ground floor, m
Note: See TracChangeset
for help on using the changeset viewer.