Changeset 5569


Ignore:
Timestamp:
Jul 25, 2008, 8:53:51 AM (16 years ago)
Author:
kristy
Message:

updated scripts for polyline boundary

Location:
anuga_work/production/perth
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/perth/build_boundary.py

    r5551 r5569  
    3434urs_filenames = [os.path.join(dir, basename) for basename in urs_filenames.keys()]
    3535
    36 # Reduce this list slightly
    37 urs_filenames = urs_filenames[:30]
    38 for name in urs_filenames:
    39     print name
     36# AS per David Burbidge email on friday 4th July the mag 9.3 event
     37# has 1m worth of slip on each sub fault therefore mutliple each unit
     38# soucre by the slip (10.4544) and sum the 44 time series together to
     39# get the time series for this event at the points on your boundary.
    4040
    4141weights=10.4544*ones(len(urs_filenames),Float)
    4242
    43 base_name=project.scenario_name
    44 order_filename=os.path.join(project.boundaries_dir, 'boundary_ordering.txt')
     43scenario_name=project.scenario_name
     44order_filename=os.path.join(project.boundaries_dir, 'thinned_bound_order.txt')
    4545
    4646print 'reading', order_filename
    4747# Create ordered sts file
    4848print 'creating sts file'
    49 urs2sts(urs_filenames,basename_out=base_name,
     49
     50urs2sts(urs_filenames,basename_out=scenario_name,
    5051        ordering_filename=order_filename,
    5152        weights=weights,
     
    5455
    5556# Read in boundary from ordered sts file
    56 urs_boundary=create_sts_boundary(base_name)
     57urs_boundary_polygon=create_sts_boundary(scenario_name)
    5758
     59
     60
     61
     62
     63
     64
  • anuga_work/production/perth/export_results.py

    r5498 r5569  
    88#time_dir = '20080530_170833_run_final_0.6_exmouth_kvanputt'
    99#time_dir = '20080619_115643_run_trial_0.6_exmouth_kvanputt'
    10 time_dir = '20080714_095738_run_final_0.6_exmouth_kvanputt'
    11 
     10#time_dir = '20080714_095738_run_final_0.6_exmouth_kvanputt'
     11#time_dir = '20080714_134935_run_final_0_exmouth_kvanputt'
     12time_dir = '20080718_112228_run_final_0_exmouth_kvanputt'
    1213
    1314cellsize = 25
  • anuga_work/production/perth/get_timeseries.py

    r5431 r5569  
    1616
    1717
    18 timestamp='20080619_115643_run_trial_0.6_exmouth_kvanputt'
     18timestamp='20080724_121200_run_trial_0.6_polyline_alpha0.1_kvanputt'
    1919
    2020filename=project.output_dir+timestamp+sep+project.scenario_name+'.sww'
  • anuga_work/production/perth/project.py

    r5558 r5569  
    1010#from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees, convert_points_from_latlon_to_utm
    1111from anuga.utilities.system_tools import get_user_name, get_host_name
     12from anuga.shallow_water.data_manager import urs2sts,create_sts_boundary
     13from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
    1214
    1315# file and system info
     
    3638tide = 0.6
    3739
    38 alpha = 0.2
     40alpha = 0.1
    3941friction=0.01
    4042starttime=0
    4143finaltime=80000
    4244export_cellsize=25
    43 setup='trial'
     45setup='final'
    4446source='polyline'
    4547
     
    160162buildings_filename_out = 'Perth_res_Project_modified.csv'
    161163
    162 ###############################
    163 # Domain definitions
    164 ###############################
    165 from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
    166 
    167 poly_all = read_polygon(polygons_dir+'poly_all.csv')
    168 res_poly_all = 100000*res_factor
    169 
    170 #refzone = 50
     164
    171165
    172166###############################
    173167# Interior region definitions
    174168###############################
     169
     170#Initial bounding polygon for data clipping
     171poly_all = read_polygon(polygons_dir+'poly_all.csv')
     172res_poly_all = 100000*res_factor
    175173
    176174#Polygon designed by 20m contours, or 3km from the coastline
     
    217215                     ,[poly_rottnest_ex, res_rottnest_ex], [poly_garden, res_garden]]
    218216
    219 boundary_tags={'back': [0,1,2], 'side': [3,7],'ocean': [4, 5, 6]}
    220 
     217   
    221218trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
    222 
    223219print 'min number triangles', trigs_min
     220   
    224221
    225222poly_mainland = read_polygon(polygons_dir+'initial_condition.csv')
  • anuga_work/production/perth/run_perth.py

    r5557 r5569  
    3030from anuga.shallow_water import Field_boundary
    3131from Numeric import allclose
    32 from anuga.shallow_water.data_manager import export_grid
     32from anuga.shallow_water.data_manager import export_grid, create_sts_boundary
    3333
    3434from anuga.pmesh.mesh_interface import create_mesh_from_regions
     
    3939from anuga.damage_modelling.inundation_damage import add_depth_and_momentum2csv, inundation_damage
    4040from anuga.fit_interpolate.benchmark_least_squares import mem_usage
     41from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
    4142
    4243# Application specific imports
     
    7071    print "Processor Name:",get_processor_name()
    7172
    72     # filenames
    73 #    meshes_dir_name = project.meshes_dir_name+'.msh'
    74 
    75     # creates copy of code in output dir
    76     print 'min triangles', project.trigs_min,
    77     print 'Note: This is generally about 20% less than the final amount'
    78 
     73   
     74    #-----------------------------------------------------------------------
     75    # Domain definitions
     76    #-----------------------------------------------------------------------
     77
     78    # Read in boundary from ordered sts file
     79    urs_bounding_polygon=create_sts_boundary(project.scenario_name)
     80
     81    # Reading the landward defined points, this incorporates the original clipping
     82    # polygon minus the 100m contour
     83    landward_bounding_polygon = read_polygon(project.polygons_dir+'landward_bounding_polygon.txt')
     84
     85    # Combine sts polyline with landward points
     86    bounding_polygon = urs_bounding_polygon + landward_bounding_polygon
     87   
     88    # counting segments
     89    N = len(urs_bounding_polygon)-1
     90    boundary_tags={'back': [N+1,N+2,N+3], 'side': [N,N+4],'ocean': range(N)}
     91
     92   
    7993    #--------------------------------------------------------------------------
    8094    # Create the triangular mesh based on overall clipping polygon with a
     
    90104        print 'start create mesh from regions'
    91105
    92         create_mesh_from_regions(project.poly_all,
    93                              boundary_tags=project.boundary_tags,
     106        create_mesh_from_regions(bounding_polygon,
     107                             boundary_tags=boundary_tags,
    94108                             maximum_triangle_area=project.res_poly_all,
    95109                             interior_regions=project.interior_regions,
     
    168182    print 'domain id', id(domain)
    169183   
    170 
     184    boundary_urs_out=project.boundaries_dir_name
     185   
    171186    print 'Available boundary tags', domain.get_boundary_tags()
    172187    Bf = File_boundary(boundary_urs_out+'.sts',
     
    174189                   use_cache=True,
    175190                   verbose = True,
    176                    boundary_polygon=project.bounding_polygon)
     191                   boundary_polygon=bounding_polygon)
    177192
    178193    Br = Reflective_boundary(domain)
Note: See TracChangeset for help on using the changeset viewer.