import project, os import sys from anuga.shallow_water.data_manager import sww2dem from anuga.abstract_2d_finite_volumes.util import Screen_Catcher from os import sep #time_dir = '20060928_073318' #alpha = 0.5 time_dir = '20060928_064732' #alpha = 0.01 #time_dir = '20060928_220905' #alpha = 1.0 directory = project.outputdir name = directory + time_dir +sep + 'source' print 'output dir:', name #print 'Which variable do you want to export?' #which_var = int(raw_input('Stage = 0, Absolute Momentum = 1, Depth = 2, Speed = 3 ' )) which_var = 4 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, # would prefer this at 25 # define region for viz purposes 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, #this is because we want max quantityname verbose = True, format = 'asc')