source: anuga_work/production/perth/build_boundary.py @ 5569

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

updated scripts for polyline boundary

File size: 1.7 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
23
24
25
26urs_filenames={}
27for filename in os.listdir(dir):
28    basename = filename[:-7]
29
30    urs_filenames[basename] = True
31
32
33# Make list of basenames 
34urs_filenames = [os.path.join(dir, basename) for basename in urs_filenames.keys()]
35
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.
40
41weights=10.4544*ones(len(urs_filenames),Float)
42
43scenario_name=project.scenario_name
44order_filename=os.path.join(project.boundaries_dir, 'thinned_bound_order.txt')
45
46print 'reading', order_filename
47# Create ordered sts file
48print 'creating sts file'
49
50urs2sts(urs_filenames,basename_out=scenario_name,
51        ordering_filename=order_filename,
52        weights=weights,
53        mean_stage=project.tide,
54        verbose=True)
55
56# Read in boundary from ordered sts file
57urs_boundary_polygon=create_sts_boundary(scenario_name)
58
59
60
61
62
63
64
Note: See TracBrowser for help on using the repository browser.