Changeset 2007


Ignore:
Timestamp:
Nov 7, 2005, 1:16:19 PM (18 years ago)
Author:
duncan
Message:

working on gippsland to sww

Location:
inundation/pyvolution
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/pyvolution/data_manager.py

    r2003 r2007  
    31403140    outfile.order = 1
    31413141   
    3142 
     3142    #FIXME(DSG) - hack to get a good sww file
     3143    number_of_times = 1
     3144   
    31433145    # dimension definitions
    31443146    outfile.createDimension('number_of_volumes', number_of_volumes)
     
    32313233    #outfile.variables['elevation'][:] = z  #FIXME HACK
    32323234    #outfile.variables['time'][:] = times   #Store time relative
    3233     #outfile.variables['time'][:] = [0]   #Store time relative
     3235    #outfile.variables['time'][:] = [0.0]   #Store time relative
    32343236    outfile.variables['volumes'][:] = volumes.astype(Int32) #On Opteron 64
    32353237
    32363238    # do this to create an ok sww file?
    3237     #outfile.variables['time'][:] = [0]   #Store time relative
    3238     #outfile.variables['stage'] = z
     3239    outfile.variables['time'][:] = [0]   #Store time relative
     3240    outfile.variables['stage'] = z
    32393241    #outfile.variables['xmomentum'] = z
    32403242    #outfile.variables['ymomentum'] = z
  • inundation/pyvolution/test_data_manager.py

    r2005 r2007  
    27092709 cellsize       0.25
    27102710 nodata_value   -9999.0
    2711     90.000    60.000    30.0
     2711    9000.000    60.000    3000.0
    27122712   -10.000   -20.000   -30.000
    27132713""")
     
    27472747        y = fid.variables['y'][:]
    27482748        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)
    27492755       
     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
    27502771        fid.close()
    27512772   
     
    27712792        #Grid Convergence:  0  36 ' 56.52 ''  Point Scale: 0.99969494
    27722793
     2794
     2795        #Zone:   55   
     2796        #Easting:  631699.669  Northing: 5793123.477
     2797        #Latitude:   -38 0 ' 0.00000 ''  Longitude: 148  30 ' 0.00000 ''
     2798
    27732799       
    27742800#-------------------------------------------------------------
    27752801if __name__ == "__main__":
    2776     #suite = unittest.makeSuite(Test_Data_Manager,'test_asc_')
    27772802    suite = unittest.makeSuite(Test_Data_Manager,'test')
    27782803    #suite = unittest.makeSuite(Test_Data_Manager,'xxxtest')
Note: See TracChangeset for help on using the changeset viewer.