import sys from anuga.shallow_water.data_manager import sww2dem from os import sep, getenv home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent dir name = home + 'anuga_validation/boxing_day_sceanario/anuga/outputs/20080825/good_polyline20080825_130706_0.8' ##output_dir = home + 'anuga_validation/boxing_day_sceanario/anuga/outputs/20080813/good_polyline20080813_' ## ##name1= output_dir +'101348_0.45' ##name2= output_dir +'101521_0.55' ##name3= output_dir +'101610_0.35' ##name4= output_dir +'101741_0.25' ##name5= output_dir +'101819_0.15' ## ##names= [name1, name2, name3, name4, name5] ## ##for the_name in names: ## ## name = the_name[-11:] ## print 'sww filename', name bay_west = 417348.0 bay_east = 425656.0 bay_south = 870565.0 bay_north = 877008.0 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 print 'start sww2dem' sww2dem(name, basename_out = outname, quantity = quantityname, cellsize = 20, easting_min = bay_west, easting_max = bay_east, northing_min = bay_south, northing_max = bay_north, reduction = max, verbose = True, format = 'asc')