source: anuga_work/production/busselton/build_boundary.py @ 5575

Last change on this file since 5575 was 5575, checked in by kristy, 16 years ago

Addition of Polyline information with sts files

File size: 1.8 KB
Line 
1from anuga.utilities.numerical_tools import ensure_numeric
2from Scientific.IO.NetCDF import NetCDFFile
3from Numeric import asarray,transpose,sqrt,argmax,argmin,arange,Float,\
4    compress,zeros,fabs,allclose,ones
5from anuga.utilities.polygon import inside_polygon,read_polygon
6from os import sep
7from time import localtime, strftime, gmtime
8from anuga.shallow_water.data_manager import urs2sts,create_sts_boundary
9import os
10import project
11
12
13######################################
14# Create urs boundary from mux2files #
15######################################
16
17#print project.muxhome
18dir=os.path.join(project.muxhome,'mux')
19#print dir
20prefix=os.path.join(dir,'Java-00')
21suffix='-z.grd'
22
23urs_filenames={}
24for filename in os.listdir(dir):
25    basename = filename[:-7]
26
27    urs_filenames[basename] = True
28
29
30# Make list of basenames 
31urs_filenames = [os.path.join(dir, basename) for basename in urs_filenames.keys()]
32
33# AS per David Burbidge email on friday 4th July the mag 9.3 event
34# has 1m worth of slip on each sub fault therefore mutliple each unit
35# soucre by the slip (10.4544) and sum the 44 time series together to
36# get the time series for this event at the points on your boundary.
37
38weights=10.4544*ones(len(urs_filenames),Float)
39
40scenario_name=project.scenario_name
41order_filename=os.path.join(project.boundaries_dir, 'thinned_bounding_order.txt')
42
43print 'reading', order_filename
44# Create ordered sts file
45print 'creating sts file'
46
47urs2sts(urs_filenames,
48        basename_out=os.path.join(project.boundaries_dir,scenario_name),
49        ordering_filename=order_filename,
50        weights=weights,
51        mean_stage=project.tide,
52        verbose=True)
53
54# Read in boundary from ordered sts file
55urs_boundary_polygon=create_sts_boundary(scenario_name)
56
57
58
59
60
61
62
Note: See TracBrowser for help on using the repository browser.