Changeset 4533 for anuga_work


Ignore:
Timestamp:
Jun 5, 2007, 1:39:30 PM (17 years ago)
Author:
nick
Message:

update to WA model scripts

Location:
anuga_work/production
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/broome_2006/build_broome.py

    r4429 r4533  
    22
    33Source data such as elevation and boundary data is assumed to be available in
    4 directories specified by project.py
    5 The output sww file is stored in project.output_time_dir
     4directories specified by project_urs.py
     5The output sww file is stored in project_urs.output_time_dir
    66
    7 The scenario is defined by a triangular mesh created from project.polygon,
     7The scenario is defined by a triangular mesh created from project_urs.polygon,
    88the elevation data and a simulated submarine landslide.
    99
     
    2727from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
    2828from anuga.geospatial_data.geospatial_data import *
    29 from anuga.abstract_2d_finite_volumes.util import start_screen_catcher, copy_code_files
     29from anuga.shallow_water.data_manager import start_screen_catcher, copy_code_files
     30from anuga_parallel.parallel_abstraction import get_processor_name
    3031
    3132# Application specific imports
    32 import project   # Definition of file names and polygons
     33import project_urs   # Definition of file names and polygons
    3334
    3435#------------------------------------------------------------------------------
     
    3738#------------------------------------------------------------------------------
    3839
    39 copy_code_files(project.output_build_time_dir,__file__,
    40                dirname(project.__file__)+sep+ project.__name__+'.py' )
     40copy_code_files(project_urs.output_build_time_dir,__file__,
     41               dirname(project_urs.__file__)+sep+ project_urs.__name__+'.py' )
    4142
    42 start_screen_catcher(project.output_build_time_dir)
     43start_screen_catcher(project_urs.output_build_time_dir)
    4344
    44 print 'USER:    ', project.user
     45print 'USER:    ', project_urs.user
    4546
    4647#-------------------------------------------------------------------------------
     
    5152# Fine pts file to be clipped to area of interest
    5253#-------------------------------------------------------------------------------
    53 print"project.combined_dir_name",project.combined_dir_name
     54print"project_urs.combined_dir_name",project_urs.combined_dir_name
    5455
    5556# topography directory filenames
    56 onshore_in_dir_name = project.onshore_in_dir_name
    57 coast_in_dir_name = project.coast_in_dir_name
    58 #island_in_dir_name = project.island_in_dir_name
    59 offshore_in_dir_name = project.offshore_in_dir_name
    60 offshore_in_dir_name1 = project.offshore_in_dir_name1
    61 offshore_in_dir_name2 = project.offshore_in_dir_name2
     57onshore_in_dir_name = project_urs.onshore_in_dir_name
     58coast_in_dir_name = project_urs.coast_in_dir_name
     59#island_in_dir_name = project_urs.island_in_dir_name
     60offshore_in_dir_name = project_urs.offshore_in_dir_name
     61offshore_in_dir_name1 = project_urs.offshore_in_dir_name1
     62offshore_in_dir_name2 = project_urs.offshore_in_dir_name2
    6263
    63 onshore_dir_name = project.onshore_dir_name
    64 coast_dir_name = project.coast_dir_name
    65 #island_dir_name = project.island_dir_name
    66 offshore_dir_name = project.offshore_dir_name
    67 offshore_dir_name1 = project.offshore_dir_name1
    68 offshore_dir_name2 = project.offshore_dir_name2
     64onshore_dir_name = project_urs.onshore_dir_name
     65coast_dir_name = project_urs.coast_dir_name
     66#island_dir_name = project_urs.island_dir_name
     67offshore_dir_name = project_urs.offshore_dir_name
     68offshore_dir_name1 = project_urs.offshore_dir_name1
     69offshore_dir_name2 = project_urs.offshore_dir_name2
    6970'''
    7071# creates DEM from asc data
     
    101102
    102103print'clip combined geospatial object by bounding polygon'
    103 G_clipped = G.clip(project.poly_all)
     104G_clipped = G.clip(project_urs.poly_all)
    104105#FIXME: add a clip function to pts
    105106#print'shape of clipped data', G_clipped.get_data_points().shape
    106107
    107108print'export combined DEM file'
    108 if access(project.topographies_dir,F_OK) == 0:
    109     mkdir (project.topographies_dir)
    110 print'export',project.combined_dir_name+'_unclipped' + '.txt'
    111 G.export_points_file(project.combined_dir_name+'_unclipped' + '.txt')
     109if access(project_urs.topographies_dir,F_OK) == 0:
     110    mkdir (project_urs.topographies_dir)
     111print'export',project_urs.combined_dir_name+'_unclipped' + '.txt'
     112G.export_points_file(project_urs.combined_dir_name+'_unclipped' + '.txt')
    112113
    113114print'split'
     
    115116
    116117
    117 print 'export',project.combined_dir_name + '.txt'
    118 G_clipped.export_points_file(project.combined_dir_name + '.txt')
    119 print 'export', project.combined_small_dir_name + '.txt'
    120 G_small.export_points_file(project.combined_small_dir_name + '.txt')
    121 #G_clipped.export_points_file(project.combined_dir_name + '.xya')
     118print 'export',project_urs.combined_dir_name + '.txt'
     119G_clipped.export_points_file(project_urs.combined_dir_name + '.txt')
     120print 'export', project_urs.combined_small_dir_name + '.txt'
     121G_small.export_points_file(project_urs.combined_small_dir_name + '.txt')
     122#G_clipped.export_points_file(project_urs.combined_dir_name + '.xya')
    122123
    123124
    124125
    125 print'project.combined_dir_name + 1.xya',project.combined_dir_name + '1.xya'
    126 G_all=Geospatial_data(file_name = project.combined_dir_name + '1.xya')
     126print'project_urs.combined_dir_name + 1.xya',project_urs.combined_dir_name + '1.xya'
     127G_all=Geospatial_data(file_name = project_urs.combined_dir_name + '1.xya')
    127128print'split'
    128129G_all_1, G_all_2 = G_all.split(.10)
    129130print'export 1'
    130 G_all_1.export_points_file(project.combined_dir_name+'_small1' + '.xya')
     131G_all_1.export_points_file(project_urs.combined_dir_name+'_small1' + '.xya')
    131132print'export 2'
    132 G_all_2.export_points_file(project.combined_dir_name+'_other1' + '.xya')
     133G_all_2.export_points_file(project_urs.combined_dir_name+'_other1' + '.xya')
    133134
    134135'''
     
    137138#-------------------------------------------------------------------------
    138139print 'starting to create boundary conditions'
    139 boundaries_in_dir_name = project.boundaries_in_dir_name
    140 
    141140from anuga.shallow_water.data_manager import urs2sww, urs_ungridded2sww
    142141
    143 print 'boundaries_in_dir_name',boundaries_in_dir_name
    144 print 'project.boundaries_dir_name',project.boundaries_dir_name
     142print 'boundaries_in_dir_name',project_urs.boundaries_in_dir_name
    145143
    146 urs_ungridded2sww(boundaries_in_dir_name, project.boundaries_dir_name,
     144urs_ungridded2sww(project_urs.boundaries_in_dir_name, project_urs.boundaries_in_dir_name,
    147145                  verbose=True, mint=4000, maxt=35000, zscale=1)
    148146
  • anuga_work/production/broome_2006/project_urs.py

    r4477 r4533  
    1818host = get_host_name()
    1919#needed when running using mpirun, mpirun doesn't inherit umask from .bashrc
    20 umask(002)
     20#umask(002)
    2121
    2222
     
    4141finaltime=25000
    4242setup='final'
     43extra='onslow'
    4344
    4445if setup =='trial':
     
    5859    yieldstep=60
    5960
    60 dir_comment='_'+setup+'_'+str(tide)+'_'+str(user)
     61dir_comment='_'+setup+'_'+str(tide)+'_'+str(extra)+'_'+str(user)
    6162
    6263# onshore data from 30m DTED level 2
     
    105106
    106107#boundaries locations
    107 boundaries_name = 'broome_3854_17042007'
     108#boundaries_name = 'broome_3854_17042007' #dampier
     109#boundaries_name = 'broome_3103_18052007' #exmouth
     110boundaries_name = 'broome_3859_16052007' #onslow
    108111
    109 boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'1_10000'+sep
     112#boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'1_10000'+sep
     113#boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'dampier'+sep+'1_10000'+sep
     114#boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
     115boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'onslow_hedland_broome'+sep+'1_10000'+sep
    110116boundaries_in_dir_name = boundaries_in_dir + boundaries_name
    111117boundaries_dir = anuga_dir+'boundaries'+sep
  • anuga_work/production/broome_2006/run_broome_urs.py

    r4464 r4533  
    3030from anuga.shallow_water import Field_boundary
    3131from Numeric import allclose
     32from anuga.shallow_water.data_manager import export_grid
    3233
    3334from anuga.pmesh.mesh_interface import create_mesh_from_regions
     
    3637from anuga_parallel.parallel_abstraction import get_processor_name
    3738from anuga.caching import myhash
     39from anuga.damage_modelling.inundation_damage import add_depth_and_momentum2csv, inundation_damage
     40
    3841# Application specific imports
    3942import project_urs                 # Definition of file names and polygons
     
    6770    kwargs['bathy_file']=project_urs.combined_dir_name_unclipped1+'.txt'
    6871#    kwargs['bathy_file']=project_urs.combined_small_dir_name + '.pts'
    69     kwargs['boundary_file']=project_urs.boundaries_dir_name + '.sww'
     72    kwargs['boundary_file']=project_urs.boundaries_in_dir_name + '.sww'
    7073
    7174    print 'output_dir',kwargs['output_dir']
     
    232235        store_parameters(**kwargs)
    233236    barrier()
     237   
     238    swwfile = kwargs['output_dir']+kwargs['aa_scenario_name']
     239    export_grid(swwfile, extra_name_out = 'town',
     240                quantities = ['elevation','stage','speed'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation
     241                timestep = None,
     242                reduction = max,
     243                cellsize = 25,
     244                NODATA_value = -9999,
     245                easting_min = project.eastingmin,
     246                easting_max = project.eastingmax,
     247                northing_min = project.northingmin,
     248                northing_max = project.northingmax,
     249                verbose = False,
     250                origin = None,
     251                datum = 'WGS84',
     252                format = 'asc')
     253   
     254    buildings_filename = project.buildings_filename
     255    buildings_filename_out = project.buildings_filename_out
     256               
     257    inundation_damage(swwfile+'.sww', buildings_filename, buildings_filename_out)
     258    print '\n Augmented building file written to %s \n' %buildings_filename_out
    234259
    235260
  • anuga_work/production/exmouth_2006/project.py

    r4525 r4533  
    1717host = get_host_name()
    1818#needed when running using mpirun, mpirun doesn't inherit umask from .bashrc
    19 #umask(002)
     19umask(002)
    2020
    2121#Making assumptions about the location of scenario data
     
    3939finaltime=25000
    4040setup='final'
    41 extra='exmouth'
     41extra='onslow'
    4242
    4343if setup =='trial':
     
    126126output_dir = anuga_dir+'outputs'+sep
    127127output_build_time_dir = output_dir+build_time+sep
    128 #output_run_time_dir = output_dir +run_time+dir_comment+sep
    129 output_run_time_dir = output_dir +'20070528_061822_run_final_1.4_nbartzis'+sep
     128output_run_time_dir = output_dir +run_time+dir_comment+sep
     129#output_run_time_dir = output_dir +'20070530_063246_run_final_0_dampier_nbartzis'+sep
    130130output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
    131131
  • anuga_work/production/exmouth_2006/run_exmouth.py

    r4525 r4533  
    6666    kwargs['boundary_file']=project.boundaries_in_dir_name + '.sww'
    6767   
    68    
    69     '''
    7068    print 'output_dir',kwargs['output_dir']
    7169    if myid == 0:
     
    231229
    232230
    233     '''
    234     print'hello'
    235231    swwfile = kwargs['output_dir']+kwargs['aa_scenario_name']
    236232    export_grid(swwfile, extra_name_out = 'town',
  • anuga_work/production/onslow_2006/project_urs.py

    r4525 r4533  
    1818host = get_host_name()
    1919#needed when running using mpirun, mpirun doesn't inherit umask from .bashrc
    20 #umask(002)
     20umask(002)
    2121
    2222
     
    3939finaltime=25000
    4040setup='final'
    41 extra='onslow'
     41extra='exmouth'
    4242
    4343if setup =='trial':
     
    121121boundaries_source = ''
    122122#boundaries_name = 'onslow_3854_17042007' #Dampier gun
    123 boundaries_name = 'onslow_3859_16052007' #onslow_hedland_broome gun
    124 #boundaries_name = 'onslow_3103_18052007' #exmouth gun
     123#boundaries_name = 'onslow_3859_16052007' #onslow_hedland_broome gun
     124boundaries_name = 'onslow_3103_18052007' #exmouth gun
    125125
    126126#boundaries locations
    127127#boundaries_in_dir = anuga_dir+'boundaries'+sep
    128128#boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'1_10000'+sep
    129 boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'onslow_hedland_broome'+sep+'1_10000'+sep
    130 #boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
     129#boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'dampier'+sep+'1_10000'+sep
     130#boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'onslow_hedland_broome'+sep+'1_10000'+sep
     131boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
    131132boundaries_in_dir_name = boundaries_in_dir + boundaries_name
    132133
     
    137138output_dir = anuga_dir+'outputs'+sep
    138139output_build_time_dir = output_dir+build_time+sep
    139 #output_run_time_dir = output_dir +run_time+dir_comment+sep
    140 output_run_time_dir = output_dir +'20070530_082920_run_final_1.5_nbartzis'+sep
     140output_run_time_dir = output_dir +run_time+dir_comment+sep
     141#output_run_time_dir = output_dir +'20070531_002753_run_final_0.0_onslow_nbartzis'+sep
    141142output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
    142143
  • anuga_work/production/onslow_2006/run_onslow_urs.py

    r4525 r4533  
    6666#    kwargs['bathy_file']=project_urs.combined_small_dir_name + '.txt'
    6767    kwargs['boundary_file']=project_urs.boundaries_in_dir_name + '.sww'
    68     '''
     68   
    6969    print 'output_dir',kwargs['output_dir']
    7070    if myid == 0:
     
    228228        store_parameters(**kwargs)
    229229    barrier()
    230     '''
     230   
    231231    swwfile = kwargs['output_dir']+kwargs['aa_scenario_name']
    232232    print 'swwfile',swwfile
  • anuga_work/production/pt_hedland_2006/build_pt_hedland.py

    r4434 r4533  
    2525# Related major packages
    2626from anuga.shallow_water import Domain
    27 from anuga.shallow_water import Dirichlet_boundary
    28 from anuga.shallow_water import File_boundary
    29 from anuga.shallow_water import Reflective_boundary
    30 from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
    31 from anuga.pmesh.mesh_interface import create_mesh_from_regions
    32 from anuga.geospatial_data.geospatial_data import Geospatial_data
    33 from anuga.abstract_2d_finite_volumes.util import start_screen_catcher, copy_code_files
     27from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts,urs_ungridded2sww
     28from anuga.geospatial_data.geospatial_data import *
     29from anuga.shallow_water.data_manager import start_screen_catcher, copy_code_files
    3430from anuga_parallel.parallel_abstraction import get_processor_name
    3531
     
    105101#G_other.export_points_file(project_urs.combined_dir_name + '_other' + '.pts')
    106102
    107 '''
     103
    108104print 'start reading:',project_urs.combined_dir_name + '.txt'
    109105G = Geospatial_data(file_name = (project_urs.combined_dir_name + '.txt'))
     
    116112#G.export_points_file(project_urs.combined_smaller_dir_name + '.txt')
    117113G_clipped.export_points_file(project_urs.combined_smallest_dir_name + '.txt')
    118 
     114'''
    119115#-------------------------------------------------------------------------
    120116# Convert URS to SWW file for boundary conditions
    121117#-------------------------------------------------------------------------
    122118print 'starting to create boundary conditions'
    123 #boundaries_in_dir_name = project_urs.boundaries_in_dir_name
     119     
     120print 'boundaries_in_dir_name',project_urs.boundaries_in_dir_name
    124121
    125 #print 'minlat=project_urs.north_boundary, maxlat=project_urs.south_boundary',project_urs.north_boundary, project_urs.south_boundary
    126 #print 'minlon= project_urs.west_boundary, maxlon=project_urs.east_boundary',project_urs.west_boundary, project_urs.east_boundary
    127 '''       
    128 from anuga.shallow_water.data_manager import urs_ungridded2sww
    129 
    130 print 'boundaries_in_dir_name',project_urs.boundaries_in_dir_name
    131 print 'project.boundaries_dir_name',project_urs.boundaries_dir_name
    132 
    133 urs_ungridded2sww(project_urs.boundaries_in_dir_name, project_urs.boundaries_dir_name,
     122urs_ungridded2sww(project_urs.boundaries_in_dir_name, project_urs.boundaries_in_dir_name,
    134123                  verbose=True, mint=5000, maxt=35000, zscale=1)
    135 '''
    136124
    137125
    138126
    139127
     128
  • anuga_work/production/pt_hedland_2006/project_urs.py

    r4477 r4533  
    3636alpha = 0.1
    3737friction=0.01
     38starttime=3600
    3839finaltime=25000
    39 starttime=3600
    4040setup='final'
    41 
    42 #dir_comment='_trial_'+str(tide)+'_'+str(user)
    43 #dir_comment='_final_'+str(tide)+'_'+str(user)
    44 #time_thinning=4
    45 #yieldstep=60
    46 #res_factor = 1
     41extra='dampier'
    4742
    4843if setup =='trial':
     
    6257    yieldstep=60
    6358
    64 
    65 dir_comment='_'+setup+'_'+str(tide)+'_'+str(user)
     59dir_comment='_'+setup+'_'+str(tide)+'_'+str(extra)+'_'+str(user)
    6660
    6761# onshore data from 30m DTED level 2
     
    108102
    109103#boundaries locations
    110 boundaries_name = 'pt_hedland_3854_17042007'
    111 
    112 boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'1_10000'+sep
     104boundaries_name = 'pt_hedland_3854_17042007' #dampier
     105#boundaries_name = 'pt_hedland_3103_18052007' #exmouth
     106#boundaries_name = 'pt_hedland_3859_16052007' #onslow
     107
     108#boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'1_10000'+sep
     109boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'dampier'+sep+'1_10000'+sep
     110#boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
     111#boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'onslow_hedland_broome'+sep+'1_10000'+sep
    113112boundaries_in_dir_name = boundaries_in_dir + boundaries_name
    114113boundaries_dir = anuga_dir+'boundaries'+sep
     
    117116#output locations
    118117output_dir = anuga_dir+'outputs'+sep
    119 output_build_time_dir = output_dir+build_time+sep
     118output_build_time_dir = output_dir+build_time+'_'+extra+sep
    120119output_run_time_dir = output_dir +run_time+dir_comment+sep
    121120output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
Note: See TracChangeset for help on using the changeset viewer.