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

Last change on this file since 5468 was 5468, checked in by ole, 14 years ago

update location of ordering text file for perth scenario


File size: 1.4 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 i in range(49):
25    if i<10:
26        urs_filenames.append(prefix+'0'+str(i)+suffix)
27    else:
28        urs_filenames.append(prefix+str(i)+suffix)
29print urs_filenames
30
31weights=10.4544*ones(len(urs_filenames),Float)
32
33base_name=project.scenario_name
34order_filename=os.path.join(project.boundaries_dir,'boundary_ordering.txt')
35
36# Create ordered sts file
37print 'creating sts file'
38urs2sts(urs_filenames,basename_out=base_name,
39        ordering_filename=order_filename,
40        weights=weights,
41        mean_stage=project.tide,
42        verbose=False)
43
44# Read in boundary from ordered sts file
45urs_boundary=create_sts_boundary(base_name)
46
Note: See TracBrowser for help on using the repository browser.