Changeset 7351


Ignore:
Timestamp:
Aug 11, 2009, 9:03:37 AM (15 years ago)
Author:
jgriffin
Message:
 
Location:
anuga_work/production/new_south_wales
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/new_south_wales/batemans_bay/export_results_max.py

    r7327 r7351  
    2424#Specify output directories
    2525time_dir1 = '20090529_143527_run_final_0.0_51424_jgriffin'
    26 #time_dir2 = '20090529_143458_run_final_0.0_58346_jgriffin'
     26time_dir2 = '20090529_143458_run_final_0.0_58346_jgriffin'
    2727
    28 time_dirs = [time_dir1]#, time_dir2]   
     28time_dirs = [time_dir1, time_dir2]   
    2929
     30# sww filename extensions ie. batemans_bay_time_37860_0.sww, input into list 17640
     31# make sure numbers are in sequential order
     32times = [37860]
     33
     34#Modify the cellsize value to set the size of the raster you require
     35#Take into account mesh size when aplying this paramater
    3036cellsize = 20   #dependent on data resolution in area of interest.
    3137
     38#Now set the timestep at which you want the raster generated.
     39#Either set the actual timestep required or use 'None' to indicate that
     40#you want the maximum values in the raster over all timesteps
    3241timestep = None    # None means no timestep!
    3342##timestep = 0
     
    5463var = ['elevation']
    5564######
    56 # Start running the various conversions we require.
     65# Start script, running through variables, area, folder, sww file (determine by times)
     66# Then creates a maximum asci if there is more than one sww file
    5767######
    5868
     
    7989
    8090        for time_dir in time_dirs:
    81 
    82             name1 = join(directory, time_dir, project.scenario_name)
    83             name2 = join(directory, time_dir, project.scenario_name)+'_time_37860_0'
    84 
    85            
    86 
    87             names = [name1, name2]
     91            names = [join(directory, time_dir, project.scenario_name)]
     92            for time in times:
     93                names.append(join(directory, time_dir, project.scenario_name)+ '_time_' + str(time) + '_0')
    8894     
    8995            asc_name = []   
     
    110116                asc_name.append(outname + '.asc')
    111117   
    112             maxasc_outname = join(directory, time_dir, project.scenario_name)+'_'+which_area+'_'+which_var+'_max.asc'
     118            if len(names) >1:
     119                maxasc_outname = join(directory, time_dir, project.scenario_name)+'_'+which_area+'_'+which_var+'_max.asc'
    113120
    114             print 'max asc outname ', maxasc_outname
    115             print 'asc_name ', str(asc_name)
     121                print 'max asc outname ', maxasc_outname
     122                print 'asc_name ', str(asc_name)
    116123           
    117             MaxAsc(maxasc_outname, asc_name)
     124                MaxAsc(maxasc_outname, asc_name)
     125            else:
     126                print 'only one sww input'
  • anuga_work/production/new_south_wales/gosford/export_results_max.py

    r7327 r7351  
    2323
    2424#Specify output directories
    25 time_dir1 = '20090615_161420_run_final_0.0_58025_jgriffin'
    26 #time_dir2 = '20090615_161318_run_final_0.0_58187_jgriffin'
     25time_dir1 = '20090529_143527_run_final_0.0_51424_jgriffin'
     26time_dir2 = '20090529_143458_run_final_0.0_58346_jgriffin'
    2727
    28 time_dirs = [time_dir1]#, time_dir2]
    29  
     28time_dirs = [time_dir1, time_dir2]   
    3029
     30# sww filename extensions ie. batemans_bay_time_37860_0.sww, input into list 17640
     31# make sure numbers are in sequential order
     32times = []
     33
     34#Modify the cellsize value to set the size of the raster you require
     35#Take into account mesh size when aplying this paramater
    3136cellsize = 20   #dependent on data resolution in area of interest.
    3237
     38#Now set the timestep at which you want the raster generated.
     39#Either set the actual timestep required or use 'None' to indicate that
     40#you want the maximum values in the raster over all timesteps
    3341timestep = None    # None means no timestep!
    3442##timestep = 0
     
    5260
    5361# one or more key strings from var_equations above
     62#var = ['depth', 'speed','stage']
    5463var = ['elevation']
    55 #var = ['depth', 'speed', 'stage']
    5664######
    57 # Start running the various conversions we require.
     65# Start script, running through variables, area, folder, sww file (determine by times)
     66# Then creates a maximum asci if there is more than one sww file
    5867######
    5968
     
    8089
    8190        for time_dir in time_dirs:
    82 
    83             name1 = join(directory, time_dir, project.scenario_name)
    84            
    85             names = [name1]
     91            names = [join(directory, time_dir, project.scenario_name)]
     92            for time in times:
     93                names.append(join(directory, time_dir, project.scenario_name)+ '_time_' + str(time) + '_0')
    8694     
    8795            asc_name = []   
     
    108116                asc_name.append(outname + '.asc')
    109117   
    110             maxasc_outname = join(directory, time_dir, project.scenario_name)+'_'+which_area+'_'+which_var+'_max.asc'
     118            if len(names) >1:
     119                maxasc_outname = join(directory, time_dir, project.scenario_name)+'_'+which_area+'_'+which_var+'_max.asc'
    111120
    112             print 'max asc outname ', maxasc_outname
    113             print 'asc_name ', str(asc_name)
     121                print 'max asc outname ', maxasc_outname
     122                print 'asc_name ', str(asc_name)
    114123           
    115             MaxAsc(maxasc_outname, asc_name)
     124                MaxAsc(maxasc_outname, asc_name)
     125            else:
     126                print 'only one sww input'
Note: See TracChangeset for help on using the changeset viewer.