Changeset 6016


Ignore:
Timestamp:
Nov 28, 2008, 11:31:45 AM (16 years ago)
Author:
kristy
Message:

Changed from Maxasc in folder to in Lib

File:
1 edited

Legend:

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

    r5925 r6016  
    1313import project, os
    1414import sys
     15from anuga.lib.maxasc.maxasc import MaxAsc
    1516from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
    1617from anuga.shallow_water.data_manager import sww2dem
    1718from os import sep
    18 import maxasc
     19
    1920
    2021directory = project.output_dir
    2122
    22 #time_dir1 = '20081002_111432_run_final_0_27283_250m_none_kvanputt'
    23 #time_dir1 = '20081002_111258_run_final_0_27283_250m_all_kvanputt'
    24 time_dir1 = '20081031_120642_run_final_0_27283_alpha0.1_kvanputt'
    25 #time_dir3 = '20080815_103818_run_final_0_polyline_newExtent_kvanputt'
     23#time_dir1 = '20081031_133841_run_final_0_27283_alpha0.1_kvanputt'
     24#time_dir1 = '20080924_123626_run_final_0_27283_250m_all_kvanputt' # This uses the 250m bathymetry with all interior polygons
     25#time_dir2 = '20080912_154716_run_final_0_27283_alpha0.1_kvanputt' # This uses original bathyemetry data
     26#time_dir3 = '20080924_123601_run_final_0_27283_250m_none_kvanputt' # This uses the 250m bathymetry without any interior polygons
     27#time_dirs = [time_dir1] #, time_dir2]#, time_dir3]
    2628
    27 time_dirs = [time_dir1]#, time_dir2, time_dir3]
     29time_dir1 = '20081009_184721_run_final_0.6_68693_alpha0.1_kvanputt'
     30time_dir2 = '20081031_120515_run_final_0_27255_alpha0.1_kvanputt'
     31time_dir3 = '20081031_120753_run_final_0.6_27283_alpha0.1_kvanputt'
     32time_dir4 = '20081031_120642_run_final_0_27283_alpha0.1_kvanputt'
     33time_dir5 = '20081031_120316_run_final_0_68693_alpha0.1_kvanputt'
     34time_dir6 = '20081111_113832_run_final_0.6_27255_alpha0.1_kvanputt'
    2835
    29 #cellsize = 20
    30 cellsize = 250
     36time_dirs = [time_dir6] #1, time_dir2, time_dir3, time_dir4, time_dir5]
     37 
     38
     39cellsize = 20
     40#cellsize = 250
    3141
    3242timestep = None    # None means no timestep!
     
    3646# Set the special areas of interest.  If none, do: area='All'
    3747######
    38 #area = ['Geordie', 'Sorrento', 'Fremantle', 'Rockingham']  # strings must match keys in var_equations below
    39 area = ['All']      # 'All' means no special areas - the whole thing
     48
     49area = ['Bunbury', 'Busselton']  # strings must match keys in var_equations below
     50#area = ['All']      # 'All' means no special areas - the whole thing
    4051
    4152######
     
    5061
    5162# one or more key strings from var_equations above
    52 var = ['stage', 'elevation']
     63var = ['depth', 'speed']
    5364
    5465######
    5566# Start running the various conversions we require.
    5667######
     68
    5769for which_var in var:
    5870    if which_var not in var_equations:
     
    6072        break
    6173
    62     asc_name = []
     74    for which_area in area:
     75        if which_area == 'All':
     76            easting_min = None
     77            easting_max = None
     78            northing_min = None
     79            northing_max = None
     80        else:
     81            try:
     82                easting_min = eval('project.xmin%s' % which_area)
     83                easting_max = eval('project.xmax%s' % which_area)
     84                northing_min = eval('project.ymin%s' % which_area)
     85                northing_max = eval('project.ymax%s' % which_area)
     86            except AttributeError:
     87                print 'Unrecognized area name: %s' % which_area
     88                break
    6389
    64     for time_dir in time_dirs:
    65         name1 = directory+time_dir+sep+project.scenario_name
    66         name2 = directory+time_dir+sep+project.scenario_name+'_time_39600_0'
    67         name3 = directory+time_dir+sep+project.scenario_name+'_time_79200_0'
    68         names = [name1, name2, name3]
    69                
    70         for name in names:
    71             for which_area in area:
    72                 if which_area == 'All':
    73                     easting_min = None
    74                     easting_max = None
    75                     northing_min = None
    76                     northing_max = None
    77                 else:
    78                     try:
    79                         easting_min = eval('project.xmin%s' % which_area)
    80                         easting_max = eval('project.xmax%s' % which_area)
    81                         northing_min = eval('project.ymin%s' % which_area)
    82                         northing_max = eval('project.ymax%s' % which_area)
    83                     except AttributeError:
    84                         print 'Unrecognized area name: %s' % which_area
    85                         break
    86                  
     90        for time_dir in time_dirs:
     91
     92            name1 = directory+time_dir+sep+project.scenario_name
     93            name2 = directory+time_dir+sep+project.scenario_name+'_time_39600_0'
     94            name3 = directory+time_dir+sep+project.scenario_name+'_time_79200_0'
     95
     96            names = [name1, name2, name3]
     97     
     98            asc_name = []   
     99               
     100            for name in names:
     101                         
    87102                outname = name + '_' + which_area + '_' + which_var
    88103                quantityname = var_equations[which_var]
     
    103118
    104119                asc_name.append(outname + '.asc')
    105        
    106         maxasc_outname = directory+time_dir+sep+project.scenario_name+'_'+which_area+'_'+which_var+'_max.asc'
    107                
    108         maxasc.MaxAsc(maxasc_outname, asc_name)
     120   
     121            maxasc_outname = directory+time_dir+sep+project.scenario_name+'_'+which_area+'_'+which_var+'_max.asc'
    109122
     123            print 'max asc outname ', maxasc_outname
     124            print 'asc_name ', str(asc_name)
     125           
     126            MaxAsc(maxasc_outname, asc_name)
Note: See TracChangeset for help on using the changeset viewer.