import project_slide, os import sys from anuga.shallow_water.data_manager import sww2dem from os import sep #time_dir = '20061211_071516' #bulli #time_dir = '20061212_012705' #shovel #time_dir = '20061212_064807' #yacaaba # correct depths #time_dir = '20070121_213509' #shovel #time_dir = '20070119_055222' #yacaaba #time_dir = '20070121_213444' #bulli #corrected yacaaba and birubi #time_dir = '20070322_035214' # yacaaba time_dir = '20070322_035135' # birubi directory = project_slide.outputdir name = directory + time_dir + sep + project_slide.basename #name = 'test500000.035000' #name = 'test' is_parallel = False if is_parallel == True: nodes = 4 print 'output dir:', name which_var = 2 if which_var == 0: # Stage outname = name + '_stage-eq-thurs-test' quantityname = 'stage' if which_var == 1: # Absolute Momentum outname = name + '_momentum_i1' quantityname = '(xmomentum**2 + ymomentum**2)**0.5' if which_var == 2: # Depth outname = name + '_depth' quantityname = 'stage-elevation' if which_var == 3: # Speed outname = name + '_speed_i0' quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))' #Speed if which_var == 4: # Elevation outname = name + '_elevation' quantityname = 'elevation' #Elevation if is_parallel == True: for i in range(0,nodes): namei = name + '_P%d_%d' %(i,nodes) outnamei = outname + '_P%d_%d' %(i,nodes) print 'start sww2dem for sww file %d' %(i) sww2dem(namei, basename_out = outnamei, quantity = quantityname, timestep = 1, cellsize = 100, #easting_min = project.e_min_area, #easting_max = project.e_max_area, #northing_min = project.n_min_area, #northing_max = project.n_max_area, reduction = max, verbose = True, format = 'asc') else: print 'start sww2dem' sww2dem(name, basename_out = outname, quantity = quantityname, timestep = 0, cellsize = 50, easting_min = project_slide.eastingmin, easting_max = project_slide.eastingmax, northing_min = project_slide.northingmin, northing_max = project_slide.northingmax, reduction = max, verbose = True, format = 'asc')