Changeset 7317 for anuga_core/source/anuga/utilities
- Timestamp:
- Jul 22, 2009, 9:22:11 AM (16 years ago)
- Location:
- anuga_core/source/anuga/utilities
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/utilities/numerical_tools.py
r7276 r7317 7 7 from warnings import warn 8 8 9 import anuga.utilities.log as log 9 10 import numpy as num 10 11 … … 41 42 raise ValueError, errmsg 42 43 else: 43 print 'NOTE: changing argument to acos from %.18f to 1.0' %x44 log.critical('NOTE: changing argument to acos from %.18f to 1.0' %x) 44 45 x = 1.0 45 46 -
anuga_core/source/anuga/utilities/polygon.py
r7276 r7317 9 9 from anuga.geospatial_data.geospatial_data import ensure_absolute, Geospatial_data 10 10 from anuga.config import netcdf_float 11 import anuga.utilities.log as log 11 12 12 13 … … 642 643 643 644 if verbose: 644 print 'Found %d points (out of %d) inside polygon' % (count, M)645 log.critical('Found %d points (out of %d) inside polygon' % (count, M)) 645 646 646 647 return indices, count … … 929 930 'within its regions in [%.2f, %.2f], y in [%.2f, %.2f]' 930 931 % (min(x), max(x), min(y), max(y))) 931 print msg932 log.critical(msg) 932 933 933 934 return z … … 1121 1122 # TO DO check if any of the regions fall inside one another 1122 1123 1123 print '----------------------------------------------------------------------------' 1124 print 'Polygon Max triangle area (m^2) Total area (km^2) Estimated #triangles' 1125 print '----------------------------------------------------------------------------' 1124 log.critical('-' * 80) 1125 log.critical('Polygon Max triangle area (m^2) Total area (km^2) ' 1126 'Estimated #triangles') 1127 log.critical('-' * 80) 1126 1128 1127 1129 no_triangles = 0.0 … … 1134 1136 area -= this_area 1135 1137 1136 print 'Interior ', 1137 print ('%.0f' % resolution).ljust(25), 1138 print ('%.2f' % (this_area/1000000)).ljust(19), 1139 print '%d' % (this_triangles) 1138 log.critical('Interior %s%s%d' 1139 % (('%.0f' % resolution).ljust(25), 1140 ('%.2f' % (this_area/1000000)).ljust(19), 1141 this_triangles)) 1142 #print 'Interior ', 1143 #print ('%.0f' % resolution).ljust(25), 1144 #print ('%.2f' % (this_area/1000000)).ljust(19), 1145 #print '%d' % (this_triangles) 1140 1146 1141 1147 bound_triangles = area/remainder_res 1142 1148 no_triangles += bound_triangles 1143 1149 1144 print 'Bounding ', 1145 print ('%.0f' % remainder_res).ljust(25), 1146 print ('%.2f' % (area/1000000)).ljust(19), 1147 print '%d' % (bound_triangles) 1150 log.critical('Bounding %s%s%d' 1151 % (('%.0f' % remainder_res).ljust(25), 1152 ('%.2f' % (area/1000000)).ljust(19), 1153 bound_triangles)) 1154 #print 'Bounding ', 1155 #print ('%.0f' % remainder_res).ljust(25), 1156 #print ('%.2f' % (area/1000000)).ljust(19), 1157 #print '%d' % (bound_triangles) 1148 1158 1149 1159 total_number_of_triangles = no_triangles/0.7 1150 1160 1151 print 'Estimated total number of triangles: %d' %total_number_of_triangles 1152 print 'Note: This is generally about 20% less than the final amount' 1161 log.critical('Estimated total number of triangles: %d' 1162 % total_number_of_triangles) 1163 log.critical('Note: This is generally about 20%% ' 1164 'less than the final amount') 1153 1165 1154 1166 return int(total_number_of_triangles) -
anuga_core/source/anuga/utilities/quad.py
r7276 r7317 6 6 from treenode import TreeNode 7 7 import string, types, sys 8 import anuga.utilities.log as log 8 9 9 10 … … 124 125 three_cells = self.branch.pop() 125 126 for cell in three_cells: 126 #print "cell ", cell.show()127 127 points += cell.retrieve(get_vertices=get_vertices) 128 128 return points, self.branch … … 223 223 triangles = {} 224 224 verts = self.retrieve_vertices() 225 # print "verts", verts226 225 for vert in verts: 227 226 triangle_list = self.mesh.get_triangles_and_vertices_per_node(vert) 228 227 for k, _ in triangle_list: 229 228 if not triangles.has_key(k): 230 # print 'k',k231 229 tri = self.mesh.get_vertex_coordinates(k, 232 230 absolute=True) … … 372 370 """ 373 371 if depth == 0: 374 print375 print "%s%s" % (' '*depth, self.name),376 if self.children: 377 print372 log.critical() 373 log.critical("%s%s" % (' '*depth, self.name)) 374 if self.children: 375 log.critical() 378 376 for child in self.children: 379 377 child.show(depth+1) 380 378 else: 381 print '(xmin=%.2f, xmax=%.2f, ymin=%.2f, ymax=%.2f): [%d]'\ 382 %(self.western, self.eastern, 383 self.southern, self.northern, 384 self.count()) 379 log.critical('(xmin=%.2f, xmax=%.2f, ymin=%.2f, ymax=%.2f): [%d]' 380 % (self.western, self.eastern, self.southern, 381 self.northern, self.count())) 385 382 386 383 … … 390 387 """ 391 388 if depth == 0: 392 print393 print "%s%s:" % (' '*depth, self.name),389 log.critical() 390 log.critical("%s%s:" % (' '*depth, self.name)) 394 391 if self.children: 395 392 print … … 397 394 child.show_all(depth+1) 398 395 else: 399 print '%s' %self.retrieve()396 log.critical('%s' % self.retrieve()) 400 397 401 398 -
anuga_core/source/anuga/utilities/system_tools.py
r7276 r7317 15 15 except ImportError: 16 16 import md5 as hashlib 17 18 import anuga.utilities.log as log 17 19 18 20 … … 238 240 239 241 if verbose is True: 240 print 'Version info stored to %s' %filename242 log.critical('Version info stored to %s' % filename) 241 243 242 244
Note: See TracChangeset
for help on using the changeset viewer.