source: anuga_work/production/carnarvon/get_runup.py @ 6068

Last change on this file since 6068 was 6068, checked in by kristy, 15 years ago

addition of scripts copied from Perth and manipulated for Carnarvon, note change of zone to 49

File size: 1.8 KB
Line 
1# Standard modules
2from os import sep
3import os
4from os.path import dirname, basename
5from os import mkdir, access, F_OK
6from shutil import copy
7import time
8import sys
9# Related major packages
10from anuga.shallow_water.data_manager import get_maximum_inundation_data
11       
12# Application specific imports
13import project  # Definition of file names and polygons
14import csv
15directory = project.output_dir
16
17time_dir1 = '20081202_084220_run_final_1_27283_alpha0.1_kvanputt'
18time_dir2 = '20081202_084202_run_final_1_27255_alpha0.1_kvanputt'
19time_dir3 = '20081202_084132_run_final_1_68693_alpha0.1_kvanputt'
20time_dir4 = '20081202_084025_run_final_0_68693_alpha0.1_kvanputt'
21time_dir5 = '20081202_083932_run_final_0_27255_alpha0.1_kvanputt'
22time_dir6 = '20081201_103449_run_final_0_27283_alpha0.1_kvanputt'
23
24time_dirs = [time_dir1, time_dir2, time_dir3, time_dir4, time_dir5, time_dir6]
25
26area_dictionary = {'CBD': project.poly_aoi1}
27
28area = ['CBD'] 
29
30for time_dir in time_dirs:
31
32    name = directory+time_dir+sep+project.scenario_name
33
34    out_file = name+'_runup.csv'
35    output_file = open(out_file, 'w')
36    s = 'area,q,x,y\n' 
37    output_file.write(s)
38    print 'name ',name
39
40    for which_area in area:
41        if which_area not in area_dictionary:
42            print 'Unrecognized variable name: %s' % which_area
43            break
44
45        polygon = area_dictionary[which_area]
46       
47        print 'Which area ',which_area
48
49        q, loc = get_maximum_inundation_data (name+'.sww', polygon = polygon, verbose= True)
50
51        print '%s, %.6f, %.6f, %.6f\n' %(str(which_area), q, loc[0],loc[1])
52        s = '%s, %.6f, %.6f, %.6f\n' %(str(which_area), q, loc[0],loc[1])
53
54        output_file.write(s)
55
56        print 'output file printed to: %s' %out_file
57    output_file.close()
Note: See TracBrowser for help on using the repository browser.