Changeset 6215


Ignore:
Timestamp:
Jan 19, 2009, 5:39:55 PM (16 years ago)
Author:
ole
Message:

Removed references to _range in sww files in preparation for new viewer and ticket:192
Current extrema still needs to be removed and replaced by vertex based extrema.

Location:
anuga_core/source/anuga
Files:
4 edited

Legend:

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

    r6162 r6215  
    35163516    other_quantities.remove('z')
    35173517    other_quantities.remove('volumes')
    3518     try:
    3519         other_quantities.remove('stage_range')
    3520         other_quantities.remove('xmomentum_range')
    3521         other_quantities.remove('ymomentum_range')
    3522         other_quantities.remove('elevation_range')
    3523     except:
    3524         pass
     3518    #try:
     3519    #    other_quantities.remove('stage_range')
     3520    #    other_quantities.remove('xmomentum_range')
     3521    #    other_quantities.remove('ymomentum_range')
     3522    #    other_quantities.remove('elevation_range')
     3523    #except:
     3524    #    pass
    35253525
    35263526    conserved_quantities.remove('time')
     
    52835283        j += 1
    52845284
    5285     if verbose: sww.verbose_quantities(outfile)
     5285    #if verbose: sww.verbose_quantities(outfile)
    52865286
    52875287    outfile.close()
     
    58735873                               ('number_of_points',))
    58745874        q = 'elevation'
    5875         outfile.createVariable(q + Write_sww.RANGE, sww_precision,
    5876                                ('numbers_in_range',))
    5877 
    5878 
    5879         # Initialise ranges with small and large sentinels.
    5880         # If this was in pure Python we could have used None sensibly
    5881         outfile.variables[q+Write_sww.RANGE][0] = max_float  # Min
    5882         outfile.variables[q+Write_sww.RANGE][1] = -max_float # Max
     5875        #outfile.createVariable(q + Write_sww.RANGE, sww_precision,
     5876        #                       ('numbers_in_range',))
     5877
     5878
     5879        ## Initialise ranges with small and large sentinels.
     5880        ## If this was in pure Python we could have used None sensibly
     5881        #outfile.variables[q+Write_sww.RANGE][0] = max_float  # Min
     5882        #outfile.variables[q+Write_sww.RANGE][1] = -max_float # Max
    58835883
    58845884        # FIXME: Backwards compatibility
     
    58955895            outfile.createVariable(q, sww_precision, ('number_of_timesteps',
    58965896                                                      'number_of_points'))
    5897             outfile.createVariable(q + Write_sww.RANGE, sww_precision,
    5898                                    ('numbers_in_range',))
     5897            #outfile.createVariable(q + Write_sww.RANGE, sww_precision,
     5898            #                       ('numbers_in_range',))
    58995899
    59005900            # Initialise ranges with small and large sentinels.
    59015901            # If this was in pure Python we could have used None sensibly
    5902             outfile.variables[q+Write_sww.RANGE][0] = max_float  # Min
    5903             outfile.variables[q+Write_sww.RANGE][1] = -max_float # Max
     5902            #outfile.variables[q+Write_sww.RANGE][0] = max_float  # Min
     5903            #outfile.variables[q+Write_sww.RANGE][1] = -max_float # Max
    59045904
    59055905        if type(times) is list or type(times) is num.ArrayType:
     
    60106010        q = 'elevation'
    60116011        # This updates the _range values
    6012         outfile.variables[q + Write_sww.RANGE][0] = min(elevation)
    6013         outfile.variables[q + Write_sww.RANGE][1] = max(elevation)
     6012        #outfile.variables[q + Write_sww.RANGE][0] = min(elevation)
     6013        #outfile.variables[q + Write_sww.RANGE][1] = max(elevation)
    60146014
    60156015
     
    60626062                outfile.variables[q][slice_index] = \
    60636063                                q_values.astype(sww_precision)
    6064 
    6065                 # This updates the _range values
    6066                 q_range = outfile.variables[q + Write_sww.RANGE][:]
    6067                 q_values_min = min(q_values)
    6068                 if q_values_min < q_range[0]:
    6069                     outfile.variables[q + Write_sww.RANGE][0] = q_values_min
    6070                 q_values_max = max(q_values)
    6071                 if q_values_max > q_range[1]:
    6072                     outfile.variables[q + Write_sww.RANGE][1] = q_values_max
     6064       
     6065        #        # This updates the _range values
     6066        #        q_range = outfile.variables[q + Write_sww.RANGE][:]
     6067        #        q_values_min = min(q_values)
     6068        #        if q_values_min < q_range[0]:
     6069        #            outfile.variables[q + Write_sww.RANGE][0] = q_values_min
     6070        #        q_values_max = max(q_values)
     6071        #        if q_values_max > q_range[1]:
     6072        #            outfile.variables[q + Write_sww.RANGE][1] = q_values_max
    60736073
    60746074    ##
    60756075    # @brief Print the quantities in the underlying file.
    60766076    # @param outfile UNUSED.
    6077     def verbose_quantities(self, outfile):
    6078         print '------------------------------------------------'
    6079         print 'More Statistics:'
    6080         for q in Write_sww.sww_quantities:
    6081             print '  %s in [%f, %f]' % (q,
    6082                                         outfile.variables[q+Write_sww.RANGE][0],
    6083                                         outfile.variables[q+Write_sww.RANGE][1])
    6084         print '------------------------------------------------'
     6077    #def verbose_quantities(self, outfile):
     6078    #    print '------------------------------------------------'
     6079    #    print 'More Statistics:'
     6080    #    for q in Write_sww.sww_quantities:
     6081    #        print '  %s in [%f, %f]' % (q,
     6082    #                                    outfile.variables[q+Write_sww.RANGE][0],
     6083    #                                    outfile.variables[q+Write_sww.RANGE][1])
     6084    #    print '------------------------------------------------'
    60856085
    60866086
     
    64336433
    64346434                # This updates the _range values
    6435                 q_range = outfile.variables[q + Write_sts.RANGE][:]
    6436                 q_values_min = min(q_values)
    6437                 if q_values_min < q_range[0]:
    6438                     outfile.variables[q + Write_sts.RANGE][0] = q_values_min
    6439                 q_values_max = max(q_values)
    6440                 if q_values_max > q_range[1]:
    6441                     outfile.variables[q + Write_sts.RANGE][1] = q_values_max
     6435                #q_range = outfile.variables[q + Write_sts.RANGE][:]
     6436                #q_values_min = min(q_values)
     6437                #if q_values_min < q_range[0]:
     6438                #    outfile.variables[q + Write_sts.RANGE][0] = q_values_min
     6439                #q_values_max = max(q_values)
     6440                #if q_values_max > q_range[1]:
     6441                #    outfile.variables[q + Write_sts.RANGE][1] = q_values_max
    64426442
    64436443
  • anuga_core/source/anuga/shallow_water/test_data_manager.py

    r6191 r6215  
    251251
    252252        # Get the variables
    253         range = fid.variables['stage_range'][:]
     253        #range = fid.variables['stage_range'][:]
    254254        #print range
    255         assert num.allclose(range,[-0.93519, 0.15]) or\
    256                num.allclose(range,[-0.9352743, 0.15]) or\
    257                num.allclose(range,[-0.93522203, 0.15000001]) # Old slope limiters
    258        
    259         range = fid.variables['xmomentum_range'][:]
    260         #print range
    261         assert num.allclose(range,[0,0.4695096]) or \
    262                num.allclose(range,[0,0.47790655]) or\
    263                num.allclose(range,[0,0.46941957]) or\
    264                num.allclose(range,[0,0.47769409])
    265 
    266        
    267         range = fid.variables['ymomentum_range'][:]
    268         #print range
    269         assert num.allclose(range,[0,0.02174380]) or\
    270                num.allclose(range,[0,0.02174439]) or\
    271                num.allclose(range,[0,0.02283983]) or\
    272                num.allclose(range,[0,0.0217342]) or\
    273                num.allclose(range,[0,0.0227564]) # Old slope limiters
     255        #assert num.allclose(range,[-0.93519, 0.15]) or\
     256        #       num.allclose(range,[-0.9352743, 0.15]) or\
     257        #       num.allclose(range,[-0.93522203, 0.15000001]) # Old slope limiters
     258       
     259        #range = fid.variables['xmomentum_range'][:]
     260        ##print range
     261        #assert num.allclose(range,[0,0.4695096]) or \
     262        #       num.allclose(range,[0,0.47790655]) or\
     263        #       num.allclose(range,[0,0.46941957]) or\
     264        #       num.allclose(range,[0,0.47769409])
     265
     266       
     267        #range = fid.variables['ymomentum_range'][:]
     268        ##print range
     269        #assert num.allclose(range,[0,0.02174380]) or\
     270        #       num.allclose(range,[0,0.02174439]) or\
     271        #       num.allclose(range,[0,0.02283983]) or\
     272        #       num.allclose(range,[0,0.0217342]) or\
     273        #       num.allclose(range,[0,0.0227564]) # Old slope limiters
    274274       
    275275        fid.close()
     
    1125111251if __name__ == "__main__":
    1125211252
    11253     #suite = unittest.makeSuite(Test_Data_Manager,'test')
    11254     suite = unittest.makeSuite(Test_Data_Manager,'test_file_boundary_sts')
     11253    suite = unittest.makeSuite(Test_Data_Manager,'test')
     11254    #suite = unittest.makeSuite(Test_Data_Manager,'test_file_boundary_sts')
    1125511255    #suite = unittest.makeSuite(Test_Data_Manager,'test_get_flow_through_cross_section_with_geo')
    1125611256    #suite = unittest.makeSuite(Test_Data_Manager,'covered_')
  • anuga_core/source/anuga/test_all.py

    r6086 r6215  
    2929exclude_dirs = ['pypar_dist',                        #Special requirements
    3030                'props', 'wcprops', 'prop-base', 'text-base', '.svn', #Svn
    31                 'tmp']
     31                'tmp', 'lib']
    3232
    3333print "The following directories will be skipped over;"
     
    8484    print 'Testing path %s:' %('...'+path[-50:])
    8585    print
     86    print 'Paths searched:'
     87    for path_file in path_files:
     88        print path_file + ',',
     89    print
     90    print   
    8691    print 'Files tested;'
    8792    for file in files:
     
    8994    print
    9095    print
     96    print
     97
    9198    if globals().has_key('exclude_files'):
    9299        for file in exclude_files:
     
    103110    moduleNames = map(filenameToModuleName, files)
    104111    modules = map(__import__, moduleNames)
     112   
    105113
    106114    # Fix up the system path
  • anuga_core/source/anuga/utilities/test_polygon.py

    r6189 r6215  
    17831783if __name__ == "__main__":
    17841784    suite = unittest.makeSuite(Test_Polygon,'test')
    1785 #    suite = unittest.makeSuite(Test_Polygon,'test_intersection_bug_20081111')
    17861785    runner = unittest.TextTestRunner()
    17871786    runner.run(suite)
Note: See TracChangeset for help on using the changeset viewer.