Changeset 4172


Ignore:
Timestamp:
Jan 11, 2007, 5:14:16 PM (17 years ago)
Author:
sexton
Message:

minor updates to Dampier

Location:
anuga_work/production/dampier_2006
Files:
3 edited

Legend:

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

    r4151 r4172  
    6161onshore_in_dir_name = project.onshore_in_dir_name
    6262coast_in_dir_name = project.coast_in_dir_name
    63 island_in_dir_name = project.island_in_dir_name
    64 island_in_dir_name1 = project.island_in_dir_name1
    65 island_in_dir_name2 = project.island_in_dir_name2
    66 island_in_dir_name3 = project.island_in_dir_name3
    6763offshore_in_dir_name = project.offshore_in_dir_name
    6864offshore1_in_dir_name = project.offshore1_in_dir_name
     65offshore2_in_dir_name = project.offshore2_in_dir_name
    6966
    7067onshore_dir_name = project.onshore_dir_name
    7168coast_dir_name = project.coast_dir_name
    72 island_dir_name = project.island_dir_name
    73 island_dir_name1 = project.island_dir_name1
    74 island_dir_name2 = project.island_dir_name2
    75 island_dir_name3 = project.island_dir_name3
    7669offshore_dir_name = project.offshore_dir_name
     70offshore1_dir_name = project.offshore1_dir_name
     71offshore2_dir_name = project.offshore2_dir_name
    7772
    7873# creates DEM from asc data
    7974print "creates DEMs from asc data"
    80 convert_dem_from_ascii2netcdf(onshore_in_dir_name, basename_out=onshore_dir_name, use_cache=True, verbose=True)
    81 convert_dem_from_ascii2netcdf(island_in_dir_name, basename_out=island_dir_name, use_cache=True, verbose=True)
    82 convert_dem_from_ascii2netcdf(island_in_dir_name1, basename_out=island_dir_name1, use_cache=True, verbose=True)
    83 convert_dem_from_ascii2netcdf(island_in_dir_name2, basename_out=island_dir_name2, use_cache=True, verbose=True)
    84 convert_dem_from_ascii2netcdf(island_in_dir_name3, basename_out=island_dir_name3, use_cache=True, verbose=True)
     75convert_dem_from_ascii2netcdf(onshore_in_dir_name,
     76                              basename_out=onshore_dir_name,
     77                              use_cache=True, verbose=True)
     78convert_dem_from_ascii2netcdf(offshore1_in_dir_name,
     79                              basename_out=offshore1_dir_name,
     80                              use_cache=True, verbose=True)
     81convert_dem_from_ascii2netcdf(offshore2_in_dir_name,
     82                              basename_out=offshore2_dir_name,
     83                              use_cache=True, verbose=True)
    8584
    8685#creates pts file for onshore DEM
    8786print "creates pts file for onshore DEM"
    88 dem2pts(onshore_dir_name,
    89 #        easting_min=project.eastingmin,
    90 #        easting_max=project.eastingmax,
    91 #        northing_min=project.northingmin,
    92 #        northing_max= project.northingmax,
    93         use_cache=True,
    94         verbose=True)
     87dem2pts(onshore_dir_name, use_cache=True, verbose=True)
    9588
    96 #creates pts file for island DEM
    97 dem2pts(island_dir_name, use_cache=True, verbose=True)
    98 dem2pts(island_dir_name1, use_cache=True, verbose=True)
    99 dem2pts(island_dir_name2, use_cache=True, verbose=True)
    100 dem2pts(island_dir_name3, use_cache=True, verbose=True)
     89#creates pts file for clipped DEMs
     90dem2pts(offshore1_dir_name,
     91        basename_out=offshore1_dir_name,
     92        use_cache=True, verbose=True)
     93dem2pts(offshore2_dir_name,
     94        basename_out=offshore2_dir_name,
     95        use_cache=True, verbose=True)
    10196
    102 print'create Geospatial data1 objects from topographies'
     97print'create Geospatial onshore objects from topographies'
    10398G1 = Geospatial_data(file_name = onshore_dir_name + '.pts')
    104 print'create Geospatial data2 objects from topographies'
     99print'create Geospatial coastal objects from topographies'
    105100G2 = Geospatial_data(file_name = coast_in_dir_name + '.xya')
    106 print'create Geospatial data3 objects from topographies'
    107 G3 = Geospatial_data(file_name = island_dir_name + '.pts')
    108 print'create Geospatial data4 objects from topographies'
    109 G4 = Geospatial_data(file_name = island_dir_name1 + '.pts')
    110 print'create Geospatial data5 objects from topographies'
    111 G5 = Geospatial_data(file_name = island_dir_name2 + '.pts')
    112 print'create Geospatial data6 objects from topographies'
    113 G6 = Geospatial_data(file_name = island_dir_name3 + '.pts')
    114 print'create Geospatial data7 objects from topographies'
     101print'create Geospatial nickel bay objects from topographies'
     102G3 = Geospatial_data(file_name = offshore1_dir_name + '.pts')
     103print'create Geospatial clipped TIN offshore objects from topographies'
     104G4 = Geospatial_data(file_name = offshore2_dir_name + '.pts')
     105print'create Geospatial offshore objects from topographies'
    115106G_off = Geospatial_data(file_name = offshore_in_dir_name + '.xya')
    116 print'create Geospatial data8 objects from topographies'
    117 G_off1 = Geospatial_data(file_name = offshore1_in_dir_name + '.xya')
    118107
    119108print'add all geospatial objects'
    120 G = G1 + G2 + G3 + G4 + G5 + G6 + G_off + G_off1
     109G = G1 + G2 + G3 + G4 + G_off
    121110
    122111print'clip combined geospatial object by bounding polygon'
  • anuga_work/production/dampier_2006/project.py

    r4164 r4172  
    3636# onshore data provided by WA DLI
    3737onshore_name = 'dampier_dli_ext' # original
    38 #island
    39 island_name = 'rott_dli_ext' # original
    40 island_name1 = 'gard_dli_ext'
    41 island_name2 = 'carnac_island_dted'
    42 island_name3 = 'penguin_dted'
    4338
    4439# AHO + DPI data + colin French coastline
    4540coast_name = 'waterline'
    4641offshore_name = 'dampier_bathymetry'
    47 offshore1_name = 'missing_fairsheets'
     42offshore1_name = 'nickelbay'
     43offshore2_name = 'tinclip'
    4844
    4945#final topo name
     
    5753# input topo file location
    5854onshore_in_dir_name = topographies_in_dir + onshore_name
    59 island_in_dir_name = topographies_in_dir + island_name
    60 island_in_dir_name1 = topographies_in_dir + island_name1
    61 island_in_dir_name2 = topographies_in_dir + island_name2
    62 island_in_dir_name3 = topographies_in_dir + island_name3
    63 
    6455coast_in_dir_name = topographies_in_dir + coast_name
    6556offshore_in_dir_name = topographies_in_dir + offshore_name
    6657offshore1_in_dir_name = topographies_in_dir + offshore1_name
     58offshore2_in_dir_name = topographies_in_dir + offshore2_name
    6759
    6860onshore_dir_name = topographies_dir + onshore_name
    69 island_dir_name = topographies_dir + island_name
    70 island_dir_name1 = topographies_dir + island_name1
    71 island_dir_name2 = topographies_dir + island_name2
    72 island_dir_name3 = topographies_dir + island_name3
    73 
    7461coast_dir_name = topographies_dir + coast_name
    7562offshore_dir_name = topographies_dir + offshore_name
     63offshore1_dir_name = topographies_dir + offshore1_name
     64offshore2_dir_name = topographies_dir + offshore2_name
    7665
    7766#final topo files
  • anuga_work/production/dampier_2006/run_dampier.py

    r4164 r4172  
    129129
    130130    print 'Setup initial conditions'
    131    
    132     def IC(x,y):
    133        
    134         from anuga.utilities.polygon import is_inside_polygon
    135         from Numeric import zeros, Float
    136 
    137         w = zeros(len(x), Float)
    138         for i, xi in enumerate(x):
    139             yi = y[i]
    140             if is_inside_polygon([xi,yi],project.poly_bathy,verbose=False) == True:
    141                 w[i] = tide
    142             else:
    143                 w[i] = 0.
    144 
    145         return w
    146 
     131
     132    from polygon import *
     133    IC = Polygon_function( [(project.poly_bathy, tide)], default = 0.)
    147134    domain.set_quantity('stage', IC)
    148135    domain.set_quantity('friction', 0.01)
     
    220207#    domain.write_time()
    221208#    domain.write_boundary_statistics(tags = 'ocean')   
    222    
     209
     210x, y = domain.get_maximum_inundation_location()
     211q = domain.get_maximum_inundation_elevation()
     212
     213print 'Maximum runup observed at (%.2f, %.2f) with elevation %.2f' %(x,y,q)
     214
    223215print 'That took %.2f seconds' %(time.time()-t0)
    224216
Note: See TracChangeset for help on using the changeset viewer.