Changeset 6225


Ignore:
Timestamp:
Jan 21, 2009, 4:57:58 PM (15 years ago)
Author:
ole
Message:

Work on Patong w buildings

Location:
anuga_work/production/patong
Files:
2 edited

Legend:

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

    r6219 r6225  
    6060    print'basic'
    6161    res_factor=4
    62     time_thinning=12
     62    time_thinning=24
    6363    yieldstep=120
    6464if setup =='final':
    6565    print'final'
    6666    res_factor=1
    67     time_thinning=1
     67    time_thinning=4
    6868    #time_thinning=48   
    6969    yieldstep=10
     
    7474# Important to distinguish each run - ensure str(user) is included!
    7575# Note, the user is free to include as many parameters as desired
    76 dir_comment='_'+setup+'_'+str(tide)+'_poly_'+str(user)
     76dir_comment='_'+setup+'_'+str(tide)+'_buildings_'+str(user)
    7777
    7878#------------------------------------------------------------------------------
     
    171171# Initial bounding polygon for data clipping
    172172poly_all = read_polygon(polygons_dir+'poly_all.csv')
    173 res_poly_all = 10000*res_factor
     173res_poly_all = 100000*res_factor
    174174
    175175# Area of Interest 1 elevation from -10m to 20m
     
    179179# Area of Significance 1 elevation from -20m to a 200m buffer of the 20m contour
    180180poly_aos1 = read_polygon(polygons_dir+'aos.csv')
    181 res_aos1 = 2000*res_factor
     181res_aos1 = 700*res_factor
    182182
    183183# Area of Shallow water and coastal land that needs a finer res than 1000000
     184# This is a rectangle.
    184185poly_sw = read_polygon(polygons_dir+'sw.csv')
    185 res_sw = 3000*res_factor
     186res_sw = 6000*res_factor
    186187
    187188
     
    191192building_main_south = read_polygon(polygons_dir+'building_main_south.csv')
    192193building_saddle = read_polygon(polygons_dir+'building_saddle.csv')
     194building_area_polygons = [building_main, building_main_small, building_main_south, building_saddle]
    193195bld_res = 25*res_factor
    194196
     
    220222#------------------------------------------------------------------------------
    221223
    222 #CBD extract ascii grid - cooridnates from patong_1s extent
     224#CBD extract ascii grid - coordinates from patong_1s extent
    223225xminCBD = 417445.1119
    224226xmaxCBD = 425601.7881
  • anuga_work/production/patong/run_patong.py

    r6219 r6225  
    116116domain.set_quantity('friction', project.friction)
    117117print 'elevation'
    118 domain.set_quantity('elevation', 
     118domain.set_quantity('elevation',
    119119                    filename=project.combined_dir_name+'.pts',
     120                    alpha=project.alpha,                   
    120121                    use_cache=True,
    121                     verbose=True,
    122                     alpha=project.alpha)
     122                    verbose=True)
     123
    123124
    124125# Add buildings from file
    125126print 'Reading building polygons'   
    126127building_polygons, building_heights = csv2building_polygons(project.building_polygon_file)
     128                                                            #clipping_polygons=project.building_area_polygons)
    127129
    128130print 'Creating %d building polygons' % len(building_polygons)
    129 def create_polygon_function(building_polygons):
     131def create_polygon_function(building_polygons, geo_reference=None):
    130132    L = []
    131133    for i, key in enumerate(building_polygons):
     
    133135        poly = building_polygons[key]
    134136        elev = building_heights[key]
    135         L.append((poly, elev))#
     137        L.append((poly, elev))
    136138
    137139        buildings = Polygon_function(L, default=0.0,
    138                                      geo_reference=domain.geo_reference)
     140                                     geo_reference=geo_reference)
    139141    return buildings
    140142
    141143buildings = cache(create_polygon_function,
    142144                  building_polygons,
     145                  {'geo_reference': domain.geo_reference},
    143146                  verbose=True)
    144147
    145 print 'Add buildings'
    146 domain.add_quantity('elevation', buildings)
     148print 'Adding buildings'
     149domain.add_quantity('elevation',
     150                    buildings,
     151                    use_cache=False, # FIXME(OLE): This seems to pickup the stage IC??
     152                    verbose=True)
     153
    147154
    148155
Note: See TracChangeset for help on using the changeset viewer.