Index: /anuga_work/production/busselton/standardised_version/build_urs_boundary.py
===================================================================
--- /anuga_work/production/busselton/standardised_version/build_urs_boundary.py	(revision 6328)
+++ /anuga_work/production/busselton/standardised_version/build_urs_boundary.py	(revision 6329)
@@ -22,4 +22,5 @@
 #-------------------------------------------------------------------------------
 def get_sts_gauge_data(filename, verbose=False):
+    print 'get_sts_gauge_data: filename=%s' % filename
     fid = NetCDFFile(filename+'.sts', 'r')      #Open existing file for read
     permutation = fid.variables['permutation'][:]
@@ -87,19 +88,18 @@
 ##
 # @brief Build boundary STS files from one or more MUX files.
-# @param mux_dir Directory containing the MUX files.
-# @param event_file Path to meta-file containing mux files+weight data.
+# @param event_file Name of mux meta-file or single mux stem.
 # @param output_dir Directory to write STS data to.
 # @note 'event_file' is produced by EventSelection.
-def build_urs_boundary(mux_dir, event_file, output_dir):
+def build_urs_boundary(event_file, output_dir):
     '''Build a boundary STS file from a set of MUX files.'''
 
-    print 'build_urs_boundary: mux_dir=%s' % mux_dir
     print 'build_urs_boundary: event_file=%s' % event_file
     print 'build_urs_boundary: output_dir=%s' % output_dir
 
     # if we are using an EventSelection multi-mux file
-    if project.multi_mux:    
-        # get the mux+weight data from the event file
-        mux_event_file = os.path.join(mux_dir, event_file)
+    if project.multi_mux:
+        print 'using multi-mux file'
+        # get the mux+weight data from the meta-file (in <boundaries>)
+        mux_event_file = os.path.join(project.boundaries_folder, event_file)
         try:
             fd = open(mux_event_file, 'r')
@@ -130,5 +130,5 @@
             split_index = muxname.index('.grd')
             muxname = muxname[:split_index+len('.grd')]
-            muxname = os.path.join(mux_dir, muxname)
+            muxname = os.path.join(project/mux_data_folder, muxname)
             mux_filenames.append(muxname)
         
@@ -144,14 +144,19 @@
                 verbose=True)
     else:                           # a single mux stem file, assume 1.0 weight
-        mux_filenames = [os.path.join(mux_dir, event_file)]
+        print 'using single-mux file'
+        mux_filenames = [os.path.join(project.mux_data_folder, event_file)]
 
         weight_factor = 1.0
         mux_weights = weight_factor*num.ones(len(mux_filenames), num.Float)
             
-        order_filename = project.order_filename_dir
+        order_filename = project.urs_order
 
         print 'reading', order_filename
         # Create ordered sts file
         print 'creating sts file'
+        print 'mux_filenames=%s' % str(mux_filenames)
+        print 'output_dir=%s' % str(output_dir)
+        print 'mux_weights=%s' % str(mux_weights)
+        print 'project.tide=%s' % str(project.tide)
         urs2sts(mux_filenames,
                 basename_out=output_dir,
Index: /anuga_work/production/busselton/standardised_version/file_length.py
===================================================================
--- /anuga_work/production/busselton/standardised_version/file_length.py	(revision 6328)
+++ /anuga_work/production/busselton/standardised_version/file_length.py	(revision 6329)
@@ -7,5 +7,13 @@
 Returns: number of lines in file
 """
+
 def file_length(in_file):
+    '''Function to return the number of lines in a file.
+
+    in_file: Path to the file to get number of lines in.
+    
+    Returns: number of lines in file
+    '''
+    
     fid = open(in_file)
     data = fid.readlines()
Index: /anuga_work/production/busselton/standardised_version/project.py
===================================================================
--- /anuga_work/production/busselton/standardised_version/project.py	(revision 6328)
+++ /anuga_work/production/busselton/standardised_version/project.py	(revision 6329)
@@ -27,5 +27,5 @@
 # One or all can be changed each time the run_model script is executed
 tide = 0                # difference between MSL and HAT
-event_number = 26633    # the event number
+event_number = 27197    # the event number
 alpha = 0.1             # smoothing parameter for mesh
 friction=0.01           # manning's friction coefficient
@@ -119,7 +119,7 @@
 # MUX input filename.
 # If a meta-file from EventSelection is used, set 'multi-mux' to True.
-# If a single MUX stem filename is used, set 'multi-mux' to False.
-mux_input_filename = 'event_026633.list'
-multi_mux = True
+# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
+mux_input_filename = 'Java-0016-z.grd'
+multi_mux = False
 
 #-------------------------------------------------------------------------------
@@ -175,5 +175,5 @@
 gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
 build_time = time + '_build'
-run_time = time + '_run'
+run_time = time + '_run_'
 
 # create paths generated from environment variables.
@@ -193,5 +193,5 @@
 # MUX data files
 # Directory containing the MUX data files to be used with EventSelection.
-mux_data_folder = '/nas/gemd/georisk_models/tsunami/models/PTHA/Australia/mux'
+mux_data_folder = join(muxhome, 'mux')
 
 #-------------------------------------------------------------------------------
Index: /anuga_work/production/busselton/standardised_version/run_model.py
===================================================================
--- /anuga_work/production/busselton/standardised_version/run_model.py	(revision 6328)
+++ /anuga_work/production/busselton/standardised_version/run_model.py	(revision 6329)
@@ -62,6 +62,6 @@
 
 # Create the STS file
-bub.build_urs_boundary(project.mux_data_folder,
-                       project.mux_input,
+print 'project.mux_data_folder=%s' % project.mux_data_folder
+bub.build_urs_boundary(project.mux_input_filename,
                        os.path.join(project.event_folder,
                                     project.scenario_name))
@@ -78,13 +78,15 @@
 
 # Number of boundary segments
-N = len(event_sts) - 1
+num_ocean_segments = len(event_sts) - 1
 # Number of landward_boundary points
-M = file_length(project.landward_boundary)
+num_land_points = file_length(project.landward_boundary)
 
 # Boundary tags refer to project.landward_boundary
 # 4 points equals 5 segments start at N
-boundary_tags={'back': range(N+1,N+M),
-               'side': [N,N+M],
-               'ocean': range(N)}
+boundary_tags={'back': range(num_ocean_segments+1,
+                             num_ocean_segments+num_land_points),
+               'side': [num_ocean_segments,
+                        num_ocean_segments+num_land_points],
+               'ocean': range(num_ocean_segments)}
 
 # Build mesh and domain
