import project, os from pyvolution.data_manager import sww2dem from pyvolution.ermapper_grids import read_ermapper_grid name = project.outputname #print 'Which variable do you want to export?' #which_var = int(raw_input('Stage = 0, Absolute Momentum = 1, Depth = 2, Speed = 3 ' )) 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/(stage-elevation))**2 + (ymomentum/(stage-elevation))**2)**0.5' #Speed #quantityname = 'xmomentum/(stage-elevation)' #Speed quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)' #Speed sww2dem(name, basename_out = outname, quantity = quantityname, cellsize = 25, # Trevor would like this at 25 # define region for viz purposes easting_min = project.eminviz, easting_max = project.emaxviz, northing_min = project.nminviz, northing_max = project.nmaxviz, reduction = max, #this is because we want max quantityname verbose = True, format = 'asc') #Check #data = read_ermapper_grid(name) #print 'Values from %s are in [%f, %f]' %(name, min(data.flat), max(data.flat))