Ignore:
Timestamp:
Feb 14, 2006, 5:19:29 PM (19 years ago)
Author:
ole
Message:

Pushed caching into conversion functions and beautified the Sydney scenario

File:
1 edited

Legend:

Unmodified
Added
Removed
  • production/sydney_2006/project.py

    r2403 r2407  
    33"""
    44
    5 from os import sep
     5from os import sep, environ
    66from os.path import expanduser
     7from utilities.polygon import read_polygon
    78import sys
     9
     10from pmesh.create_mesh import convert_points_from_latlon_to_utm
     11               
     12
     13
    814
    915#Making assumptions about the location of scenario data
     
    1420finename = 'bathy_dem25' # get from Neil/Ingo (DEM or topo data) Wed 25 Jan
    1521
     22
     23
    1624# creating easting and northing max and min for fine data - region of interest
    1725eastingmin = 332090
     
    2937
    3038if sys.platform == 'win32':
    31     home = '..\..\..\..\..'     #Sandpit's parent dir
     39    home = environ['INUNDATIONHOME']     #Sandpit's parent dir
    3240else:   
    3341    home = expanduser('~')
     42   
    3443
    3544
     
    3847datadir = home+sep+scenario_dir_name+sep+'topographies'+sep
    3948outputdir = home+sep+scenario_dir_name+sep+'output'+sep
     49polygondir = home+sep+scenario_dir_name+sep+'polygons'+sep
    4050
    4151meshname = meshdir + basename
     
    4454combineddemname = datadir + 'sydneytopo'
    4555outputname = outputdir + basename  #Used by post processing
     56
     57#csv file of coastline 50m epsilon belt
     58manly_polygonname = polygondir + 'manly_polygon_UTM56_coarse'
     59manly_polygon = read_polygon(manly_polygonname + '.csv')
     60#print manly_polygon
     61
    4662gauge_filename = outputdir + 'sydney_gauges.xya'
    4763gauge_outname = outputdir + 'gauges_max_output.xya'
     
    5167
    5268# define clipping polygon
     69south = degminsec2decimal_degrees(-34,05,0)
     70north = degminsec2decimal_degrees(-33,33,0)
     71west = degminsec2decimal_degrees(151,1,0)
     72east = degminsec2decimal_degrees(151,30,0)
     73p0 = [south, west]
     74p1 = [south, east]
     75p2 = [north, east]
     76p3 = [north, west]
     77   
     78polygonall, zone = convert_points_from_latlon_to_utm([p0, p1, p2, p3])
     79refzone = zone
     80
     81print 'Got refzone', refzone
     82
    5383dsouth = degminsec2decimal_degrees(-34,05,0)
    5484dnorth = degminsec2decimal_degrees(-33,33,0)
     
    72102dp8 = [dnorth, dwest]
    73103   
    74 diffpolygonall = [dp0, dp1, dp2, dp3, dp4, dp5, dp6, dp7]
    75 
     104diffpolygonall, zone = convert_points_from_latlon_to_utm([dp0, dp1, dp2, dp3, dp4, dp5, dp6, dp7])
     105# to put chunk back in
     106#diffpolygonall = [dp0, dp1, dp2, dp3, dp4, dp8]
     107
     108
     109
     110#Interior regions - the Harbour - take 2
    76111#Interior regions - the Harbour
    77112harbour_1x = degminsec2decimal_degrees(-33,51,0)
     
    122157k142 = [harbour_15x, harbour_15y]
    123158
    124 harbour_polygon_2 = [k02, k112, k122, k12, k22, k62, k72, k82, k102, k42, k52] #worked
     159harbour_polygon_2, zone = convert_points_from_latlon_to_utm([k02, k112, k122, k12, k22, k62, k72, k82, k102, k42, k52]) #worked
     160assert zone == refzone
     161
    125162
    126163#Interior region - Botany Bay
     164
     165#Interior region - Botany Bay - take 2
    127166bb_1x = degminsec2decimal_degrees(-34,3,0)
    128167bb_1y = degminsec2decimal_degrees(151,2,30)
     
    157196j92 = [bb_10x, bb_10y]
    158197
    159 botanybay_polygon_2 = [j92, j12, j22, j62, j82, j72, j42] # worked
    160 
    161 # around 42km across from harbour(385000,6255000)
     198botanybay_polygon_2, zone = convert_points_from_latlon_to_utm([j92, j12, j22, j62, j82, j72, j42]) # worked
     199
     200
     201# close to botany bay opening (340000,6236000)
     202# x0 = 25964
     203# y0 = 11049
     204# around 10km from botany bay opening (350000,6236000)
     205# x0 = 35964
     206# y0 = 11049
     207# around 21km from botany bay opening (361000,6236000)
     208#x0 = 46964
     209#y0 = 11049
     210
     211# not used for sydney scenario, original interior regions listed though
     212# setting up problem area for doing just around the harbour
     213hsouth = degminsec2decimal_degrees(-33,54,0)
     214hnorth = degminsec2decimal_degrees(-33,48,0)
     215hwest = degminsec2decimal_degrees(151,0,0)
     216heast = degminsec2decimal_degrees(151,30,0)
     217
     218hp0 = [hsouth, hwest]
     219hp1 = [hsouth, heast]
     220hp2 = [hnorth, heast]
     221hp3 = [hnorth, hwest]
     222polygon_h, zone = convert_points_from_latlon_to_utm([hp0, hp1, hp2, hp3])
     223
     224#Interior regions - the Harbour - take 1
     225harbour_south = degminsec2decimal_degrees(-33,53,0)
     226harbour_north = degminsec2decimal_degrees(-33,47,0)
     227harbour_west = degminsec2decimal_degrees(151,5,0)
     228harbour_east = degminsec2decimal_degrees(151,19,0)
     229
     230#harbour_south1 = degminsec2decimal_degrees(-33,53,0)
     231#harbour_south2 = degminsec2decimal_degrees(-33,52,0)
     232#harbour_north1 = degminsec2decimal_degrees(-33,45,0)
     233#harbour_north2 = degminsec2decimal_degrees(-33,48,0)
     234#harbour_west = degminsec2decimal_degrees(151,5,0)
     235#harbour_east = degminsec2decimal_degrees(151,19,0)
     236
     237k0 = [harbour_south, harbour_west]
     238k1 = [harbour_south, harbour_east]
     239k2 = [harbour_north, harbour_east]
     240k3 = [harbour_north, harbour_west]   
     241
     242harbour_polygon, zone = convert_points_from_latlon_to_utm([k0, k1, k2, k3])
     243
     244# setting up problem area for doing just around Botany Bay
     245bsouth = degminsec2decimal_degrees(-33,56,0)
     246bnorth = degminsec2decimal_degrees(-34,3,0)
     247bwest = degminsec2decimal_degrees(151,0,0)
     248beast = degminsec2decimal_degrees(151,30,0)
     249
     250bp0 = [bsouth, bwest]
     251bp1 = [bsouth, beast]
     252bp2 = [bnorth, beast]
     253bp3 = [bnorth, bwest]
     254polygon_bb, zone = convert_points_from_latlon_to_utm([bp0, bp1, bp2, bp3])
     255
     256#Interior region - Botany Bay - take 1
     257botanybay_south = degminsec2decimal_degrees(-33,58,0)
     258botanybay_north = degminsec2decimal_degrees(-34,1,0)
     259botanybay_west = degminsec2decimal_degrees(151,5,0)
     260botanybay_east = degminsec2decimal_degrees(151,18,0)
     261
     262j0 = [botanybay_south, botanybay_west]
     263j1 = [botanybay_south, botanybay_east]
     264j2 = [botanybay_north, botanybay_east]
     265j3 = [botanybay_north, botanybay_west]   
     266
     267botanybay_polygon, zone = convert_points_from_latlon_to_utm([j0, j1, j2, j3])
     268assert zone == refzone
     269
    162270#x0 = 28964 + 42000
    163271#y0 = 30049
Note: See TracChangeset for help on using the changeset viewer.