import project, os import sys from anuga.shallow_water.data_manager import sww2dem from anuga.abstract_2d_finite_volumes.util import start_screen_catcher from os import sep scenario = 'slide' #scenario = 'fixed_wave' name = scenario + sep + scenario + 'source' print 'output dir:', name which_var = 2 if which_var == 0: # Stage outname = name + '_stage' quantityname = 'stage' if which_var == 1: # Absolute Momentum outname = name + '_momentum' quantityname = '(xmomentum**2 + ymomentum**2)**0.5' #Absolute momentum if which_var == 2: # Depth outname = name + '_depth' quantityname = 'stage-elevation' #Depth if which_var == 3: # Speed outname = name + '_speed' quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)' #Speed if which_var == 4: # Elevation outname = name + '_elevation' quantityname = 'elevation' #Elevation print 'start sww2dem' sww2dem(name, basename_out = outname, quantity = quantityname, cellsize = 100, easting_min = project.eastingmin, easting_max = project.eastingmax, northing_min = project.northingmin, northing_max = project.northingmax, reduction = max, verbose = True, format = 'asc')