Ignore:
Timestamp:
Jun 15, 2007, 4:47:03 PM (18 years ago)
Author:
nick
Message:

update model scripts

Location:
anuga_work/production/dampier_2006
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/dampier_2006/build_dampier.py

    r4357 r4544  
    3636
    3737# Application specific imports
    38 import project   # Definition of file names and polygons
     38import project_urs   # Definition of file names and polygons
    3939
    4040#------------------------------------------------------------------------------
     
    4242# output to file
    4343#------------------------------------------------------------------------------
    44 copy_code_files(project.output_build_time_dir,__file__,
    45                dirname(project.__file__)+sep+ project.__name__+'.py' )
     44copy_code_files(project_urs.output_build_time_dir,__file__,
     45               dirname(project_urs.__file__)+sep+ project_urs.__name__+'.py' )
    4646
    47 start_screen_catcher(project.output_build_time_dir)
     47start_screen_catcher(project_urs.output_build_time_dir)
    4848print "Processor Name:",get_processor_name()
    4949
    50 print 'USER:    ', project.user
     50print 'USER:    ', project_urs.user
    5151
    5252#-------------------------------------------------------------------------------
     
    5757# Fine pts file to be clipped to area of interest
    5858#-------------------------------------------------------------------------------
    59 print"project.combined_dir_name",project.combined_dir_name
     59print"project_urs.combined_dir_name",project_urs.combined_dir_name
    6060
    6161# topography directory filenames
    62 onshore_in_dir_name = project.onshore_in_dir_name
    63 coast_in_dir_name = project.coast_in_dir_name
    64 offshore_in_dir_name = project.offshore_in_dir_name
    65 offshore1_in_dir_name = project.offshore1_in_dir_name
    66 offshore2_in_dir_name = project.offshore2_in_dir_name
     62onshore_in_dir_name = project_urs.onshore_in_dir_name
     63coast_in_dir_name = project_urs.coast_in_dir_name
     64offshore_in_dir_name = project_urs.offshore_in_dir_name
     65offshore1_in_dir_name = project_urs.offshore1_in_dir_name
     66offshore2_in_dir_name = project_urs.offshore2_in_dir_name
    6767
    68 onshore_dir_name = project.onshore_dir_name
    69 coast_dir_name = project.coast_dir_name
    70 offshore_dir_name = project.offshore_dir_name
    71 offshore1_dir_name = project.offshore1_dir_name
    72 offshore2_dir_name = project.offshore2_dir_name
     68onshore_dir_name = project_urs.onshore_dir_name
     69coast_dir_name = project_urs.coast_dir_name
     70offshore_dir_name = project_urs.offshore_dir_name
     71offshore1_dir_name = project_urs.offshore1_dir_name
     72offshore2_dir_name = project_urs.offshore2_dir_name
    7373'''
    7474# creates DEM from asc data
     
    113113
    114114print'clip combined geospatial object by bounding polygon'
    115 G_clipped = G.clip(project.poly_all)
     115G_clipped = G.clip(project_urs.poly_all)
    116116#FIXME: add a clip function to pts
    117117#print'shape of clipped data', G_clipped.get_data_points().shape
    118118
    119119print'export combined DEM file'
    120 if access(project.topographies_dir,F_OK) == 0:
    121     mkdir (project.topographies_dir)
    122 G_clipped.export_points_file(project.combined_dir_name + '.pts')
    123 #G_clipped.export_points_file(project.combined_dir_name + '.txt')
     120if access(project_urs.topographies_dir,F_OK) == 0:
     121    mkdir (project_urs.topographies_dir)
     122G_clipped.export_points_file(project_urs.combined_dir_name + '.pts')
     123#G_clipped.export_points_file(project_urs.combined_dir_name + '.txt')
    124124
    125125print'split combined data set'
     
    127127
    128128print'export split DEM file'
    129 G_small.export_points_file(project.combined_dir_name + '_small' + '.pts')
    130 G_other.export_points_file(project.combined_dir_name + '_other' + '.pts')
     129G_small.export_points_file(project_urs.combined_dir_name + '_small' + '.pts')
     130G_other.export_points_file(project_urs.combined_dir_name + '_other' + '.pts')
    131131
    132 print 'start reading:',project.combined_smaller_dir_name + '.txt'
    133 G = Geospatial_data(file_name = project.combined_smaller_dir_name + '.txt')
     132print 'start reading:',project_urs.combined_smaller_dir_name + '.txt'
     133G = Geospatial_data(file_name = project_urs.combined_smaller_dir_name + '.txt')
    134134print 'start split'
    135135G_smallest, G_other = G.split(0.1,True)
    136136
    137 print 'start export',project.combined_smallest_dir_name + '.txt'
    138 #G.export_points_file(project.combined_smaller_dir_name + '.txt')
    139 #G_smallest.export_points_file(project.combined_smallest_dir_name + '.txt')
     137print 'start export',project_urs.combined_smallest_dir_name + '.txt'
     138#G.export_points_file(project_urs.combined_smaller_dir_name + '.txt')
     139#G_smallest.export_points_file(project_urs.combined_smallest_dir_name + '.txt')
    140140'''
    141141#-------------------------------------------------------------------------
    142142# Convert URS to SWW file for boundary conditions
    143143#-------------------------------------------------------------------------
     144'''
    144145print 'starting to create boundary conditions'
    145 boundaries_in_dir_name = project.boundaries_in_dir_name
     146boundaries_in_dir_name = project_urs.boundaries_in_dir_name
    146147
    147148from anuga.shallow_water.data_manager import urs2sww
    148149
    149 print 'minlat=project.north_boundary, maxlat=project.south_boundary',project.north_boundary, project.south_boundary
    150 print 'minlon= project.west_boundary, maxlon=project.east_boundary',project.west_boundary, project.east_boundary
     150print 'minlat=project_urs.north_boundary, maxlat=project_urs.south_boundary',project_urs.north_boundary, project_urs.south_boundary
     151print 'minlon= project_urs.west_boundary, maxlon=project_urs.east_boundary',project_urs.west_boundary, project_urs.east_boundary
    151152
    152153#import sys; sys.exit()
    153154
    154 #if access(project.boundaries_dir,F_OK) == 0:
    155 #    mkdir (project.boundaries_dir)
     155#if access(project_urs.boundaries_dir,F_OK) == 0:
     156#    mkdir (project_urs.boundaries_dir)
    156157
    157158from caching import cache
    158159cache(urs2sww,
    159160      (boundaries_in_dir_name,
    160        project.boundaries_dir_name+'a'),
     161       project_urs.boundaries_dir_name+'a'),
    161162      {'verbose': True,
    162        'minlat': project.south_boundary,
    163        'maxlat': project.north_boundary,
    164        'minlon': project.west_boundary,
    165        'maxlon': project.east_boundary,
     163       'minlat': project_urs.south_boundary,
     164       'maxlat': project_urs.north_boundary,
     165       'minlon': project_urs.west_boundary,
     166       'maxlon': project_urs.east_boundary,
    166167       'mint': 5000, 'maxt': 35000,
    167168#       'origin': domain.geo_reference.get_origin(),
    168 #       'mean_stage': project.tide,
     169#       'mean_stage': project_urs.tide,
    169170       'zscale': 1,                 #Enhance tsunami
    170171       'fail_on_NaN': False},
    171172       verbose = True,
    172173       )
    173 #       dependencies = source_dir + project.boundary_basename + '.sww')
     174#       dependencies = source_dir + project_urs.boundary_basename + '.sww')
     175'''
     176print 'starting to create boundary conditions'
     177from anuga.shallow_water.data_manager import urs2sww, urs_ungridded2sww
     178
     179print 'boundaries_in_dir_name',project_urs.boundaries_in_dir_name
     180
     181urs_ungridded2sww(project_urs.boundaries_in_dir_name, project_urs.boundaries_in_dir_name,
     182                  verbose=True, mint=4000, maxt=35000, zscale=1)
    174183
    175184
    176185
    177186
    178 
  • anuga_work/production/dampier_2006/project_urs.py

    r4542 r4544  
    2525
    2626#tide = -2.5
    27 #tide = 0.0
    28 tide = 2.4
     27tide = 0.0
     28#tide = 2.4
    2929
    3030#Maybe will try to make project a class to allow these parameters to be passed in.
     
    3434finaltime=25000
    3535setup='final'
    36 source='onslow'
     36source='exmouth'
    3737
    3838if setup =='trial':
     
    113113
    114114if source =='dampier':
    115     boundaries_name = 'pt_hedland_3854_17042007' #Dampier gun
     115    boundaries_name = 'dampier' #Dampier gun
    116116    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'dampier'+sep+'1_10000'+sep
    117117
    118118if source=='onslow':
    119     boundaries_name = 'pt_hedland_3859_16052007' #onslow_hedland_broome gun
     119    boundaries_name = 'dampier_3859_16052007' #onslow_hedland_broome gun
    120120    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'onslow_hedland_broome'+sep+'1_10000'+sep
    121121   
    122122if source=='exmouth':
    123     boundaries_name = 'pt_hedland_3103_18052007' #exmouth gun
     123    boundaries_name = 'dampier_3103_18052007' #exmouth gun
    124124    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
    125125
Note: See TracChangeset for help on using the changeset viewer.