Changeset 2007
- Timestamp:
- Nov 7, 2005, 1:16:19 PM (18 years ago)
- Location:
- inundation/pyvolution
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/pyvolution/data_manager.py
r2003 r2007 3140 3140 outfile.order = 1 3141 3141 3142 3142 #FIXME(DSG) - hack to get a good sww file 3143 number_of_times = 1 3144 3143 3145 # dimension definitions 3144 3146 outfile.createDimension('number_of_volumes', number_of_volumes) … … 3231 3233 #outfile.variables['elevation'][:] = z #FIXME HACK 3232 3234 #outfile.variables['time'][:] = times #Store time relative 3233 #outfile.variables['time'][:] = [0 ] #Store time relative3235 #outfile.variables['time'][:] = [0.0] #Store time relative 3234 3236 outfile.variables['volumes'][:] = volumes.astype(Int32) #On Opteron 64 3235 3237 3236 3238 # do this to create an ok sww file? 3237 #outfile.variables['time'][:] = [0] #Store time relative3238 #outfile.variables['stage'] = z3239 outfile.variables['time'][:] = [0] #Store time relative 3240 outfile.variables['stage'] = z 3239 3241 #outfile.variables['xmomentum'] = z 3240 3242 #outfile.variables['ymomentum'] = z -
inundation/pyvolution/test_data_manager.py
r2005 r2007 2709 2709 cellsize 0.25 2710 2710 nodata_value -9999.0 2711 90 .000 60.000 30.02711 9000.000 60.000 3000.0 2712 2712 -10.000 -20.000 -30.000 2713 2713 """) … … 2747 2747 y = fid.variables['y'][:] 2748 2748 geo_ref = Geo_reference(NetCDFObject=fid) 2749 #print "geo_ref",geo_ref 2750 x_ref = geo_ref.get_xllcorner() 2751 y_ref = geo_ref.get_yllcorner() 2752 self.failUnless(geo_ref.get_zone() == 55, 'Failed') 2753 assert allclose(x_ref, 587798.418) # (-38, 148) 2754 assert allclose(y_ref, 5793123.477)# (-38, 148.5) 2749 2755 2756 #Zone: 55 2757 #Easting: 588095.674 Northing: 5821451.722 2758 #Latitude: -37 45 ' 0.00000 '' Longitude: 148 0 ' 0.00000 '' 2759 assert allclose((x[0],y[0]), (588095.674 - x_ref, 5821451.722 - y_ref)) 2760 2761 #Zone: 55 2762 #Easting: 632145.632 Northing: 5820863.269 2763 #Latitude: -37 45 ' 0.00000 '' Longitude: 148 30 ' 0.00000 '' 2764 assert allclose((x[2],y[2]), (632145.632 - x_ref, 5820863.269 - y_ref)) 2765 2766 #Zone: 55 2767 #Easting: 609748.788 Northing: 5793447.860 2768 #Latitude: -38 0 ' 0.00000 '' Longitude: 148 15 ' 0.00000 '' 2769 assert allclose((x[4],y[4]), (609748.788 - x_ref, 5793447.860 - y_ref)) 2770 2750 2771 fid.close() 2751 2772 … … 2771 2792 #Grid Convergence: 0 36 ' 56.52 '' Point Scale: 0.99969494 2772 2793 2794 2795 #Zone: 55 2796 #Easting: 631699.669 Northing: 5793123.477 2797 #Latitude: -38 0 ' 0.00000 '' Longitude: 148 30 ' 0.00000 '' 2798 2773 2799 2774 2800 #------------------------------------------------------------- 2775 2801 if __name__ == "__main__": 2776 #suite = unittest.makeSuite(Test_Data_Manager,'test_asc_')2777 2802 suite = unittest.makeSuite(Test_Data_Manager,'test') 2778 2803 #suite = unittest.makeSuite(Test_Data_Manager,'xxxtest')
Note: See TracChangeset
for help on using the changeset viewer.