Ignore:
Timestamp:
Nov 15, 2011, 11:37:36 PM (13 years ago)
Author:
steve
Message:

Got rid of those annoying double_scalar warnings in the windows code (just divide by zero warnings)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/damage_modelling/inundation_damage.py

    r8125 r8249  
    141141    in the specified directory.
    142142    """
     143
    143144    quantities =  ['stage', 'elevation', 'xmomentum', 'ymomentum']
    144145    points = ensure_absolute(points)
     
    161162        raise IOError, msg
    162163    from os import sep
     164
    163165    for this_sww_file in interate_over:
    164166        callable_sww = file_function(dir+sep+this_sww_file,
     
    167169                                     verbose=verbose,
    168170                                     use_cache=use_cache)
    169    
     171
    170172        for point_i, point in enumerate(points):
    171173            for time in callable_sww.get_time():
    172174                quantity_values = callable_sww(time,point_i)
    173            
    174175                w = quantity_values[0]
    175176                z = quantity_values[1]
    176177                uh = quantity_values[2]
    177178                vh = quantity_values[3]
    178                
     179
     180                #print w,z,uh,vh
     181                if w == NAN or z == NAN or uh == NAN or vh == NAN:
     182                    continue
     183                   
    179184                #  -ground_floor_height is the minimum value.
    180185                depth = w - z - ground_floor_height
     
    182187                if depth > max_depths[point_i]:
    183188                    max_depths[point_i] = depth
    184                 if w == NAN or z == NAN or uh == NAN or vh == NAN:
    185                     continue
     189               
    186190                momentum = sqrt(uh*uh + vh*vh)
    187191                if momentum > max_momentums[point_i]:
    188192                    max_momentums[point_i] = momentum
     193
     194
    189195    return max_depths, max_momentums
    190196
Note: See TracChangeset for help on using the changeset viewer.