Changeset 7365


Ignore:
Timestamp:
Aug 14, 2009, 10:44:35 AM (15 years ago)
Author:
kristy
Message:

updated script with times

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/gold_coast_2009/export_results_max.py

    r7364 r7365  
    2121
    2222directory = project.output_folder
     23time_dir1 = '20090511_165539_run_final_0_50863_lfountai'
     24time_dir2 = '20090714_162041_run_final_0.8_58292_None_kvanputt'
     25time_dir3 = '20090714_161944_run_final_0.8_58280_None_kvanputt'
     26time_dir4 = '20090714_161740_run_final_0.8_58260_None_kvanputt'
    2327
    24 time_dir1 = '20090605_120328_run_final_0_250m_51469_lfountai'
    25 ##time_dir1 = '20090522_164640_run_final_1.1_51392_lfountai'
     28time_dirs = [time_dir1] 
    2629
     30# sww filename extensions ie. hobart_time_17640_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
     36cellsize = 20 #250
    2737
    28 time_dirs = [time_dir1] #, time_dir2] #, time_dir3, time_dir4, time_dir5, time_dir6]   
     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
     41timestep = 0
    2942
    30 cellsize = 250
    31 ##cellsize = 20
     43# Set the special areas of interest.  If none, do: area=['All']
     44# Areas identified below are specified by cooridinates in project.py 
    3245
    33 #timestep = None    # None means no timestep!
    34 timestep = None
     46#area = ['South', 'NW', 'Hobart']
     47area = ['All']     
    3548
    36 ######
    37 # Set the special areas of interest.  If none, do: area='All'
    38 ######
    39 
    40 #area = ['Bunbury', 'Busselton']  # strings must match keys in var_equations below
    41 area = ['All']      # 'All' means no special areas - the whole thing
     49# one or more key strings from var_equations below
     50var = ['elevation']
    4251
    4352######
     
    5160                 'elevation': 'elevation' }
    5261
    53 # one or more key strings from var_equations above
    54 var = ['speed', 'depth']
    5562
    5663######
    57 # Start running the various conversions we require.
     64# Start script, running through variables, area, folder, sww file (determine by times)
     65# Then creates a maximum asci if there is more than one sww file
    5866######
    5967
     
    8088
    8189        for time_dir in time_dirs:
     90            names = [join(directory, time_dir, project.scenario_name)]
     91            for time in times:
     92                names.append(join(directory, time_dir, project.scenario_name)+ '_time_' + str(time) + '_0')
     93           
     94            asc_name = []   
     95            print 'start sww2dem: time_dir = %s' % time_dir               
     96            for name in names:
    8297
    83             name1 = join(directory, time_dir, project.scenario_name)
    84 ##            name2 = join(directory, time_dir, project.scenario_name)+'_time_29220_0'
    85 ##            name3 = join(directory, time_dir, project.scenario_name)+'_time_58440_0'
    86            
    87             names = [name1] #, name2, name3]
    88      
    89             asc_name = []   
    90                
    91             for name in names:
    92                          
    9398                outname = name + '_' + which_area + '_' + which_var
    9499                quantityname = var_equations[which_var]
    95100
    96                 print 'start sww2dem: time_dir=%s' % time_dir
     101                print 'start sww2dem: name = %s' % os.path.basename(name)
    97102               
    98103                sww2dem(name, basename_out = outname,
     
    109114
    110115                asc_name.append(outname + '.asc')
    111    
    112 ##            maxasc_outname = join(directory, time_dir, project.scenario_name)+'_'+which_area+'_'+which_var+'_max.asc'
    113 ##
    114 ##            print 'max asc outname ', maxasc_outname
    115 ##            print 'asc_name ', str(asc_name)
    116 ##           
    117 ##            MaxAsc(maxasc_outname, asc_name)
     116            #print 'list = %s' % asc_name
     117            #print 'max asc outname ', maxasc_outname
     118            #print 'name=%s' % name
     119            print 'which area=%s' % which_area
     120            print 'which var=%s' % which_var
     121            #print 'asc_name ', str(asc_name)
     122            if len(names) >1:
     123                maxasc_outname = join(directory, time_dir, project.scenario_name)+'_'+which_area+'_'+which_var+'_max.asc'
     124
     125                print 'max asc outname ', maxasc_outname
     126                print 'asc_name ', str(asc_name)
     127               
     128                MaxAsc(maxasc_outname, asc_name)
     129            else:
     130                print 'Only one sww file, no Max file required'
     131
Note: See TracChangeset for help on using the changeset viewer.