Changeset 994
- Timestamp:
- Mar 3, 2005, 4:03:23 PM (20 years ago)
- Location:
- inundation/ga/storm_surge/pyvolution
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/data_manager.py
r982 r994 1238 1238 #print file_h.variables.keys() 1239 1239 1240 file_h.close() 1241 file_u.close() 1242 file_v.close() 1243 1244 1240 1245 if verbose: print 'Store to SWW file %s' %swwname 1241 1246 # NetCDF file definition … … 1404 1409 #print "min(stage.flat), mpythonax(stage.flat)",min(stage.flat), max(stage.flat) 1405 1410 #print "min(stage)",min(stage) 1411 1412 fid.close() 1413 1406 1414 return [min(x),max(x),min(y),max(y),min(stage.flat),max(stage.flat)] 1407 1415 -
inundation/ga/storm_surge/pyvolution/test_data_manager.py
r991 r994 135 135 from Scientific.IO.NetCDF import NetCDFFile 136 136 137 self.domain.filename = 'datatest' + str( time.time())137 self.domain.filename = 'datatest' + str(id(self)) 138 138 self.domain.format = 'sww' 139 139 self.domain.smooth = False … … 182 182 from Scientific.IO.NetCDF import NetCDFFile 183 183 184 self.domain.filename = 'datatest' + str( time.time())184 self.domain.filename = 'datatest' + str(id(self)) 185 185 self.domain.format = 'sww' 186 186 self.domain.smooth = True … … 239 239 from Scientific.IO.NetCDF import NetCDFFile 240 240 241 self.domain.filename = 'datatest' + str( time.time())241 self.domain.filename = 'datatest' + str(id(self)) 242 242 self.domain.format = 'sww' 243 243 self.domain.smooth = True … … 294 294 from Scientific.IO.NetCDF import NetCDFFile 295 295 296 self.domain.filename = 'datatest' + str( time.time())296 self.domain.filename = 'datatest' + str(id(self)) 297 297 self.domain.format = 'sww' 298 298 self.domain.smooth = True … … 352 352 from Scientific.IO.NetCDF import NetCDFFile 353 353 354 self.domain.filename = 'datatest' + str( time.time())354 self.domain.filename = 'datatest' + str(id(self)) 355 355 self.domain.format = 'sww' 356 356 self.domain.smooth = True … … 444 444 from Scientific.IO.NetCDF import NetCDFFile 445 445 446 self.domain.filename = 'datatest' + str( time.time())446 self.domain.filename = 'datatest' + str(id(self)) 447 447 self.domain.format = 'sww' 448 448 self.domain.smooth = True … … 489 489 # print "****************************" 490 490 491 492 493 491 494 492 fid.close() … … 634 632 #Check fourth value 635 633 assert allclose(stage[0,3], fourth_value/100) #Meters 634 635 fid.close() 636 637 #Cleanup 638 import os 639 os.remove('small.sww') 640 636 641 637 642 … … 692 697 assert allclose(stage[time_index, linear_point_index], test_value/100) 693 698 699 fid.close() 700 701 #Cleanup 702 import os 703 os.remove('small.sww') 704 705 706 694 707 695 708 def test_sww_extent(self): … … 701 714 from Scientific.IO.NetCDF import NetCDFFile 702 715 703 self.domain.filename = 'datatest' + str( time.time())716 self.domain.filename = 'datatest' + str(id(self)) 704 717 self.domain.format = 'sww' 705 718 self.domain.smooth = True … … 723 736 [xmin, xmax, ymin, ymax, stagemin, stagemax] = \ 724 737 extent_sww(file_and_extension_name ) 725 #print "[xmin, xmax, ymin, ymax, stagemin, stagemax]",[xmin, xmax, ymin, ymax, stagemin, stagemax]738 726 739 assert allclose(xmin, 0.0) 727 740 assert allclose(xmax, 1.0) … … 730 743 assert allclose(stagemin, -0.85) 731 744 assert allclose(stagemax, 0.15) 745 746 747 #Cleanup 748 os.remove(sww.filename) 749 732 750 733 751 def test_ferret2sww_nz_origin(self): … … 738 756 ferret2sww('small', verbose=False, 739 757 origin = (56, 100000, 200000, 500000, 10000000)) 740 758 741 759 742 760 #Work out the UTM coordinates for first point … … 744 762 745 763 #Read output file 'small.sww' 746 fid = NetCDFFile('small.sww' )764 fid = NetCDFFile('small.sww', 'r') 747 765 748 766 x = fid.variables['x'][:] … … 753 771 assert allclose(y[0], n-200000) 754 772 773 fid.close() 774 775 #Cleanup 776 import os 777 os.remove('small.sww') 755 778 756 779 -
inundation/ga/storm_surge/pyvolution/test_least_squares.py
r979 r994 1057 1057 os.remove(mesh_file) 1058 1058 os.remove(point_file) 1059 os.remove(mesh_output_file) 1059 1060 1060 1061 def test_fit_to_mesh_fileII(self): -
inundation/ga/storm_surge/pyvolution/test_util.py
r984 r994 536 536 domain1.store = True 537 537 domain1.set_datadir('.') 538 domain1.set_name('spatio_temporal_boundary_source ' + str(time.time()))538 domain1.set_name('spatio_temporal_boundary_source_%d' %(id(self))) 539 539 domain1.quantities_to_be_stored = ['stage', 'xmomentum', 'ymomentum'] 540 540 … … 696 696 697 697 fid.close() 698 698 import os 699 os.remove(filename) 700 699 701 700 702 def test_xya_ascii(self): -
inundation/ga/storm_surge/pyvolution/util.py
r989 r994 297 297 298 298 299 print ' Interpolation points (xi, eta):' 300 print ' xi in [%f, %f], len(xi) == %d'\ 301 %(min(P[:,0]), max(P[:,0]), P.shape[0]) 302 print ' eta in [%f, %f], len(eta) == %d'\ 303 %(min(P[:,1]), max(P[:,1]), P.shape[1]) 299 print ' Interpolation points (xi, eta):'\ 300 'number of points == %d ' %P.shape[0] 301 print ' xi in [%f, %f]' %(min(P[:,0]), max(P[:,0])) 302 print ' eta in [%f, %f]' %(min(P[:,1]), max(P[:,1])) 304 303 print ' Interpolated quantities:' 305 304 for name in self.quantities:
Note: See TracChangeset
for help on using the changeset viewer.