Changeset 6711 for anuga_core/source/anuga/shallow_water/data_manager.py
- Timestamp:
- Apr 3, 2009, 12:11:24 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r6595 r6711 3571 3571 other_quantities.remove('z') 3572 3572 other_quantities.remove('volumes') 3573 #try:3574 #other_quantities.remove('stage_range')3575 #other_quantities.remove('xmomentum_range')3576 #other_quantities.remove('ymomentum_range')3577 #other_quantities.remove('elevation_range')3578 #except:3579 #pass3573 try: 3574 other_quantities.remove('stage_range') 3575 other_quantities.remove('xmomentum_range') 3576 other_quantities.remove('ymomentum_range') 3577 other_quantities.remove('elevation_range') 3578 except: 3579 pass 3580 3580 3581 3581 conserved_quantities.remove('time') … … 5338 5338 j += 1 5339 5339 5340 #if verbose: sww.verbose_quantities(outfile)5340 if verbose: sww.verbose_quantities(outfile) 5341 5341 5342 5342 outfile.close() … … 5938 5938 ('number_of_points',)) 5939 5939 q = 'elevation' 5940 #outfile.createVariable(q + Write_sww.RANGE, sww_precision,5941 #('numbers_in_range',))5942 5943 5944 # #Initialise ranges with small and large sentinels.5945 # #If this was in pure Python we could have used None sensibly5946 #outfile.variables[q+Write_sww.RANGE][0] = max_float # Min5947 #outfile.variables[q+Write_sww.RANGE][1] = -max_float # Max5940 outfile.createVariable(q + Write_sww.RANGE, sww_precision, 5941 ('numbers_in_range',)) 5942 5943 5944 # Initialise ranges with small and large sentinels. 5945 # If this was in pure Python we could have used None sensibly 5946 outfile.variables[q+Write_sww.RANGE][0] = max_float # Min 5947 outfile.variables[q+Write_sww.RANGE][1] = -max_float # Max 5948 5948 5949 5949 # FIXME: Backwards compatibility … … 5960 5960 outfile.createVariable(q, sww_precision, ('number_of_timesteps', 5961 5961 'number_of_points')) 5962 #outfile.createVariable(q + Write_sww.RANGE, sww_precision,5963 #('numbers_in_range',))5962 outfile.createVariable(q + Write_sww.RANGE, sww_precision, 5963 ('numbers_in_range',)) 5964 5964 5965 5965 # Initialise ranges with small and large sentinels. 5966 5966 # If this was in pure Python we could have used None sensibly 5967 #outfile.variables[q+Write_sww.RANGE][0] = max_float # Min5968 #outfile.variables[q+Write_sww.RANGE][1] = -max_float # Max5967 outfile.variables[q+Write_sww.RANGE][0] = max_float # Min 5968 outfile.variables[q+Write_sww.RANGE][1] = -max_float # Max 5969 5969 5970 5970 if type(times) is list or type(times) is num.ArrayType: … … 6075 6075 q = 'elevation' 6076 6076 # This updates the _range values 6077 #outfile.variables[q + Write_sww.RANGE][0] = min(elevation)6078 #outfile.variables[q + Write_sww.RANGE][1] = max(elevation)6077 outfile.variables[q + Write_sww.RANGE][0] = min(elevation) 6078 outfile.variables[q + Write_sww.RANGE][1] = max(elevation) 6079 6079 6080 6080 … … 6128 6128 q_values.astype(sww_precision) 6129 6129 6130 ## This updates the _range values6131 #q_range = outfile.variables[q + Write_sww.RANGE][:]6132 #q_values_min = min(q_values)6133 #if q_values_min < q_range[0]:6134 #outfile.variables[q + Write_sww.RANGE][0] = q_values_min6135 #q_values_max = max(q_values)6136 #if q_values_max > q_range[1]:6137 #outfile.variables[q + Write_sww.RANGE][1] = q_values_max6130 # This updates the _range values 6131 q_range = outfile.variables[q + Write_sww.RANGE][:] 6132 q_values_min = min(q_values) 6133 if q_values_min < q_range[0]: 6134 outfile.variables[q + Write_sww.RANGE][0] = q_values_min 6135 q_values_max = max(q_values) 6136 if q_values_max > q_range[1]: 6137 outfile.variables[q + Write_sww.RANGE][1] = q_values_max 6138 6138 6139 6139 ## 6140 6140 # @brief Print the quantities in the underlying file. 6141 6141 # @param outfile UNUSED. 6142 #def verbose_quantities(self, outfile):6143 #print '------------------------------------------------'6144 #print 'More Statistics:'6145 #for q in Write_sww.sww_quantities:6146 #print ' %s in [%f, %f]' % (q,6147 #outfile.variables[q+Write_sww.RANGE][0],6148 #outfile.variables[q+Write_sww.RANGE][1])6149 #print '------------------------------------------------'6142 def verbose_quantities(self, outfile): 6143 print '------------------------------------------------' 6144 print 'More Statistics:' 6145 for q in Write_sww.sww_quantities: 6146 print ' %s in [%f, %f]' % (q, 6147 outfile.variables[q+Write_sww.RANGE][0], 6148 outfile.variables[q+Write_sww.RANGE][1]) 6149 print '------------------------------------------------' 6150 6150 6151 6151 … … 6498 6498 6499 6499 # This updates the _range values 6500 #q_range = outfile.variables[q + Write_sts.RANGE][:]6501 #q_values_min = min(q_values)6502 #if q_values_min < q_range[0]:6503 #outfile.variables[q + Write_sts.RANGE][0] = q_values_min6504 #q_values_max = max(q_values)6505 #if q_values_max > q_range[1]:6506 #outfile.variables[q + Write_sts.RANGE][1] = q_values_max6500 q_range = outfile.variables[q + Write_sts.RANGE][:] 6501 q_values_min = min(q_values) 6502 if q_values_min < q_range[0]: 6503 outfile.variables[q + Write_sts.RANGE][0] = q_values_min 6504 q_values_max = max(q_values) 6505 if q_values_max > q_range[1]: 6506 outfile.variables[q + Write_sts.RANGE][1] = q_values_max 6507 6507 6508 6508
Note: See TracChangeset
for help on using the changeset viewer.