Changeset 4091


Ignore:
Timestamp:
Dec 19, 2006, 9:19:27 AM (18 years ago)
Author:
nick
Message:

updates to dampier and perth

Location:
anuga_work/production
Files:
4 edited

Legend:

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

    r4066 r4091  
    203203n_max_area = 7725000
    204204
    205 e_min_area_mom = 442200
    206 e_max_area_mom = 497028
    207 n_min_area_mom = 7720095
    208 n_max_area_mom = 7750500
    209 
    210205poly_facility = read_polygon(polygons_dir+'facility.csv')
    211206
     
    224219clip_poly_mid_e = read_polygon(polygons_dir+'gap_mid_e.cvs')
    225220
    226 plot_polygons([bounding_polygon,poly_facility,poly_pipeline,poly_interior,poly_coast],'polys',verbose=True)
    227221#Interior regions
    228222karratha_south = degminsec2decimal_degrees(-20,44,0)
  • anuga_work/production/perth_2006/build_perth.py

    r4083 r4091  
    5757print"project.bounding_polygon",project.bounding_polygon
    5858print"project.combined_dir_name",project.combined_dir_name
    59 '''
     59
    6060# topography directory filenames
    6161onshore_in_dir_name = project.onshore_in_dir_name
     
    6666island_in_dir_name3 = project.island_in_dir_name3
    6767offshore_in_dir_name = project.offshore_in_dir_name
     68offshore1_in_dir_name = project.offshore1_in_dir_name
    6869
    6970onshore_dir_name = project.onshore_dir_name
     
    7677
    7778# creates DEM from asc data
     79print "creates DEMs from asc data"
    7880convert_dem_from_ascii2netcdf(onshore_in_dir_name, basename_out=onshore_dir_name, use_cache=True, verbose=True)
    7981convert_dem_from_ascii2netcdf(island_in_dir_name, basename_out=island_dir_name, use_cache=True, verbose=True)
     
    8385
    8486#creates pts file for onshore DEM
     87print "creates pts file for onshore DEM"
    8588dem2pts(onshore_dir_name,
    8689#        easting_min=project.eastingmin,
     
    97100dem2pts(island_dir_name3, use_cache=True, verbose=True)
    98101
    99 print'create Geospatial data objects from topographies'
     102print'create Geospatial data1 objects from topographies'
    100103G1 = Geospatial_data(file_name = onshore_dir_name + '.pts')
     104print'create Geospatial data2 objects from topographies'
    101105G2 = Geospatial_data(file_name = coast_in_dir_name + '.xya')
     106print'create Geospatial data3 objects from topographies'
    102107G3 = Geospatial_data(file_name = island_dir_name + '.pts')
     108print'create Geospatial data4 objects from topographies'
    103109G4 = Geospatial_data(file_name = island_dir_name1 + '.pts')
     110print'create Geospatial data5 objects from topographies'
    104111G5 = Geospatial_data(file_name = island_dir_name2 + '.pts')
     112print'create Geospatial data6 objects from topographies'
    105113G6 = Geospatial_data(file_name = island_dir_name3 + '.pts')
     114print'create Geospatial data7 objects from topographies'
    106115G_off = Geospatial_data(file_name = offshore_in_dir_name + '.xya')
     116print'create Geospatial data8 objects from topographies'
     117G_off1 = Geospatial_data(file_name = offshore1_in_dir_name + '.xya')
    107118
    108119print'add all geospatial objects'
    109 G = G1 + G2 + G3 + G4 + G5 + G6 + G_off
     120G = G1 + G2 + G3 + G4 + G5 + G6 + G_off + G_off1
    110121
    111122print'clip combined geospatial object by bounding polygon'
     
    117128if access(project.topographies_dir,F_OK) == 0:
    118129    mkdir (project.topographies_dir)
    119 #G_clipped.export_points_file(project.combined_dir_name + '.pts')
    120 G_clipped.export_points_file(project.combined_dir_name + '.xya')
     130G_clipped.export_points_file(project.combined_dir_name + '.pts')
     131#G_clipped.export_points_file(project.combined_dir_name + '.xya')
    121132
    122133'''
     
    130141G_all_2.export_points_file(project.combined_dir_name+'_other1' + '.xya')
    131142
    132 '''
     143
    133144#-------------------------------------------------------------------------
    134145# Convert URS to SWW file for boundary conditions
  • anuga_work/production/perth_2006/project.py

    r4081 r4091  
    4646coast_name = 'waterline'
    4747offshore_name = 'perth_bathymetry'
     48offshore1_name = 'missing_fairsheets'
    4849
    4950#final topo name
    5051combined_name ='perth_combined_elevation'
     52combined_smaller_name = 'perth_combined_elevation_smaller'
     53
    5154
    5255topographies_in_dir = home+sep+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
     
    6366coast_in_dir_name = topographies_in_dir + coast_name
    6467offshore_in_dir_name = topographies_in_dir + offshore_name
     68offshore1_in_dir_name = topographies_in_dir + offshore1_name
    6569
    6670onshore_dir_name = topographies_dir + onshore_name
     
    7680combined_dir_name = topographies_dir + combined_name
    7781combined_time_dir_name = topographies_time_dir + combined_name
     82combined_smaller_name_dir = topographies_dir + combined_smaller_name
    7883#combined_time_dir_final_name = topographies_time_dir + combined_final_name
    7984
    8085
    81 #Derive subdirectories and filenames
    8286
    8387meshes_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'meshes'+sep
     
    8892
    8993
    90 boundaries_source = 'mag_9_corrected'
     94boundaries_source = '????'
    9195#boundaries locations
    9296boundaries_in_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+'urs'+sep+boundaries_source+sep
     
    96100#boundaries_time_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+build_time+sep
    97101#boundaries_time_dir_name = boundaries_time_dir + boundaries_name  #Used by post processing
    98 #ideas
    99 #boundaries_time_dir = boundaries_in_dir+'urs'+sep+boundaries_source+sep
    100102
    101103#output locations
     
    111113
    112114
    113 
    114 
    115 
    116 
    117 
    118 
    119115###############################
    120116# Domain definitions
     
    123119
    124120bounding_polygon = read_polygon(polygons_dir+'bounding_poly.csv')
     121res_bounding = 1000000
    125122
    126123refzone = 50
    127124
    128125
    129 #Interior regions
     126###############################
     127# Interior region definitions
     128###############################
    130129
    131 #cipma_polygon, zone = convert_from_latlon_to_utm([k0, k1, k2, k3])
     130poly_pos20_neg20 = read_polygon(polygons_dir+'pos20_neg20pts.csv')
     131res_pos20_neg20 = 500000
     132
     133poly_cbd = read_polygon(polygons_dir+'cbd_pts.csv')
     134res_cbd = 50000
     135
     136poly_penguin = read_polygon(polygons_dir+'penguin_pts.csv')
     137res_penguin = 50000
    132138#assert zone == refzone
    133139
    134 poly_pos20_neg20 = read_polygon(polygons_dir+'pos20_neg20pts.csv')
     140trigs_bound = polygon_area(bounding_polygon)/res_bounding
     141trigs_pos = polygon_area(poly_pos20_neg20)/res_pos20_neg20
     142trigs_cbd = polygon_area(poly_cbd)/res_cbd
     143trigs_penguin = polygon_area(poly_penguin)/res_penguin
     144trigs_min = trigs_bound + trigs_pos + trigs_cbd + trigs_penguin
    135145
    136 poly_cbd = read_polygon(polygons_dir+'cbd_pts.csv')
    137 
    138 poly_penguin = read_polygon(polygons_dir+'penguin_pts.csv')
    139 #assert zone == refzone
    140 
    141 print "bounding_polygon", bounding_polygon
    142 print 'Area of bounding poly', polygon_area(bounding_polygon)/1000000.0
    143 print 'Area of pos20_neg20pts', polygon_area(poly_pos20_neg20)/1000000.0
    144 print 'Area of poly_cbd', polygon_area(poly_cbd)/1000000.0
    145 print 'Area of poly_penguin', polygon_area(poly_penguin)/1000000.0
     146print 'Area of bounding poly', trigs_bound
     147print 'Area of pos20_neg20pts', trigs_pos
     148print 'Area of poly_cbd', trigs_cbd
     149print 'Area of poly_penguin', trigs_penguin
     150print 'min number triangles', trigs_min
    146151
    147152
     
    149154# Clipping regions for export to asc and regions for clipping data
    150155###################################################################
    151 '''
     156
    152157# exporting asc grid
    153158eastingmin = 406215.87
     
    156161northingmax = 8032834.52
    157162
    158 ###############################
    159 # Interior region definitions
    160 ###############################
    161163
    162 # perth digitized polygons
    163 poly_perth1 = read_polygon(polygondir+'perth_Local_Polygon_update.csv')
    164 poly_perth2 = read_polygon(polygondir+'perth_Close2_update.csv')
    165 poly_perth3 = read_polygon(polygondir+'perth_Coast_update.csv')
    166 #poly_perth4 = read_polygon(polygondir+'Cable_Beach_revised.csv')
    167164
    168 plot_polygons([polyAll,poly_perth1,poly_perth2,poly_perth3],'boundingpoly2',verbose=False)
    169 print 'Area of local polygon', polygon_area(poly_perth1)/1000000.0
    170 print 'Area of close polygon', polygon_area(poly_perth2)/1000000.0
    171 print 'Area of coastal polygon', polygon_area(poly_perth3)/1000000.0
    172 #print 'Area of cable beach polygon', polygon_area(poly_perth4)/1000000.0
    173 '''
    174 
  • anuga_work/production/perth_2006/run_perth.py

    r4082 r4091  
    3131
    3232from anuga.pmesh.mesh_interface import create_mesh_from_regions
    33 
    3433from anuga.geospatial_data.geospatial_data import *
    3534from anuga.abstract_2d_finite_volumes.util import start_screen_catcher, copy_code_files
    3635from anuga_parallel.parallel_api import distribute, numprocs, myid, barrier
     36from anuga.utilities.polygon import plot_polygons, polygon_area
    3737
    3838# Application specific imports
     
    4747# filenames
    4848
    49 build_time = '20061107_063840_build'
    50 bound_time = '20061102_221245_build'
    51 
    5249boundaries_name = project.scenario
    5350meshes_dir_name = project.meshes_dir_name+'.msh'
    54 #source_dir = project.boundarydir
    5551#boundaries_time_dir_name = project.boundaries_time_dir_name
    5652boundaries_dir_name = project.boundaries_dir_name
     
    6763
    6864print 'USER: ', project.user
     65print 'min triangles', project.trigs_min,
     66print 'Note: This is generally about 20% less than the final amount'
    6967
    7068#--------------------------------------------------------------------------
     
    7674
    7775if myid == 0:
     76
    7877    print 'start create mesh from regions'
    79     interior_regions = [[project.poly_pos20_neg20, 500000],
    80                     [project.poly_cbd, 50000],
    81                     [project.poly_penguin, 50000]]   
     78    interior_regions = [[project.poly_pos20_neg20, project.res_pos20_neg20],
     79                    [project.poly_cbd, project.res_cbd],
     80                    [project.poly_penguin, project.res_penguin]]   
    8281#                    [project.poly_interior, 1000]]       
    8382
     
    8988#               verbose = True)
    9089#    import sys; sys.exit()
     90
    9191    print 'start create mesh from regions'
    92 
    9392    create_mesh_from_regions(project.bounding_polygon,
    9493                         boundary_tags={'back': [4], 'side': [0,3],
    9594                                        'ocean': [1, 2]},
    96                          maximum_triangle_area=1000000,
     95                         maximum_triangle_area=project.res_bounding,
    9796                         interior_regions=interior_regions,
    9897#                         filename=meshes_time_dir_name,
     
    157156
    158157    domain.set_quantity('elevation',
    159                     filename = project.combined_dir_name+'.xya',
     158#                    filename = project.combined_dir_name+'.xya',
     159                    filename = project.combined_smaller_name_dir+'.xya',
    160160                    use_cache = True,
    161161                    verbose = True,
     
    201201domain.set_boundary({'back': Br,
    202202                     'side': Bd,
    203                      'ocean': Bf})
     203                     'ocean': Bd})
    204204print'finish set boundary'
    205205
     
    214214    domain.write_boundary_statistics(tags = 'ocean')
    215215    if allclose(t, 120):
    216         domain.set_boundary({'back': Br, 'side': Bo, 'ocean': Bo})
     216        domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bo})
    217217
    218218    if allclose(t, 1020):
    219         domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bo})
     219        domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bd})
    220220
    221221   
Note: See TracChangeset for help on using the changeset viewer.