Changeset 6298


Ignore:
Timestamp:
Feb 9, 2009, 4:26:06 PM (16 years ago)
Author:
jgriffin
Message:

scripts modified to include file_length function

Location:
anuga_work/production/australia_ph2/sydney
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/australia_ph2/sydney/build_boundary_7875.py

    r6290 r6298  
    55Input: order_filename from project.py
    66       event_number needs to be reflected in the project file
    7 Output: creates a sts file and csv files stored in project.boundaries_dir_event.
     7Output: creates a sts file and csv files stored in project.event_sts.
    88The run_sydney.py is reliant on the output of this script.
    99"""
     
    103103
    104104    maxname = 'max_sts_stage.csv'
    105     fid_max = open(project.boundaries_dir_event+sep+maxname,'w')
     105    fid_max = open(project.event_sts+sep+maxname,'w')
    106106    s = 'index, x, y, max_stage \n'
    107107    fid_max.write(s)   
     
    120120
    121121    minname = 'min_sts_stage.csv'
    122     fid_min = open(project.boundaries_dir_event+sep+minname,'w')
     122    fid_min = open(project.event_sts+sep+minname,'w')
    123123    s = 'index, x, y, max_stage \n'
    124124    fid_min.write(s)   
     
    134134
    135135
    136         fid_sts = open(project.boundaries_dir_event+sep+basename+'_'+ str(index)+'.csv', 'w')
     136        fid_sts = open(project.event_sts+sep+basename+'_'+ str(index)+'.csv', 'w')
    137137        s = 'time, stage, xmomentum, ymomentum \n'
    138138        fid_sts.write(s)
     
    152152    return quantities,elevation,time
    153153
    154 quantities,elevation,time=get_sts_gauge_data(os.path.join(project.boundaries_dir_event,project.scenario_name),verbose=False)
     154quantities,elevation,time=get_sts_gauge_data(os.path.join(project.event_sts),verbose=False)
    155155
    156156print len(elevation), len(quantities['stage'][0,:])
  • anuga_work/production/australia_ph2/sydney/comparisons/export_results_max.py

    r6295 r6298  
    2020directory = project_250m.output_dir
    2121
    22 time_dir1 = '20090206_150250_run_final_0_250m_large_jgriffin'
     22time_dir1 = '20090206_152643_run_final_0_250m_large_jgriffin'
    2323#time_dir2 = '20090123_155045_run_final_0_7875_250m_large_jgriffin'
    2424#time_dir3 = '20090123_154945_run_final_0_7875_250m_small_jgriffin'
     
    8080
    8181            name1 = directory+time_dir+sep+project_250m.scenario_name
    82             #name2 = directory+time_dir+sep+project_250m.scenario_name+'_time_52620_0'
    83            # name3 = directory+time_dir+sep+project_250m.scenario_name+'_time_78360_0'
    84 
    85             names = [name1]#, name2] #, name3]
     82 
     83            names = [name1]
    8684     
    8785            asc_name = []   
  • anuga_work/production/australia_ph2/sydney/export_results_max.py

    r6288 r6298  
    2020directory = project_250m.output_dir
    2121
    22 time_dir1 = '20090123_155045_run_final_0_7875_250m_large_jgriffin'
     22time_dir1 = '20090206_150250_run_final_0_250m_large_jgriffin'
    2323#time_dir2 = '20090123_155045_run_final_0_7875_250m_large_jgriffin'
    2424#time_dir3 = '20090123_154945_run_final_0_7875_250m_small_jgriffin'
     
    5050# one or more key strings from var_equations above
    5151#var = ['stage', 'speed','depth']
    52 var = ['elevation']
     52var = ['stage','elevation']
    5353
    5454######
  • anuga_work/production/australia_ph2/sydney/project.py

    r6289 r6298  
    4141# run_scenario script is executed
    4242tide = 0                #0.6
    43 #event_number = 27255   # Java 9.3 worst case for Perth
    44 #event_number = 68693   # Sumatra 9.2
    45 event_number = 27283    # Java 9.3 original
     43event_number = 7875    # Java 9.3 original
    4644alpha = 0.1             # smoothing parameter for mesh
    4745friction=0.01           # manning's friction coefficient
     
    9593# Used in run_busselton,py
    9694# Format for points easting,northing (no header)
    97 ##land_initial_conditions_filename = [['initial_condition_extend.csv', 0],
    98 ##                                    ['initial_condition_comerong_island.csv', 0],
    99 ##                                    ['initial_condition_gabo_island.csv', 0],
    100 ##                                    ['initial_condition_montague_island.csv', 0]]
     95land_initial_conditions_filename = [['initial_condition_extend.csv', 0],
     96                                    ['initial_condition_comerong_island.csv', 0],
     97                                    ['initial_condition_gabo_island.csv', 0],
     98                                    ['initial_condition_montague_island.csv', 0]]
    10199
    102100# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
     
    105103bounding_polygon_filename = 'bounding_polygon.csv'
    106104
     105# INTERIOR REGIONS -  for designing the mesh
     106# Used in run_model.py
     107# Format for points easting,northing (no header)                   
     108##interior_regions_data = [['coast_3km_buffer.csv', 50000]]
     109                         
    107110
    108111# BOUNDING POLYGON
     
    119122# Format easting,northing (no header)
    120123landward_boundary_filename = 'landward_boundary_extend.csv'
     124
     125
    121126
    122127
     
    148153
    149154# The absolute pathname of the mesh, generated in run_busselton.py
    150 meshes = join(meshes_folder, scenario_name, '.msh')
     155meshes = meshes_folder + sep + scenario_name + '.msh'
    151156
    152157# The absolute pathname for the urs order points, used within build_boundary.py
     
    158163
    159164# The absolute pathname for the .sts file, generated in build_boundary.py
    160 event_sts = join(boundaries_folder, str(event_number), scenario_name)
     165event_sts = join(boundaries_folder, str(event_number))
    161166
    162167# The absolute pathname for the output folder names
     
    174179
    175180# Create list of land polygons with initial conditions
    176 ##land_initial_conditions = []
    177 ##for filename, MSL in land_initial_conditions_filename:
     181land_initial_conditions = []
     182for filename, MSL in land_initial_conditions_filename:
     183    polygon = read_polygon(join(polygons_folder, filename))
     184    land_initial_conditions.append([filename, MSL])
     185
     186### Create list of interior polygons with scaling factor
     187interior_regions = []
     188##for filename, maxarea in interior_regions_data:
    178189##    polygon = read_polygon(join(polygons_folder, filename))
    179 ##    land_initial_conditions.append([filename, MSL])
    180 
    181 # Create list of interior polygons with scaling factor
    182 interior_regions = []
    183 #for filename, maxarea in interior_regions_data:
    184 #    polygon = read_polygon(join(polygons_folder, filename))
    185 #    interior_regions.append([polygon, maxarea*scale_factor])
     190##    interior_regions.append([polygon, maxarea*scale_factor])
    186191
    187192# Initial bounding polygon for data clipping
    188193bounding_polygon = read_polygon(join(polygons_folder,
    189194                                     bounding_polygon_filename))
    190 bounding_maxarea = 100000*scale_factor
     195bounding_maxarea = 125000*scale_factor
    191196
    192197# Estimate the number of triangles                     
  • anuga_work/production/australia_ph2/sydney/run_model.py

    r6287 r6298  
    1 """Run a tsunami inundation scenario for Busselton, WA, Australia.
     1"""Run a tsunami inundation scenario for sydney region, NSW, Australia.
    22
    33The scenario is defined by a triangular mesh created from project.polygon, the
    4 elevation data is compiled into a pts file through build_busselton.py and a
     4elevation data is compiled into a pts file through build_sydney.py and a
    55simulated tsunami is generated through an sts file from build_boundary.py.
    66
    77Input: sts file (build_boundary.py for respective event)
    8        pts file (build_busselton.py)
     8       pts file (build_sydney.py)
    99       information from project file
    1010Outputs: sww file stored in project.output_run_time_dir
     
    3232from anuga.interface import create_sts_boundary
    3333from anuga.interface import csv2building_polygons
     34from file_length import file_length
    3435
    3536from anuga.shallow_water.data_manager import start_screen_catcher
     
    7071# Number of boundary segments
    7172N = len(event_sts)-1
     73# Number of landward_boundary points
     74M = file_length(project.landward_boundary)
     75print 'M',M
    7276
    7377# Boundary tags refer to project.landward_boundary
    7478# 4 points equals 5 segments start at N
    75 boundary_tags={'back': [N+1,N+2,N+3,N+4, N+5],
    76                'side': [N,N+6],
     79boundary_tags={'back': range(N+1,N+M),
     80               'side': [N,N+M],
    7781               'ocean': range(N)}
    7882
     
    8084domain = create_domain_from_regions(bounding_polygon_sts,
    8185                                    boundary_tags=boundary_tags,
    82                                     maximum_triangle_area=project.res_poly_all,
     86                                    maximum_triangle_area=project.bounding_maxarea,
    8387                                    interior_regions=project.interior_regions,
    8488                                    mesh_filename=project.meshes,
Note: See TracChangeset for help on using the changeset viewer.