Changeset 3249


Ignore:
Timestamp:
Jun 28, 2006, 9:29:41 AM (19 years ago)
Author:
nick
Message:

onslow update

Location:
production/onslow_2006
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • production/onslow_2006/project.py

    r3188 r3249  
    33"""
    44
    5 from os import sep, environ
     5from os import sep, environ, getenv, getcwd
    66from os.path import expanduser
    77from utilities.polygon import read_polygon
     
    1212from coordinate_transforms.redfearn import degminsec2decimal_degrees
    1313
    14 from time import localtime, strftime
    15 
    16 from os import getcwd
     14from time import localtime, strftime, gmtime
    1715               
    1816#Making assumptions about the location of scenario data
     
    3533
    3634if sys.platform == 'win32':
    37     home = environ['INUNDATIONHOME']     #Sandpit's parent dir
    38     comparehome = environ['ANUGAHOME']
     35    home = getenv('INUNDATIONHOME')
     36#    python_home = getenv('PWD')     
     37#    home = environ['INUNDATIONHOME']     #Sandpit's parent dir
     38    user = getenv('USERPROFILE')
     39#    user = basename(user_path)
     40    print 'USER:', user
     41   
    3942else:   
    40     home = environ['INUNDATIONHOME']     #Sandpit's parent dir
    41 #    home = expanduser('~')
     43    home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'1'+sep+'cit'+sep+'risk_assessment_methods_project'+sep+'inundation')     
     44    user = getenv('LOGNAME')
     45    print 'USER:', user
    4246
    4347#Derive subdirectories and filenames
    44 time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
    45 outputtimedir = home+sep+scenario_dir_name+sep+'output'+sep+time+sep
     48#time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
     49local_time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
     50
    4651meshdir = home+sep+scenario_dir_name+sep+'meshes'+sep
    4752datadir = home+sep+scenario_dir_name+sep+'topographies'+sep
     
    5257outputdir = home+sep+scenario_dir_name+sep+'output'+sep
    5358tidedir = home+sep+scenario_dir_name+sep+'tide_data'+sep
    54 comparereportdir = comparehome+sep+'documentation'+sep+'experimentation'+sep+'boundary_ANUGA_MOST'+sep+'report'
    55 comparereportfigdir = comparehome+sep+'documentation'+sep+'experimentation'+sep+'boundary_ANUGA_MOST'+sep+'report_figures'
     59
     60outputtimedir = outputdir + local_time + sep
     61
    5662print'bound', boundarydir
    5763
     
    8187codedirname = codedir + 'project.py'
    8288
    83 meshname = meshdir + basename
    84 
     89#meshname = meshdir + basename
     90meshname = outputtimedir + 'mesh_' + basename
     91print 'meshname',meshname
    8592coarsedemname = datadir + coarsename
    8693
     
    138145#Interior region - Onslow town
    139146
     147#first run!
    140148#i0 = [304000, 7608000]
    141 i0 = [304000, 7607000]
    142 i1 = [302000, 7605000]
     149#i1 = [302000, 7605000]
    143150#i2 = [303000, 7602000]
     151#i3 = [305000, 7601000]
     152#i4 = [309000, 7603000]
     153#i5 = [307000, 7606500]
     154
     155#refined run
     156#i0 = [304000, 7607000]
     157#i1 = [302000, 7605000]
     158#i2 = [304000, 7603000]
     159#i3 = [307000, 7602000]
     160#i4 = [309000, 7603000]
     161#i5 = [307000, 7606000]
     162
     163#for visualisation
     164i0 = [304000, 7609000]
     165i1 = [301500, 7605000]
    144166i2 = [304000, 7603000]
    145 #i3 = [305000, 7601000]
    146167i3 = [307000, 7602000]
    147168i4 = [309000, 7603000]
    148 #i5 = [307000, 7606500]
    149 i5 = [307000, 7606000]
     169i5 = [311000, 7607000]
     170
     171
    150172
    151173poly_onslow = [i0, i1, i2, i3, i4, i5]
     
    189211
    190212poly_region = [m0, m1, m2, m3, m4, m5]
    191 
    192 from coordinate_transforms.redfearn import redfearn
    193 # boundary up to 50 m contour
    194 lat1_50 = degminsec2decimal_degrees(-21,30,0)
    195 lat2_50 = degminsec2decimal_degrees(-21,25,0)
    196 lat3_50 = degminsec2decimal_degrees(-21,12,0)
    197 lat4_50 = degminsec2decimal_degrees(-21,0,0)
    198 lon1_50 = degminsec2decimal_degrees(114,40,0)
    199 lon2_50 = degminsec2decimal_degrees(114,49,0)
    200 lon3_50 = degminsec2decimal_degrees(115,1,0)
    201 lon4_50 = degminsec2decimal_degrees(115,9,0)
    202 z, easting, northing = redfearn(lat1_50, lon1_50)
    203 p0_50 = [easting, northing]
    204 z, easting, northing = redfearn(lat2_50, lon2_50)
    205 p1_50 = [easting, northing]
    206 z, easting, northing= redfearn(lat3_50, lon3_50)
    207 p2_50 = [easting, northing]
    208 z, easting, northing = redfearn(lat4_50, lon4_50)
    209 p3_50 = [easting, northing]
    210 
    211 d4_50 = [285000, 7585000]
    212 d6_50 = [330000, 7605000]
    213 bounding_poly50 = [p0_50, p1_50, p2_50, p3_50, d6_50, d5, d4_50]
    214 
    215 # boundary up to 25 m contour
    216 lat1_25 = degminsec2decimal_degrees(-21,30,0)
    217 lat2_25 = degminsec2decimal_degrees(-21,24,0)
    218 lat3_25 = degminsec2decimal_degrees(-21,3,0)
    219 lon1_25 = degminsec2decimal_degrees(114,46,0)
    220 lon2_25 = degminsec2decimal_degrees(114,53,0)
    221 lon3_25 = degminsec2decimal_degrees(115,9,0)
    222 z, easting, northing = redfearn(lat1_25, lon1_25)
    223 p0_25 = [easting, northing]
    224 z, easting, northing = redfearn(lat2_25, lon2_25)
    225 p1_25 = [easting, northing]
    226 z, easting, northing = redfearn(lat3_25, lon3_25)
    227 p2_25 = [easting, northing]
    228 bounding_poly25 = [p0_25, p1_25, p2_25, d6, d5, d4]
  • production/onslow_2006/run_onslow.py

    r2956 r3249  
    8888#    print' most file', project.MOST_dir + project.boundary_basename
    8989
    90 """
     90'''
    9191# fine data (clipping the points file to smaller area)
    9292# creates DEM from asc data
     
    113113print'export G'
    114114G.export_points_file(project.combined_dem_name + '.pts')
    115 """
     115'''
    116116
    117117#-------------------------------------------------------------------------------                                 
     
    122122
    123123from pmesh.mesh_interface import create_mesh_from_regions
    124 
     124'''
     125# original
     126interior_res = 5000
     127high_res = 1500
     128interior_regions = [[project.poly_onslow, high_res],
     129                    [project.poly_thevenard, interior_res],
     130                    [project.poly_coast, interior_res]]
     131'''
    125132#new
    126 region_res = 50000
    127 coast_res = 2500
     133region_res = 25000
     134coast_res = 25000
    128135onslow_res = 500
    129136interior_regions = [[project.poly_onslow, onslow_res],
    130                     [project.poly_coast, coast_res]]
    131 #,
     137                    [project.poly_coast, coast_res]]#,
    132138#                    [project.poly_region, region_res]]
    133139
     
    141147                             'bottom': [4], 'bottomright': [5],
    142148                             'topright':[6]},
    143            'maximum_triangle_area': 1000000,
     149           'maximum_triangle_area': 100000,
    144150           'filename': meshname,           
    145151           'interior_regions': interior_regions},
    146           verbose = True)
     152          verbose = True, evaluate=True)
    147153
    148154
     
    235241       'inverted_bathymetry': True},
    236242      #evaluate = True,
    237        verbose = True)
     243       verbose = True, evaluate=True)
    238244
    239245
     
    260266t0 = time.time()
    261267
    262 for t in domain.evolve(yieldstep = 240, finaltime = 7200):
     268for t in domain.evolve(yieldstep = 450, finaltime = 10800):
    263269    domain.write_time()
    264270    domain.write_boundary_statistics(tags = 'top')     
    265271
    266 for t in domain.evolve(yieldstep = 120, finaltime = 12600
     272for t in domain.evolve(yieldstep = 60, finaltime = 17760
    267273                       ,skip_initial_step = True):
    268274    domain.write_time()
    269275    domain.write_boundary_statistics(tags = 'top')     
    270276
    271 for t in domain.evolve(yieldstep = 60, finaltime = 19800
     277for t in domain.evolve(yieldstep = 480, finaltime = 36000
    272278                       ,skip_initial_step = True):
    273279    domain.write_time()
    274280    domain.write_boundary_statistics(tags = 'top')     
    275281   
    276 for t in domain.evolve(yieldstep = 120, finaltime = 25200
    277                        ,skip_initial_step = True):
    278     domain.write_time()
    279     domain.write_boundary_statistics(tags = 'top')     
    280 
    281 for t in domain.evolve(yieldstep = 240, finaltime = 36000
    282                        ,skip_initial_step = True):
    283     domain.write_time()
    284     domain.write_boundary_statistics(tags = 'top')     
    285282 
    286283print 'That took %.2f seconds' %(time.time()-t0)
Note: See TracChangeset for help on using the changeset viewer.