Changeset 6217


Ignore:
Timestamp:
Jan 20, 2009, 2:04:09 PM (10 years ago)
Author:
kristy
Message:

updated scripts, new poly_all (no land)

Location:
anuga_work/production/australia_ph2/dampier
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/australia_ph2/dampier/export_results_max.py

    r6204 r6217  
    2020directory = project_250m.output_dir
    2121
    22 ##time_dir1 = '20090115_151520_run_final_0_250m_kvanputt'
    23 time_dir2 = '20090115_164756_run_final_0_250m_small_kvanputt'
    24 time_dirs = [time_dir2]   
     22time_dir1 = '20090115_151520_run_final_0_250m_kvanputt'
     23##time_dir2 = '20090115_164756_run_final_0_250m_small_kvanputt'
     24time_dirs = [time_dir1]   
    2525
    2626#cellsize = 5
     
    3434######
    3535
    36 #area = ['Sorrento', 'Geordie' ]  # strings must match keys in var_equations below
    3736area = ['All']      # 'All' means no special areas - the whole thing
    3837
     
    7877
    7978            name1 = directory+time_dir+sep+project_250m.scenario_name
    80 ##            name2 = directory+time_dir+sep+project_250m.scenario_name+'_time_39900_0'
    81 ##            name3 = directory+time_dir+sep+project_250m.scenario_name+'_time_79800_0'
     79            name2 = directory+time_dir+sep+project_250m.scenario_name+'_time_16200_0'
     80            name3 = directory+time_dir+sep+project_250m.scenario_name+'_time_32400_0'
     81            name4 = directory+time_dir+sep+project_250m.scenario_name+'_time_48600_0'
     82            name5 = directory+time_dir+sep+project_250m.scenario_name+'_time_64800_0'
    8283
    83             names = [name1] #, name2, name3]
     84            names = [name1, name2, name3, name4, name5]
    8485     
    85 ##            asc_name = []   
     86            asc_name = []   
    8687               
    8788            for name in names:
     
    104105                            format = 'asc')
    105106
    106 ##                asc_name.append(outname + '.asc')
    107 ##   
    108 ##            maxasc_outname = directory+time_dir+sep+project_250m_250m.scenario_name+'_'+which_area+'_'+which_var+'_max.asc'
    109 ##
    110 ##            print 'max asc outname ', maxasc_outname
    111 ##            print 'asc_name ', str(asc_name)
    112 ##           
    113 ##            MaxAsc(maxasc_outname, asc_name)
     107                asc_name.append(outname + '.asc')
     108   
     109            maxasc_outname = directory+time_dir+sep+project_250m.scenario_name+'_'+which_area+'_'+which_var+'_max.asc'
     110            print 'max asc outname ', maxasc_outname
     111            print 'asc_name ', str(asc_name)
     112           
     113            MaxAsc(maxasc_outname, asc_name)
  • anuga_work/production/australia_ph2/dampier/get_timeseries.py

    r6204 r6217  
    22Generate time series of nominated "gauges".
    33Input: sww file from run_perth.py
    4        gauges project.gauge_filename
     4       gauges project_250m.gauge_filename
    55Output: csv files stage,speed,depth,elevation over time
    66Stored in the 'outputs_dir' folder for respective .sww file
     
    1414from os import sep, rename, listdir, system
    1515from anuga.abstract_2d_finite_volumes.util import sww2csv_gauges,csv2timeseries_graphs
    16 import project
     16import project_250m
    1717
    18 directory = project.output_dir
     18directory = project_250m.output_dir
    1919
    20 time_dir1 = '20081031_133353_run_final_0.6_68693_alpha0.1_kvanputt'+sep+'gauge'
    21 time_dir2 = '20081031_133511_run_final_0_68693_alpha0.1_kvanputt'+sep+'gauge'
    22 time_dir3 = '20081031_133624_run_final_0_27255_alpha0.1_kvanputt'+sep+'gauge'
    23 time_dir4 = '20081031_133735_run_final_0.6_27255_alpha0.1_kvanputt'+sep+'gauge'
    24 time_dir5 = '20081031_133841_run_final_0_27283_alpha0.1_kvanputt'+sep+'gauge'
    25 time_dir6 = '20081031_133925_run_final_0.6_27283_alpha0.1_kvanputt'+sep+'gauge'
     20time_dir1 = '20090115_151520_run_final_0_250m_kvanputt'
     21time_dir2 = '20090115_164756_run_final_0_250m_small_kvanputt'
    2622
    27 time_dirs = [time_dir1, time_dir2, time_dir3, time_dir4, time_dir5, time_dir6]
     23time_dirs = [time_dir1, time_dir2]
    2824
    2925for time_dir in time_dirs:
    30     name = directory+time_dir+sep+project.scenario_name
    31     gauge = project.gauges_dir_name
     26    name = directory+time_dir+sep+project_250m.scenario_name
     27    gauge = project_250m.gauges_dir_name
    3228    sww2csv_gauges(name+'.sww',gauge,
    3329                   quantities = ['stage','speed','depth','elevation'],
     
    3531
    3632   
    37 ##    name1 = directory+time_dir+sep+project.scenario_name
    38 ####    name2 = directory+time_dir+sep+project.scenario_name+'_time_43380_0'
    39 ####    name3 = directory+time_dir+sep+project.scenario_name+'_time_78360_0'
     33##    name1 = directory+time_dir+sep+project_250m.scenario_name
     34####    name2 = directory+time_dir+sep+project_250m.scenario_name+'_time_43380_0'
     35####    name3 = directory+time_dir+sep+project_250m.scenario_name+'_time_78360_0'
    4036##
    4137##    names = [name1]#, name2, name3]
    4238##
    4339##    for i, name in enumerate(names):
    44 ##        gauge = project.gauges_dir_name
     40##        gauge = project_250m.gauges_dir_name
    4541####        out_name = 'gauge_%d_' % i
    4642##        print name
  • anuga_work/production/australia_ph2/dampier/project_250m.py

    r6204 r6217  
    4040scenario_name = 'dampier_ph2'
    4141scenario = 'dampier'
     42area = 'large_b10' #'small_b10'
    4243
    4344# Model specific parameters. One or all can be changed each time the
     
    7576# Important to distinguish each run - ensure str(user) is included!
    7677# Note, the user is free to include as many parameters as desired
    77 dir_comment='_'+setup+'_'+str(tide)+'_250m_small_'+str(user)
     78dir_comment='_'+setup+'_'+str(tide)+'_250m_' + str(area)+'_'+str(user)
    7879
    7980#------------------------------------------------------------------------------
     
    8687
    8788# gauges - used in get_timeseries.py
    88 #gauge_name = 'perth.csv'
     89gauge_name = 'gauges.csv'
    8990
    9091# BOUNDING POLYGON - used in build_boundary.py and run_perth.py respectively
     
    101102# Output filename for elevation
    102103# this is a combination of all the data (utilisied in build_boundary)
    103 combined_name = scenario_name + '_combined_elevation_250m_small'
     104combined_name = scenario_name + '_combined_elevation_250m_' + area
    104105
    105106#------------------------------------------------------------------------------
     
    129130
    130131# where the mesh sits (this is created during the run_perth.py)
    131 meshes_dir_name = meshes_dir + scenario_name+ '_small.msh'
     132meshes_dir_name = meshes_dir + scenario_name+ '_' + area + '.msh'
    132133
    133134# where the boundary ordering files sit (this is used within build_boundary.py)
     
    146147output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
    147148
    148 #w here the directory of the gauges sit
    149 ##gauges_dir_name = gauges_dir + gauge_name       #used for get_timeseries.py
     149# where the directory of the gauges sit
     150gauges_dir_name = gauges_dir + gauge_name       #used for get_timeseries.py
    150151##gauges_dir_name2 = gauges_dir + gauge_name2     #used for get_timeseries.py
    151152
     
    154155#------------------------------------------------------------------------------
    155156
    156 #Land, to set the initial stage/water to be offcoast only
    157 poly_mainland = read_polygon(polygons_dir+'initial_condition_small.csv')
    158 
    159157# Initial bounding polygon for data clipping
    160 poly_all = read_polygon(polygons_dir+'poly_all_small.csv')
     158poly_all = read_polygon(polygons_dir+'poly_all_' +area + '.csv')
    161159res_poly_all = 125000*res_factor
    162160
  • anuga_work/production/australia_ph2/dampier/run_dampier_ph2_250m.py

    r6204 r6217  
    9696##    boundary_tags={'back': [N+1,N+2,N+3], 'side': [N,N+4], 'ocean': range(N)}
    9797
    98 ##    land = range (0,11)
    99 ##    sea = range (12,122)
    100 ##    bounding_polygon = project_250m.poly_all
    101 ##    boundary_tags={'back': land, 'side': [11,122], 'ocean': sea}
    102    
    103     sea = range (4,22)
    104     bounding_polygon = project_250m.poly_all
    105     boundary_tags={'back': [0,1,2,23], 'side': [3,22], 'ocean': sea}
     98    if project_250m.area =='large_b10':
     99        land = range (0,516)
     100        sea = range (516,626)
     101        bounding_polygon = project_250m.poly_all
     102        boundary_tags={'back': land, 'ocean': sea}
     103    elif project_250m.area =='small_b10':
     104        land = range (0,276)
     105        sea = range (276,294)
     106        bounding_polygon = project_250m.poly_all
     107        boundary_tags={'back': land, 'ocean': sea}
     108    else:
     109        print 'area not defined therefore bondary_tags not defined'
    106110
    107111    #--------------------------------------------------------------------------
     
    144148
    145149    # sets the initial stage in the offcoast region only
    146     IC = Polygon_function( [(project_250m.poly_mainland, 0)], default = kwargs['tide'],
    147                              geo_reference = domain.geo_reference)
    148     domain.set_quantity('stage', IC)
     150##    IC = Polygon_function( [(project_250m.poly_mainland, 0)], default = kwargs['tide'],
     151##                             geo_reference = domain.geo_reference)
     152    domain.set_quantity('stage', 0)
    149153    #domain.set_quantity('stage',kwargs['tide'] )
    150154    domain.set_quantity('friction', kwargs['friction'])
     
    200204    Rb = Time_boundary (domain, f=lambda t: [(sin(t*pi/600) * exp(-(t/3600)**2)), 0.0, 0.0])   
    201205
    202     domain.set_boundary({'back': Br,
    203                          'side': Bt,
     206    domain.set_boundary({'back': Bt,
    204207                         'ocean': Rb})
    205208
Note: See TracChangeset for help on using the changeset viewer.