Index: uga_work/production/MOST_example/project.py
===================================================================
--- /anuga_work/production/MOST_example/project.py	(revision 3601)
+++ 	(revision )
@@ -1,252 +1,0 @@
-"""Common filenames and locations for topographic data, meshes and outputs.
-Also includes origin for slump scenario.
-"""
-
-from os import sep, environ, getenv, getcwd
-from os.path import expanduser
-#from anuga.utilities.polygon import read_polygon
-import sys
-
-from os import mkdir, access, F_OK
-
-from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees
-
-from time import localtime, strftime, gmtime
-                
-#Making assumptions about the location of scenario data
-state = 'western_australia'
-scenario_dir_name = 'onslow_tsunami_scenario_2006'
-
-# 250m data to be provided
-coarsename = 'onsl_bathydem250' # get from Neil/Ingo (DEM or topo data)
-
-# 30m data to be provided
-onshore_name_dted = 'onslow_onshore_30m_dted2' # get from Neil/Ingo (DEM or topo data)
-
-# 20m data to be provided
-onshore_name_dli = 'onslow_onshore_20m_dli' # get from Neil/Ingo (DEM or topo data) 
-
-coast_name = 'onslow_coast'
-islands_name = 'onslow_islands_dted2'
-offshore_name = 'onslow_offshore_points'
-
-boundary_basename = 'SU-AU_clip'
-
-#swollen/ all data output
-basename = 'source'
-
-codename = 'project.py'
-
-if sys.platform == 'win32':
-    home = getenv('INUNDATIONHOME') 
-    home = 'O:'+sep+'2'+sep+'cit'+sep+'inundation'+sep+'data'     
-#    python_home = getenv('PWD')     
-#    home = environ['INUNDATIONHOME']     #Sandpit's parent dir
-    user = getenv('USERPROFILE')
-#    user = basename(user_path)
-    
-else:    
-    home = sep+'d'+sep+'cit'+sep+'2'+sep+'cit'+sep+'inundation'+sep+'data'
-    user = getenv('LOGNAME')
-    print 'USER:', user
-home = '.'
-#Derive subdirectories and filenames
-#time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
-local_time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
-statedir = home+sep+state
-scenariodir = home+sep+state+sep+scenario_dir_name
-anugadir = scenariodir+sep+'anuga'
-meshdir = scenariodir+sep+'anuga'+sep+'meshes'+sep
-datadir = scenariodir+sep+'anuga'+sep+'topographies'+sep
-gaugedir = scenariodir+sep+'anuga'+sep+'gauges'+sep
-polygondir = scenariodir+sep+'anuga'+sep+'polygons'+sep
-boundarydir = scenariodir+sep+'anuga'+sep+'boundaries'+sep
-#output dir without time
-outputdir = scenariodir+sep+'anuga'+sep+'outputs'+sep
-tidedir = scenariodir+sep+'anuga'+sep+'tide_data'+sep
-comparereportdir = '..'+sep+'..'+sep+'documentation'+sep+'experimentation'+sep+'boundary_ANUGA_MOST'+sep+'report'
-
-outputtimedir = outputdir + local_time + sep
-
-
-
-# creates copy of output dir structure, if it doesn't exist
-if not access(statedir,F_OK):
-    mkdir (statedir)
-
-if not access(scenariodir,F_OK):
-    mkdir (scenariodir)
-   
-if not access(anugadir,F_OK):
-    mkdir (anugadir)
-     
-#if not access(meshdir,F_OK):
-#    mkdir (meshdir)
-
-if not access(outputdir,F_OK):
-    mkdir (outputdir)
-        
-if not access(outputtimedir,F_OK):
-    mkdir (outputtimedir)
-print'bound', boundarydir
-
-#gauge_filename = gaugedir + 'onslow_gauges.xya'
-#for MOST
-gauge_filename = gaugedir + 'gauge_location_onslow.csv'
-gauges50 = gaugedir + '50_gauges.xya'
-gauge_comparison = gaugedir + 'MOST_comparison_gauges.xya'
-gauge_comparison_3d = gaugedir + 'MOST_comparison_gauges_3d.xya'
-community_filename = gaugedir + 'CHINS_v2.csv'
-community_scenario = gaugedir + 'community_onslow.csv'
-#buildings_filename = gaugedir + 'onslow_res.csv'
-buildings_filename = gaugedir + 'extra_points_nbed.csv'
-#buildings_filename_out = gaugedir + 'onslow_res_modified.csv'
-buildings_filename_damage_out = 'extra_points_nbed_modified.csv'
-
-gaugetimeseries = gaugedir + 'onslow'
-
-tidal_filename = tidedir + 'onsl.txt'
-tidal_outname = tidedir + 'max_min.txt'
-
-# boundary source data
-#MOST_dir = 'f:'+sep+'3'+sep+'ehn'+sep+'users'+sep+'davidb'+sep+'tsunami'+sep+'WA_project'+sep+'SU-AU_90'+sep+'most_2'+sep+'detailed'+sep
-
-codedir = getcwd()+sep
-                                
-codedirname = codedir + 'project.py'
-
-#meshname = meshdir + basename
-meshname = outputtimedir + 'mesh_' + basename
-print 'meshname',meshname
-coarsedemname = datadir + coarsename
-
-onshore_dem_name = datadir + onshore_name_dli
-
-offshore_dem_name = datadir + offshore_name
-coast_dem_name = datadir + coast_name
-islands_dem_name = datadir + islands_name
-combined_dem_name = datadir + 'onslow_combined_elevation'
-
-outputname = outputtimedir + basename  #Used by post processing
-
-#!gauge_filename = outputdir + 'onslow_gauges.xya'
-#!gauge_outname = outputdir + 'gauges_max_output.xya'
-
-# clipping region to make DEM (pts file) from fine elevation data
-eastingmin = 240000
-eastingmax = 340000
-northingmin = 7580000
-northingmax = 7700000
-
-south = degminsec2decimal_degrees(-22,15,0)
-north = degminsec2decimal_degrees(-20,30,0)
-west = degminsec2decimal_degrees(114,15,0)
-east = degminsec2decimal_degrees(115,50,0)
-'''
-# region for visualisation
-eminviz = 260000
-emaxviz = 320000
-nminviz = 7590000
-nmaxviz = 7630000
-'''
-# region to export
-
-e_min_area = 300000
-e_max_area = 310000
-n_min_area = 7600000
-n_max_area = 7610000
-
-#Georeferencing
-from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees
-
-refzone = 50
-
-#Updated Main Domain of Onslow: first run NB 6/4/06
-d0 = [310000, 7690000]
-d1 = [280000, 7690000]
-d2 = [270000, 7645000]
-d3 = [240000, 7625000]
-d4 = [270000, 7580000]
-d5 = [300000, 7590000]
-d6 = [340000, 7610000]
-
-polyAll = [d0, d1, d2, d3, d4, d5, d6]
-
-#Interior region - Onslow town
-
-#first run!
-#i0 = [304000, 7608000]
-#i1 = [302000, 7605000]
-#i2 = [303000, 7602000]
-#i3 = [305000, 7601000]
-#i4 = [309000, 7603000]
-#i5 = [307000, 7606500]
-
-#refined run
-#i0 = [304000, 7607000]
-#i1 = [302000, 7605000]
-#i2 = [304000, 7603000]
-#i3 = [307000, 7602000]
-#i4 = [309000, 7603000]
-#i5 = [307000, 7606000]
-
-#for visualisation
-#i0 = [304000, 7609000]
-#i1 = [301500, 7605000]
-#i2 = [304000, 7603000]
-#i3 = [307000, 7602000]
-#i4 = [309000, 7603000]
-#i5 = [311000, 7607000]
-
-#i0 = [304000, 7608000]
-i0 = [304000, 7607000]
-i1 = [302000, 7605000]
-#i2 = [303000, 7602000]
-i2 = [304000, 7603000]
-#i3 = [305000, 7601000]
-i3 = [307000, 7602000]
-i4 = [309000, 7603000]
-#i5 = [307000, 7606500]
-i5 = [307000, 7606000]
-
-
-poly_onslow = [i0, i1, i2, i3, i4, i5]
-
-#Thevenard Island
-j0 = [294000, 7629000]
-j1 = [285000, 7625000]
-j2 = [294000, 7621000]
-j3 = [299000, 7625000]
-
-poly_thevenard = [j0, j1, j2, j3]
-
-'''
-# Direction Is
-k0 = [309000, 7619000]
-k1 = [304000, 7619000]
-k2 = [304000, 7616500]
-k3 = [309000, 7616500]
-
-poly_direction = [k0, k1, k2, k3]
-'''
-
-#med res around onslow
-l0 = [300000, 7610000]
-l1 = [285000, 7600000]
-l2 = [300000, 7597500]
-l3 = [310000, 7600000]
-l4 = [315000, 7610000]
-#l5 = [310000, 7612500]
-
-#poly_coast = [l0, l1, l2, l3, l4, l5]
-poly_coast = [l0, l1, l2, l3, l4]
-
-#general coast and local area to onslow region
-m0 = [270000, 7581000]
-m1 = [300000, 7591000]
-m2 = [339000, 7610000]
-m3 = [330000, 7630000]
-m4 = [290000, 7640000]
-m5 = [260000, 7600000]
-
-poly_region = [m0, m1, m2, m3, m4, m5]
Index: uga_work/production/MOST_example/run_onslow.py
===================================================================
--- /anuga_work/production/MOST_example/run_onslow.py	(revision 3601)
+++ 	(revision )
@@ -1,152 +1,0 @@
-"""Script for running a tsunami inundation scenario for Onslow, WA, Australia.
-
-Source data such as elevation and boundary data is assumed to be available in
-directories specified by project.py
-The output sww file is stored in project.outputdir 
-
-The scenario is defined by a triangular mesh created from project.polygon,
-the elevation data and a simulated submarine landslide.
-
-Ole Nielsen and Duncan Gray, GA - 2005 and Nick Bartzis, GA - 2006
-"""
-
-
-#-------------------------------------------------------------------------------# Import necessary modules
-#-------------------------------------------------------------------------------
-
-# Standard modules
-import os
-import time
-
-# Related major packages
-from anuga.pyvolution.shallow_water import Domain, Reflective_boundary, \
-                            Dirichlet_boundary, Time_boundary, File_boundary
-from anuga.pyvolution.data_manager import convert_dem_from_ascii2netcdf, dem2pts
-from anuga.pyvolution.combine_pts import combine_rectangular_points_files 
-from anuga.pyvolution.pmesh2domain import pmesh_to_domain_instance
-from anuga.fit_interpolate.fit import fit_to_mesh_file
-
-from anuga.caching import cache
-
-# Application specific imports
-import project                 # Definition of file names and polygons
-from smf import slump_tsunami  # Function for submarine mudslide 
-
-from shutil import copy
-from os import mkdir, access, F_OK
-
-from anuga.geospatial_data.geospatial_data import *
-
-#-------------------------------------------------------------------------------
-# Preparation of topographic data
-#
-# Convert ASC 2 DEM 2 PTS using source data and store result in source data
-# Do for coarse and fine data
-# Fine pts file to be clipped to area of interest
-#-------------------------------------------------------------------------------
-
-# filenames
-coarsedemname = project.coarsedemname
-
-onshore_dem_name = project.onshore_dem_name
-
-offshore_points = project.offshore_dem_name
-
-meshname = project.meshname+'.tsh'
-
-source_dir = project.boundarydir
-
-# creates copy of code in output dir
-if access(project.outputdir,F_OK) == 0 :
-    mkdir (project.outputdir)
-copy (project.codedirname, project.outputdir + project.codename)
-copy (project.codedir + 'run_onslow.py', project.outputdir + 'run_onslow.py')
-
-
-
-#-------------------------------------------------------------------------------                                 
-# Setup computational domain
-#-------------------------------------------------------------------------------                                 
-mesh_elevname = 'mesh_source_elv.msh'
-domain = pmesh_to_domain_instance(mesh_elevname, Domain,
-                                  use_cache = True,
-                                  verbose = True)
-
-print 'Number of triangles = ', len(domain)
-print 'The extent is ', domain.get_extent()
-print domain.statistics()
-
-domain.set_name(project.basename)
-domain.set_datadir(project.outputdir)
-domain.set_quantities_to_be_stored(['stage'])
-
-
-#-------------------------------------------------------------------------------                                 
-# Setup initial conditions
-#-------------------------------------------------------------------------------
-
-tide = 0.
-
-domain.set_quantity('stage', tide)
-domain.set_quantity('friction', 0.0) 
-print 'hi1'
-
-#-------------------------------------------------------------------------------                                 
-# Setup boundary conditions (all reflective)
-#-------------------------------------------------------------------------------
-
-from anuga.pyvolution.data_manager import ferret2sww
-
-south = project.south 
-north = project.north
-west = project.west
-east = project.east
-
-cache(ferret2sww,
-      (project.boundary_basename,
-       project.boundary_basename), 
-      {'verbose': True,
-       'minlat': south,
-       'maxlat': north,
-       'minlon': west,
-       'maxlon': east,
-       'origin': domain.geo_reference.get_origin(),
-       'mean_stage': tide,
-       'zscale': 1,                 #Enhance tsunami
-       'fail_on_NaN': False,
-       'inverted_bathymetry': True},
-      #evaluate = True,
-       verbose = True)
-
-
-print 'Available boundary tags', domain.get_boundary_tags()
-
-Bf = File_boundary(project.boundary_basename + '.sww', 
-                    domain, verbose = True)
-Br = Reflective_boundary(domain)
-Bd = Dirichlet_boundary([tide,0,0])
-
-
-# 7 min square wave starting at 1 min, 6m high
-Bw = Time_boundary(domain = domain,
-                   f=lambda t: [(60<t<480)*6, 0, 0])
-
-domain.set_boundary( {'top': Bf, 'topleft': Bf,
-                             'left': Br, 'bottom': Br,
-                             'bottomright': Br, 'topright': Bf,
-                      'exterior':Bf} )
-
-
-#-------------------------------------------------------------------------------                                 
-# Evolve system through time
-#-------------------------------------------------------------------------------
-import time
-t0 = time.time()
-
-for t in domain.evolve(yieldstep = 50, finaltime = 1000): 
-    domain.write_time()
-    domain.write_boundary_statistics(tags = 'top')     
-    
-print 'That took %.2f seconds' %(time.time()-t0)
-
-print 'finished'
