Changeset 6064


Ignore:
Timestamp:
Dec 11, 2008, 4:10:54 PM (16 years ago)
Author:
kristy
Message:

general maintenance

Location:
anuga_work/production/carnarvon
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/carnarvon/build_carnarvon.py

    r6024 r6064  
    103103G_off = G_off1 + G_off2
    104104
    105 print 'clipping data to coast'
    106 G_ocean = G_off.clip(project.poly_ocean, verbose=True) #mainland
    107 G_ocean_b = G_ocean.clip_outside(project.poly_island1, verbose=True) #bernier
    108 G_ocean_bd = G_ocean_b.clip_outside(project.poly_island2, verbose=True) #dorne
    109 
    110 G1_clip_m = G1.clip(project.poly_mainland, verbose=True)
    111 G1_clip_b = G1.clip(project.poly_island1, verbose=True)
    112 G1_clip_d = G1.clip(project.poly_island2, verbose=True)
     105##print 'clipping data to coast'
     106##G_ocean = G_off.clip(project.poly_ocean, verbose=True) #mainland
     107##G_ocean_b = G_ocean.clip_outside(project.poly_island1, verbose=True) #bernier
     108##G_ocean_bd = G_ocean_b.clip_outside(project.poly_island2, verbose=True) #dorne
     109##
     110##G1_clip_m = G1.clip(project.poly_mainland, verbose=True)
     111##G1_clip_b = G1.clip(project.poly_island1, verbose=True)
     112##G1_clip_d = G1.clip(project.poly_island2, verbose=True)
     113##G1_clip = G1_clip_m + G1_clip_b + G1_clip_d
    113114
    114115print'add all geospatial objects'
    115 G_aos = G1_clip_m+ G1_clip_b+G1_clip_d+ G_coast + G_ocean_bd
     116G_aos = G1 + G_off
    116117G_aosclip = G_aos.clip_outside(project.poly_aos_extract, verbose=True)
    117118G_aoi = G_aosclip.clip_outside(project.poly_aoi1, verbose=True)
    118 G = G_aoi +Goffaoi+Goffaos
     119G = G_aoi +G_offaoi+G_offaos
    119120
    120121print'export combined DEM file'
  • anuga_work/production/carnarvon/export_results_max.py

    r5996 r6064  
    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
    1919
    2020directory = project.output_dir
    2121
    22 time_dir1 = '20081110_105300_run_final_0_27283_alpha0.1_kvanputt'
    23 time_dir2 = '20081002_111207_run_final_0_27283_250m_all_kvanputt'
    24 time_dir3 = '20081002_111053_run_final_0_27283_250m_none_kvanputt'
     22##time_dir1 = '20081209_155247_run_final_0_27255_250m_none_lfountai'
     23##time_dir2 = '20081209_161626_run_final_0_68693_250m_none_lfountai'
     24##time_dirs = [time_dir1, time_dir2]
    2525
    26 time_dirs = [time_dir1, time_dir2, time_dir3]
     26##time_dir1 = '20081202_084220_run_final_1_27283_alpha0.1_kvanputt'
     27##time_dir2 = '20081202_084202_run_final_1_27255_alpha0.1_kvanputt'
     28##time_dir3 = '20081202_084132_run_final_1_68693_alpha0.1_kvanputt'
     29time_dir4 = '20081202_084025_run_final_0_68693_alpha0.1_kvanputt'
     30time_dir5 = '20081202_083932_run_final_0_27255_alpha0.1_kvanputt'
     31##time_dir6 = '20081201_103449_run_final_0_27283_alpha0.1_kvanputt'
     32
     33time_dirs = [time_dir4, time_dir5] #, time_dir3, time_dir4, time_dir5, time_dir6]
     34 
    2735
    2836#cellsize = 20
     
    3644######
    3745
    38 #area = ['Geordie', 'Sorrento', 'Fremantle', 'Rockingham']  # strings must match keys in var_equations below
     46#area = ['CBD']  # strings must match keys in var_equations below
    3947area = ['All']      # 'All' means no special areas - the whole thing
    4048
     
    5058
    5159# one or more key strings from var_equations above
    52 var = ['stage', 'elevation']
     60var = ['stage']
    5361
    5462######
    5563# Start running the various conversions we require.
    5664######
     65
    5766for which_var in var:
    5867    if which_var not in var_equations:
     
    6069        break
    6170
    62     asc_name = []
     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
    6386
    64     for time_dir in time_dirs:
    65         if time_dir == '20081002_111053_run_final_0_27283_250m_none_kvanputt':
     87        for time_dir in time_dirs:
     88
    6689            name1 = directory+time_dir+sep+project.scenario_name
    67             name2 = directory+time_dir+sep+project.scenario_name+'_time_77160_0'
    68             names = [name1, name2]
    69         else:
    70             name1 = directory+time_dir+sep+project.scenario_name
    71             name2 = directory+time_dir+sep+project.scenario_name+'_time_39540_0'
    72             name3 = directory+time_dir+sep+project.scenario_name+'_time_79080_0'
    73             names = [name1, name2, name3]     
    74        
    75         for name in names:
    76             for which_area in area:
    77                 if which_area == 'All':
    78                     easting_min = None
    79                     easting_max = None
    80                     northing_min = None
    81                     northing_max = None
    82                 else:
    83                     try:
    84                         easting_min = eval('project.xmin%s' % which_area)
    85                         easting_max = eval('project.xmax%s' % which_area)
    86                         northing_min = eval('project.ymin%s' % which_area)
    87                         northing_max = eval('project.ymax%s' % which_area)
    88                     except AttributeError:
    89                         print 'Unrecognized area name: %s' % which_area
    90                         break
    91                  
     90##            name2 = directory+time_dir+sep+project.scenario_name+'_time_77160_0'
     91
     92            name2 = directory+time_dir+sep+project.scenario_name+'_time_39300_0'
     93            name3 = directory+time_dir+sep+project.scenario_name+'_time_78600_0'
     94
     95            names = [name1, name2, name3]
     96     
     97            asc_name = []   
     98               
     99            for name in names:
     100                         
    92101                outname = name + '_' + which_area + '_' + which_var
    93102                quantityname = var_equations[which_var]
     
    109118                asc_name.append(outname + '.asc')
    110119   
    111         maxasc_outname = directory+time_dir+sep+project.scenario_name+'_'+which_area+'_'+which_var+'_max.asc'
     120            maxasc_outname = directory+time_dir+sep+project.scenario_name+'_'+which_area+'_'+which_var+'_max.asc'
    112121
    113         maxasc.MaxAsc(maxasc_outname, asc_name)
    114 
    115 
     122            print 'max asc outname ', maxasc_outname
     123            print 'asc_name ', str(asc_name)
     124           
     125            MaxAsc(maxasc_outname, asc_name)
  • anuga_work/production/carnarvon/project.py

    r6021 r6064  
    4343# Model specific parameters. One or all can be changed each time the
    4444# run_scenario script is executed
    45 tide = 0                #0.6
     45tide = 1                #1.0
    4646#event_number = 27255 # Java 9.3 worst case for Perth
    4747#event_number = 68693 # Sumatra 9.2
     
    9696gauge_name = 'carnarvon.csv'
    9797gauge_name2 = 'thinned_MGA50.csv'
     98#buildings - used in run_building_inundation.py
     99building = 'carnarvon_res'
    98100
    99101# BOUNDING POLYGON - used in build_boundary.py and run_carnarvon.py respectively
     
    110112# Output filename for elevation
    111113# this is a combination of all the data (utilisied in build_boundary)
    112 combined_name ='carnarvon_combined_elevation'
     114combined_name ='carnarvon_combined_elevation_quick'
    113115combined_smaller_name = 'carnarvon_combined_elevation_smaller'
    114116
     
    168170gauges_dir_name = gauges_dir + gauge_name       #used for get_timeseries.py
    169171gauges_dir_name2 = gauges_dir + gauge_name2     #used for get_timeseries.py
    170 
     172building_in_dir_name = gauges_dir + building + '.csv'
    171173#------------------------------------------------------------------------------
    172174# Interior region definitions
     
    215217
    216218# carnarvon CBD extract ascii grid
    217 ##xminCBD =
    218 ##xmaxCBD =
    219 ##yminCBD =
    220 ##ymaxCBD =
     219xminCBD = 763000
     220xmaxCBD = 775000
     221yminCBD = 7239000
     222ymaxCBD = 7251000
Note: See TracChangeset for help on using the changeset viewer.