Changeset 2022


Ignore:
Timestamp:
Nov 14, 2005, 10:15:25 AM (19 years ago)
Author:
duncan
Message:

continuing work on reading gippsland files.

Location:
inundation
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • inundation/examples/run_gippsland.py

    r2006 r2022  
    11from pyvolution.data_manager import asc_csiro2sww
    22
    3 asc_csiro2sww('bathymetry_expanded','elev_expanded', 'test.sww')
     3asc_csiro2sww('bathymetry_expanded','elev_expanded','ucur_expanded',
     4              'vcur_expanded', 'test.sww',zscale=1000, mean_stage = 100,
     5              fail_on_NaN = False,
     6              elevation_NaN_filler = 0)
  • inundation/pyvolution/combine_pts.py

    r1917 r2022  
    148148    #print "extent",extent
    149149
    150     #get a list of in point indices
    151     #FIXME closed doesn't seems to work here.
    152     #FIXME (Ole): This functionality has a unittest - so we need a bit
    153     #more information than that :-)
    154     #FIXME (dsg): Ha ha. I think changes that we've done have fixed this.
    155     # Did the unit tests I did for combine_pts show that it didn't
    156     #seem to work? Or that it works now? It's hard to tell.
    157     # Let's close this fixme, due to everybogy thinking that there is
    158     # no problem.
    159150    inside_indices = inside_polygon(points['pointlist'],
    160151                                    extent, closed=True)
  • inundation/pyvolution/data_manager.py

    r2009 r2022  
    5050import os
    5151
    52 from Numeric import concatenate, array, Float, resize
     52from Numeric import concatenate, array, Float, resize, sometrue
    5353
    5454from coordinate_transforms.geo_reference import Geo_reference
     
    13791379        ptsname = basename_out + '.pts'
    13801380
     1381    #FIXME (DSG-ON): use loadASCII export_points_file
    13811382    if verbose: print 'Store to NetCDF file %s' %ptsname
    13821383    # NetCDF file definition
     
    32663267    fid.close()
    32673268
    3268 def asc_csiro2sww(bath_dir, elevation_dir, sww_file, verbose=False):
    3269     """
     3269def asc_csiro2sww(bath_dir,
     3270                  elevation_dir,
     3271                  ucur_dir,
     3272                  vcur_dir,
     3273                  sww_file,
     3274                  zscale=1,
     3275                  mean_stage = 0,
     3276                  fail_on_NaN = True,
     3277                  elevation_NaN_filler = 0,
     3278                  bath_prefix='ba',
     3279                  elevation_prefix='el',
     3280                  verbose=False):
     3281    """
     3282
     3283    Also convert latitude and longitude to UTM. All coordinates are
     3284    assumed to be given in the GDA94 datum.
    32703285   
    32713286    assume:
     
    32783293    v velocity
    32793294
    3280     Assume each type is in a seperate directory
    3281     assume one bath file with extention .000
     3295    Assumptions
     3296    Each type is in a seperate directory
     3297    One bath file with extention .000
     3298    The time period is less than 24hrs and uniform.
    32823299    """
    32833300    from Scientific.IO.NetCDF import NetCDFFile
     
    32893306    precision = Float # So if we want to change the precision its done here
    32903307   
    3291     # go in to the bath dir and load the 000 file,
     3308    # go in to the bath dir and load the only file,
    32923309    bath_files = os.listdir(bath_dir)
    32933310    #print "bath_files",bath_files
     
    33033320    #the start time for other files
    33043321    base_start = bath_file[-12:]
    3305     #print "base_start",base_start
    33063322   
    33073323    #go into the elevation dir and load the 000 file
    3308     elevation_dir_file = elevation_dir  + os.sep + 'el' + base_start
     3324    elevation_dir_file = elevation_dir  + os.sep + elevation_prefix \
     3325                         + base_start
    33093326    elevation_metadata,elevation_grid =  _read_asc(elevation_dir_file)
    33103327    #print "elevation_dir_file",elevation_dir_file
    33113328    #print "elevation_grid", elevation_grid
     3329   
     3330    elevation_files = os.listdir(elevation_dir)
     3331    ucur_files = os.listdir(ucur_dir)
     3332    vcur_files = os.listdir(vcur_dir)
     3333
     3334    # the first elevation file should be the
     3335    # file with the same base name as the bath data
     3336    #print "elevation_files[0]",elevation_files[0]
     3337    #print "'el' + base_start",'el' + base_start
     3338    assert elevation_files[0] == 'el' + base_start
    33123339   
    33133340    assert bath_metadata == elevation_metadata
     
    33293356    # reverse order of lat, so the fist lat represents the first grid row
    33303357    latitudes.reverse()
    3331    
     3358
     3359    #Work out the times
     3360    if len(elevation_files) > 1:
     3361        # Assume: The time period is less than 24hrs.
     3362        time_period = (int(elevation_files[1][-3:]) - \
     3363                      int(elevation_files[0][-3:]))*60*60
     3364        times = [x*time_period for x in range(len(elevation_files))]
     3365    else:
     3366        times = [0.0]
     3367    #print "times", times
    33323368    #print "number_of_latitudes", number_of_latitudes
    33333369    #print "number_of_longitudes", number_of_longitudes
     
    33353371    #print "latitudes", latitudes
    33363372    #print "longitudes", longitudes
     3373
    33373374   
    33383375    ######### WRITE THE SWW FILE #############
     
    33493386    outfile.order = 1
    33503387   
    3351     #FIXME(DSG) - hack to get a good sww file
    3352     number_of_times = 1
    33533388   
    33543389    # dimension definitions
     
    34263461    volumes = array(volumes)
    34273462
    3428     # FIXME - use coords
    3429     zone = refzone
    3430     xllcorner = min(x)
    3431     yllcorner = min(y)
    3432 
    3433     outfile.xllcorner = xllcorner
    3434     outfile.yllcorner = yllcorner
    3435     outfile.zone = zone
    3436 
     3463    geo_ref = Geo_reference(refzone,min(x),min(y))
     3464    geo_ref.write_NetCDF(outfile)
    34373465
    34383466    z = resize(bath_grid,outfile.variables['z'][:].shape)
    3439     outfile.variables['x'][:] = x - xllcorner
    3440     outfile.variables['y'][:] = y - yllcorner
     3467    outfile.variables['x'][:] = x - geo_ref.get_xllcorner()
     3468    outfile.variables['y'][:] = y - geo_ref.get_yllcorner()
    34413469    outfile.variables['z'][:] = z
    3442     #outfile.variables['elevation'][:] = z  #FIXME HACK
    3443     #outfile.variables['time'][:] = times   #Store time relative
    3444     #outfile.variables['time'][:] = [0.0]   #Store time relative
     3470    outfile.variables['elevation'][:] = z  #FIXME HACK
    34453471    outfile.variables['volumes'][:] = volumes.astype(Int32) #On Opteron 64
    34463472
    3447     # do this to create an ok sww file?
    3448     outfile.variables['time'][:] = [0]   #Store time relative
    3449     outfile.variables['stage'] = z
    3450     #outfile.variables['xmomentum'] = z
    3451     #outfile.variables['ymomentum'] = z
    3452    
     3473    # do this to create an ok sww file.
     3474    #outfile.variables['time'][:] = [0]   #Store time relative
     3475    #outfile.variables['stage'] = z
     3476    # put the next line up in the code after outfile.order = 1
     3477    #number_of_times = 1
     3478
     3479    stage = outfile.variables['stage']
     3480    xmomentum = outfile.variables['xmomentum']
     3481    ymomentum = outfile.variables['ymomentum']
     3482   
     3483    outfile.variables['time'][:] = times   #Store time relative
     3484   
     3485    if verbose: print 'Converting quantities'
     3486    for j in range(number_of_times):
     3487        # load in files
     3488        elevation_meta, elevation_grid = \
     3489           _read_asc(elevation_dir + os.sep + elevation_files[j])
     3490                         
     3491        u_meta, u_momentum_grid =  _read_asc(ucur_dir + os.sep + ucur_files[j])
     3492        v_meta, v_momentum_grid =  _read_asc(vcur_dir + os.sep + vcur_files[j])
     3493
     3494       
     3495        # handle missing values
     3496        missing = (elevation_grid == elevation_meta['NODATA_value'])
     3497        if sometrue (missing):
     3498            if fail_on_NaN:
     3499                msg = 'File %s contains missing values'\
     3500                      %(elevation_files[j])
     3501                raise msg
     3502            else:
     3503                elevation_grid = elevation_grid*(missing==0) + \
     3504                                 missing*elevation_NaN_filler
     3505
     3506
     3507        if verbose and j%((n+10)/10)==0: print '  Doing %d of %d' %(j, n)
     3508        i = 0
     3509        for k in range(number_of_latitudes):      #Y direction
     3510            for l in range(number_of_longitudes): #X direction
     3511                #w = zscale*amplitudes[j,k,l]/100 + mean_stage
     3512                w = zscale*elevation_grid[k,l] + mean_stage
     3513                stage[j,i] = w
     3514                h = w - z[i]
     3515                xmomentum[j,i] = u_momentum_grid[k,l]*h
     3516                ymomentum[j,i] = v_momentum_grid[k,l]*h
     3517                i += 1
     3518
    34533519    outfile.close()
    34543520   
  • inundation/pyvolution/test_data_manager.py

    r2009 r2022  
    28402840 cellsize       0.25
    28412841 nodata_value   -9999.0
    2842     9000.000    60.000    3000.0
    2843    -10.000   -20.000   -30.000
     2842    9000.000    -1000.000    3000.0
     2843   -1000.000    9000.000  -1000.000
    28442844""")
    28452845        fid.close()
     
    28522852 cellsize       0.25
    28532853 nodata_value   -9999.0
    2854     90.000    60.000    30.0
    2855      0.000     0.000     0.000
     2854    9000.000    0.000    3000.0
     2855     0.000     9000.000     0.000
    28562856""")
    28572857        fid.close()
    28582858
    28592859        fid = open(elevation_dir_filename2, 'w')
     2860        fid.write(""" ncols             3
     2861 nrows             2
     2862 xllcorner    148.00000
     2863 yllcorner    -38.00000
     2864 cellsize       0.25
     2865 nodata_value   -9999.0
     2866    9000.000    4000.000    4000.0
     2867    4000.000    9000.000    4000.000
     2868""")
     2869        fid.close()
     2870         
     2871        ucur_dir =  tempfile.mkdtemp()
     2872        ucur_dir_filename1 = ucur_dir + os.sep +'uc19940524.000'
     2873        ucur_dir_filename2 = ucur_dir + os.sep +'uc19940524.001'
     2874       
     2875        fid = open(ucur_dir_filename1, 'w')
    28602876        fid.write(""" ncols             3
    28612877 nrows             2
     
    28682884""")
    28692885        fid.close()
    2870        
    2871         sww_file = 'test.sww'
    2872         asc_csiro2sww(bath_dir,elevation_dir, sww_file)
     2886        fid = open(ucur_dir_filename2, 'w')
     2887        fid.write(""" ncols             3
     2888 nrows             2
     2889 xllcorner    148.00000
     2890 yllcorner    -38.00000
     2891 cellsize       0.25
     2892 nodata_value   -9999.0
     2893    90.000    60.000    30.0
     2894    10.000    10.000    10.000
     2895""")
     2896        fid.close()
     2897       
     2898        vcur_dir =  tempfile.mkdtemp()
     2899        vcur_dir_filename1 = vcur_dir + os.sep +'vc19940524.000'
     2900        vcur_dir_filename2 = vcur_dir + os.sep +'vc19940524.001'
     2901       
     2902        fid = open(vcur_dir_filename1, 'w')
     2903        fid.write(""" ncols             3
     2904 nrows             2
     2905 xllcorner    148.00000
     2906 yllcorner    -38.00000
     2907 cellsize       0.25
     2908 nodata_value   -9999.0
     2909    90.000    60.000    30.0
     2910    10.000    10.000    10.000
     2911""")
     2912        fid.close()
     2913        fid = open(vcur_dir_filename2, 'w')
     2914        fid.write(""" ncols             3
     2915 nrows             2
     2916 xllcorner    148.00000
     2917 yllcorner    -38.00000
     2918 cellsize       0.25
     2919 nodata_value   -9999.0
     2920    90.000    60.000    30.0
     2921    10.000    10.000    10.000
     2922""")
     2923        fid.close()
     2924       
     2925        sww_file = 'a_test.sww'
     2926        asc_csiro2sww(bath_dir,elevation_dir, ucur_dir, vcur_dir, sww_file)
    28732927
    28742928        # check the sww file
     
    28772931        x = fid.variables['x'][:]
    28782932        y = fid.variables['y'][:]
     2933        z = fid.variables['z'][:]
     2934        stage = fid.variables['stage'][:]
     2935        xmomentum = fid.variables['xmomentum'][:]
    28792936        geo_ref = Geo_reference(NetCDFObject=fid)
    28802937        #print "geo_ref",geo_ref
     
    28982955        #Easting:  609748.788  Northing: 5793447.860
    28992956        #Latitude:   -38  0 ' 0.00000 ''  Longitude: 148  15 ' 0.00000 ''
    2900         assert allclose((x[4],y[4]), (609748.788  - x_ref, 5793447.860 - y_ref))
    2901 
     2957        assert allclose((x[4],y[4]), (609748.788  - x_ref, 5793447.86 - y_ref))
     2958
     2959        assert allclose(z[0],9000.0 )
     2960        assert allclose(stage[0][1],0.0 )
     2961
     2962        #(4000+1000)*60
     2963        assert allclose(xmomentum[1][1],300000.0 )
     2964       
     2965       
    29022966        fid.close()
    29032967   
     
    29142978        os.remove(sww_file)
    29152979       
     2980    def test_asc_csiro2sww2(self):
     2981        import tempfile
     2982
     2983        bath_dir = tempfile.mkdtemp()
     2984        bath_dir_filename = bath_dir + os.sep +'ba19940524.000'
     2985        #bath_dir = 'bath_data_manager_test'
     2986        #print "os.getcwd( )",os.getcwd( )
     2987        elevation_dir =  tempfile.mkdtemp()
     2988        #elevation_dir = 'elev_expanded'
     2989        elevation_dir_filename1 = elevation_dir + os.sep +'el19940524.000'
     2990        elevation_dir_filename2 = elevation_dir + os.sep +'el19940524.001'
     2991       
     2992        fid = open(bath_dir_filename, 'w')
     2993        fid.write(""" ncols             3
     2994 nrows             2
     2995 xllcorner    148.00000
     2996 yllcorner    -38.00000
     2997 cellsize       0.25
     2998 nodata_value   -9999.0
     2999    9000.000    -1000.000    3000.0
     3000   -1000.000    9000.000  -1000.000
     3001""")
     3002        fid.close()
     3003       
     3004        fid = open(elevation_dir_filename1, 'w')
     3005        fid.write(""" ncols             3
     3006 nrows             2
     3007 xllcorner    148.00000
     3008 yllcorner    -38.00000
     3009 cellsize       0.25
     3010 nodata_value   -9999.0
     3011    9000.000    0.000    3000.0
     3012     0.000     -9999.000     -9999.000
     3013""")
     3014        fid.close()
     3015
     3016        fid = open(elevation_dir_filename2, 'w')
     3017        fid.write(""" ncols             3
     3018 nrows             2
     3019 xllcorner    148.00000
     3020 yllcorner    -38.00000
     3021 cellsize       0.25
     3022 nodata_value   -9999.0
     3023    9000.000    4000.000    4000.0
     3024    4000.000    9000.000    4000.000
     3025""")
     3026        fid.close()
     3027         
     3028        ucur_dir =  tempfile.mkdtemp()
     3029        ucur_dir_filename1 = ucur_dir + os.sep +'uc19940524.000'
     3030        ucur_dir_filename2 = ucur_dir + os.sep +'uc19940524.001'
     3031       
     3032        fid = open(ucur_dir_filename1, 'w')
     3033        fid.write(""" ncols             3
     3034 nrows             2
     3035 xllcorner    148.00000
     3036 yllcorner    -38.00000
     3037 cellsize       0.25
     3038 nodata_value   -9999.0
     3039    90.000    60.000    30.0
     3040    10.000    10.000    10.000
     3041""")
     3042        fid.close()
     3043        fid = open(ucur_dir_filename2, 'w')
     3044        fid.write(""" ncols             3
     3045 nrows             2
     3046 xllcorner    148.00000
     3047 yllcorner    -38.00000
     3048 cellsize       0.25
     3049 nodata_value   -9999.0
     3050    90.000    60.000    30.0
     3051    10.000    10.000    10.000
     3052""")
     3053        fid.close()
     3054       
     3055        vcur_dir =  tempfile.mkdtemp()
     3056        vcur_dir_filename1 = vcur_dir + os.sep +'vc19940524.000'
     3057        vcur_dir_filename2 = vcur_dir + os.sep +'vc19940524.001'
     3058       
     3059        fid = open(vcur_dir_filename1, 'w')
     3060        fid.write(""" ncols             3
     3061 nrows             2
     3062 xllcorner    148.00000
     3063 yllcorner    -38.00000
     3064 cellsize       0.25
     3065 nodata_value   -9999.0
     3066    90.000    60.000    30.0
     3067    10.000    10.000    10.000
     3068""")
     3069        fid.close()
     3070        fid = open(vcur_dir_filename2, 'w')
     3071        fid.write(""" ncols             3
     3072 nrows             2
     3073 xllcorner    148.00000
     3074 yllcorner    -38.00000
     3075 cellsize       0.25
     3076 nodata_value   -9999.0
     3077    90.000    60.000    30.0
     3078    10.000    10.000    10.000
     3079""")
     3080        fid.close()
     3081       
     3082        try:
     3083            asc_csiro2sww(bath_dir,elevation_dir, ucur_dir,
     3084                          vcur_dir, sww_file)
     3085        except:
     3086            #tidy up
     3087            os.remove(bath_dir_filename)
     3088            os.rmdir(bath_dir)
     3089
     3090            os.remove(elevation_dir_filename1)
     3091            os.remove(elevation_dir_filename2)
     3092            os.rmdir(elevation_dir)
     3093        else:
     3094            #tidy up
     3095            os.remove(bath_dir_filename)
     3096            os.rmdir(bath_dir)
     3097
     3098            os.remove(elevation_dir_filename1)
     3099            os.remove(elevation_dir_filename2)
     3100            os.rmdir(elevation_dir)
     3101            raise 'Should raise exception'
     3102       
     3103     
     3104    def test_asc_csiro2sww3(self):
     3105        import tempfile
     3106
     3107        bath_dir = tempfile.mkdtemp()
     3108        bath_dir_filename = bath_dir + os.sep +'ba19940524.000'
     3109        #bath_dir = 'bath_data_manager_test'
     3110        #print "os.getcwd( )",os.getcwd( )
     3111        elevation_dir =  tempfile.mkdtemp()
     3112        #elevation_dir = 'elev_expanded'
     3113        elevation_dir_filename1 = elevation_dir + os.sep +'el19940524.000'
     3114        elevation_dir_filename2 = elevation_dir + os.sep +'el19940524.001'
     3115       
     3116        fid = open(bath_dir_filename, 'w')
     3117        fid.write(""" ncols             3
     3118 nrows             2
     3119 xllcorner    148.00000
     3120 yllcorner    -38.00000
     3121 cellsize       0.25
     3122 nodata_value   -9999.0
     3123    9000.000    -1000.000    3000.0
     3124   -1000.000    9000.000  -1000.000
     3125""")
     3126        fid.close()
     3127       
     3128        fid = open(elevation_dir_filename1, 'w')
     3129        fid.write(""" ncols             3
     3130 nrows             2
     3131 xllcorner    148.00000
     3132 yllcorner    -38.00000
     3133 cellsize       0.25
     3134 nodata_value   -9999.0
     3135    9000.000    0.000    3000.0
     3136     0.000     -9999.000     -9999.000
     3137""")
     3138        fid.close()
     3139
     3140        fid = open(elevation_dir_filename2, 'w')
     3141        fid.write(""" ncols             3
     3142 nrows             2
     3143 xllcorner    148.00000
     3144 yllcorner    -38.00000
     3145 cellsize       0.25
     3146 nodata_value   -9999.0
     3147    9000.000    4000.000    4000.0
     3148    4000.000    9000.000    4000.000
     3149""")
     3150        fid.close()
     3151         
     3152        ucur_dir =  tempfile.mkdtemp()
     3153        ucur_dir_filename1 = ucur_dir + os.sep +'uc19940524.000'
     3154        ucur_dir_filename2 = ucur_dir + os.sep +'uc19940524.001'
     3155       
     3156        fid = open(ucur_dir_filename1, 'w')
     3157        fid.write(""" ncols             3
     3158 nrows             2
     3159 xllcorner    148.00000
     3160 yllcorner    -38.00000
     3161 cellsize       0.25
     3162 nodata_value   -9999.0
     3163    90.000    60.000    30.0
     3164    10.000    10.000    10.000
     3165""")
     3166        fid.close()
     3167        fid = open(ucur_dir_filename2, 'w')
     3168        fid.write(""" ncols             3
     3169 nrows             2
     3170 xllcorner    148.00000
     3171 yllcorner    -38.00000
     3172 cellsize       0.25
     3173 nodata_value   -9999.0
     3174    90.000    60.000    30.0
     3175    10.000    10.000    10.000
     3176""")
     3177        fid.close()
     3178       
     3179        vcur_dir =  tempfile.mkdtemp()
     3180        vcur_dir_filename1 = vcur_dir + os.sep +'vc19940524.000'
     3181        vcur_dir_filename2 = vcur_dir + os.sep +'vc19940524.001'
     3182       
     3183        fid = open(vcur_dir_filename1, 'w')
     3184        fid.write(""" ncols             3
     3185 nrows             2
     3186 xllcorner    148.00000
     3187 yllcorner    -38.00000
     3188 cellsize       0.25
     3189 nodata_value   -9999.0
     3190    90.000    60.000    30.0
     3191    10.000    10.000    10.000
     3192""")
     3193        fid.close()
     3194        fid = open(vcur_dir_filename2, 'w')
     3195        fid.write(""" ncols             3
     3196 nrows             2
     3197 xllcorner    148.00000
     3198 yllcorner    -38.00000
     3199 cellsize       0.25
     3200 nodata_value   -9999.0
     3201    90.000    60.000    30.0
     3202    10.000    10.000    10.000
     3203""")
     3204        fid.close()
     3205       
     3206        sww_file = 'a_test.sww'
     3207        asc_csiro2sww(bath_dir,elevation_dir, ucur_dir, vcur_dir,
     3208                      sww_file, fail_on_NaN = False, elevation_NaN_filler = 0,
     3209                      mean_stage = 100)
     3210
     3211        # check the sww file
     3212       
     3213        fid = NetCDFFile(sww_file, 'r')    #Open existing file for read
     3214        x = fid.variables['x'][:]
     3215        y = fid.variables['y'][:]
     3216        z = fid.variables['z'][:]
     3217        stage = fid.variables['stage'][:]
     3218        xmomentum = fid.variables['xmomentum'][:]
     3219        geo_ref = Geo_reference(NetCDFObject=fid)
     3220        #print "geo_ref",geo_ref
     3221        x_ref = geo_ref.get_xllcorner()
     3222        y_ref = geo_ref.get_yllcorner()
     3223        self.failUnless(geo_ref.get_zone() == 55,  'Failed')
     3224        assert allclose(x_ref, 587798.418) # (-38, 148)
     3225        assert allclose(y_ref, 5793123.477)# (-38, 148.5)
     3226       
     3227        #Zone:   55   
     3228        #Easting:  588095.674  Northing: 5821451.722
     3229        #Latitude:   -37  45 ' 0.00000 ''  Longitude: 148 0 ' 0.00000 ''
     3230        assert allclose((x[0],y[0]), (588095.674 - x_ref, 5821451.722 - y_ref))
     3231
     3232        #Zone:   55   
     3233        #Easting:  632145.632  Northing: 5820863.269
     3234        #Latitude:   -37  45 ' 0.00000 ''  Longitude: 148  30 ' 0.00000 ''
     3235        assert allclose((x[2],y[2]), (632145.632 - x_ref, 5820863.269 - y_ref))
     3236
     3237        #Zone:   55   
     3238        #Easting:  609748.788  Northing: 5793447.860
     3239        #Latitude:   -38  0 ' 0.00000 ''  Longitude: 148  15 ' 0.00000 ''
     3240        assert allclose((x[4],y[4]), (609748.788  - x_ref, 5793447.86 - y_ref))
     3241
     3242        assert allclose(z[0],9000.0 )
     3243        assert allclose(stage[0][4],100.0 )
     3244        assert allclose(stage[0][5],100.0 )
     3245
     3246        #(100.0 - 9000)*10
     3247        assert allclose(xmomentum[0][4], -89000.0 )
     3248       
     3249        #(100.0 - -1000.000)*10
     3250        assert allclose(xmomentum[0][5], 11000.0 )
     3251       
     3252        fid.close()
     3253   
     3254        #tidy up
     3255        os.remove(bath_dir_filename)
     3256        os.rmdir(bath_dir)
     3257
     3258        os.remove(elevation_dir_filename1)
     3259        os.remove(elevation_dir_filename2)
     3260        os.rmdir(elevation_dir)
     3261
     3262
     3263        # remove sww file
     3264        os.remove(sww_file)
     3265   
     3266       
    29163267#-------------------------------------------------------------
    29173268if __name__ == "__main__":
    2918     suite = unittest.makeSuite(Test_Data_Manager,'test_asc_')
    2919     #suite = unittest.makeSuite(Test_Data_Manager,'test')
     3269    #suite = unittest.makeSuite(Test_Data_Manager,'test_asc_')
     3270    suite = unittest.makeSuite(Test_Data_Manager,'test')
    29203271    #suite = unittest.makeSuite(Test_Data_Manager,'xxxtest')
    29213272    #suite = unittest.makeSuite(Test_Data_Manager,'test_sww2dem_boundingbox')   
Note: See TracChangeset for help on using the changeset viewer.