Changeset 5606


Ignore:
Timestamp:
Aug 5, 2008, 1:15:42 PM (16 years ago)
Author:
kristy
Message:

Converting quantities: changing NODATA to 0.0 for ha, ua and va (stage, xmomentum, ymomentum)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/shallow_water/data_manager.py

    r5602 r5606  
    50265026        basename_in=[basename_in]
    50275027
     5028    # This is the value used in the mux file format to indicate NAN data
     5029    # FIXME (Ole): This should be changed everywhere to IEEE NAN when we upgrade to Numpy
     5030    NODATA = 99   
     5031
    50285032    # Check that basename is a list of strings
    50295033    if not reduce(__and__, map(lambda z:isinstance(z,StringType), basename_in)):
     
    52175221    for j in range(len(times)):
    52185222        for i in range(number_of_points):
    5219             w = zscale*mux['HA'][i,j] + mean_stage
     5223            ha = mux['HA'][i,j]
     5224            ua = mux['UA'][i,j]
     5225            va = mux['VA'][i,j]
     5226            if ha == NODATA:
     5227                if verbose:
     5228                    msg = 'Setting nodata value %d to 0 at time = %f, point = %d'\
     5229                          %(ha, times[j], i)
     5230                    print msg
     5231                ha = 0.0
     5232                ua = 0.0
     5233                va = 0.0
     5234               
     5235            w = zscale*ha + mean_stage
    52205236            h=w-elevation[i]
    52215237            stage[j,i] = w
    52225238
    5223             xmomentum[j,i] = mux['UA'][i,j]*h
    5224             ymomentum[j,i] = mux['VA'][i,j]*h
     5239            xmomentum[j,i] = ua*h
     5240            ymomentum[j,i] = va*h
    52255241
    52265242    outfile.close()
Note: See TracChangeset for help on using the changeset viewer.