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

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

new script for perth to build boundary information based on urs mux2 polyline implementation

File size: 1.3 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######################################
16dir= os.path.join(project.muxhome,'mux')
17print dir 
18prefix=os.path.join(dir,'Java-00')
19suffix='-z.grd'
20
21urs_filenames=[]
22for i in range(49):
23    if i<10:
24        urs_filenames.append(prefix+'0'+str(i)+suffix)
25    else:
26        urs_filenames.append(prefix+str(i)+suffix)
27print urs_filenames
28
29weights=10.4544*ones(len(urs_filenames),Float)
30
31base_name='tide_polyline'
32order_filename='boxingday_boundary_order.txt'
33
34# Create ordered sts file
35print 'creating sts file'
36urs2sts(urs_filenames,basename_out=base_name,
37ordering_filename=order_filename,
38weights=weights,
39mean_stage=project.tide,
40verbose=False)
41
42# Read in boundary from ordered sts file
43urs_boundary=create_sts_boundary(base_name)
44
Note: See TracBrowser for help on using the repository browser.