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

Last change on this file since 5578 was 5578, checked in by kristy, 14 years ago

updated sts 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
23urs_filenames={}
24for filename in os.listdir(dir):
25    basename = filename[:-7]
26
27    urs_filenames[basename] = True
28
29# Make list of basenames 
30urs_filenames = [os.path.join(dir, basename) for basename in urs_filenames.keys()]
31
32# AS per David Burbidge email on friday 4th July the mag 9.3 event
33# has 1m worth of slip on each sub fault therefore mutliple each unit
34# soucre by the slip (10.4544) and sum the 44 time series together to
35# get the time series for this event at the points on your boundary.
36
37weights=10.4544*ones(len(urs_filenames),Float)
38
39scenario_name=project.scenario_name
40order_filename=os.path.join(project.boundaries_dir, 'thinned_bound_order.txt')
41
42print 'reading', order_filename
43# Create ordered sts file
44print 'creating sts file'
45
46urs2sts(urs_filenames,
47        basename_out=os.path.join(project.boundaries_dir,scenario_name),
48        ordering_filename=order_filename,
49        weights=weights,
50        mean_stage=project.tide,
51        verbose=True)
52
53
54
55
56
Note: See TracBrowser for help on using the repository browser.