Index: /trunk/anuga_core/source/anuga/__init__.py
===================================================================
--- /trunk/anuga_core/source/anuga/__init__.py	(revision 7813)
+++ /trunk/anuga_core/source/anuga/__init__.py	(revision 7814)
@@ -96,5 +96,5 @@
 # File conversion utilities
 #-----------------------------
-from anuga.file_conversion.file_conversion import sww2obj, dat2obj, \
+from anuga.file_conversion.file_conversion import sww2obj, \
                     timefile2netcdf, tsh2sww
 from anuga.file_conversion.urs2nc import urs2nc
Index: /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_generic_boundary_conditions.py
===================================================================
--- /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_generic_boundary_conditions.py	(revision 7813)
+++ /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_generic_boundary_conditions.py	(revision 7814)
@@ -415,5 +415,5 @@
         from anuga.file_conversion.file_conversion import timefile2netcdf
         
-        timefile2netcdf(filename, quantity_names = ['stage', 'xmomentum'])
+        timefile2netcdf(filename+'.txt', quantity_names = ['stage', 'xmomentum'])
 
         
Index: /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_util.py
===================================================================
--- /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_util.py	(revision 7813)
+++ /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_util.py	(revision 7814)
@@ -85,5 +85,5 @@
 
         #Convert ASCII file to NetCDF (Which is what we really like!)
-        timefile2netcdf(filename)
+        timefile2netcdf(filename+'.txt')
 
 
@@ -996,5 +996,5 @@
 
         #Convert ASCII file to NetCDF (Which is what we really like!)
-        timefile2netcdf(filename)
+        timefile2netcdf(filename+'.txt')
 
 
@@ -1092,5 +1092,5 @@
 
         #Convert ASCII file to NetCDF (Which is what we really like!)
-        timefile2netcdf(filename)        
+        timefile2netcdf(filename+'.txt')        
 
         a = [0.0, 0.0]
@@ -1176,5 +1176,5 @@
 
         # Convert ASCII file to NetCDF (Which is what we really like!)
-        timefile2netcdf(filename)        
+        timefile2netcdf(filename + '.txt')        
 
         a = [0.0, 0.0]
Index: /trunk/anuga_core/source/anuga/file_conversion/__init__.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/__init__.py	(revision 7813)
+++ /trunk/anuga_core/source/anuga/file_conversion/__init__.py	(revision 7814)
@@ -7,4 +7,9 @@
     for example:
         sww2dem('northbeach.sww', 'outfile.dem')
+        
+    Some formats input and output across multiple files. In that case the
+    convention is so:
+        urs2nc('northbeach', 'outfile')
+    Where an array of 3 input files produce 4 output files.
 """
 
Index: /trunk/anuga_core/source/anuga/file_conversion/asc2dem.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/asc2dem.py	(revision 7813)
+++ /trunk/anuga_core/source/anuga/file_conversion/asc2dem.py	(revision 7814)
@@ -7,15 +7,5 @@
                             netcdf_float
 
-##
-# @brief Convert ASC file to DEM file.
-# formerly convert_dem_from_ascii2netcdf
-# @param basename_in Stem of input filename.
-# @param basename_out Stem of output filename.
-# @param use_cache ??
-# @param verbose True if this function is to be verbose.
-# @return 
-# @note A PRJ file with same stem basename must exist and is used to fix the
-#       UTM zone, datum, false northings and eastings.
-def asc2dem(basename_in, basename_out=None,
+def asc2dem(name_in, name_out=None,
                                   use_cache=False,
                                   verbose=False):
@@ -31,8 +21,8 @@
     138.3698 137.4194 136.5062 135.5558 ..........
 
-    Convert basename_in + '.asc' to NetCDF format (.dem)
+    Convert name_in (.asc) to NetCDF format (.dem)
     mimicking the ASCII format closely.
 
-    An accompanying file with same basename_in but extension .prj must exist
+    An accompanying file with same basename but extension .prj must exist
     and is used to fix the UTM zone, datum, false northings and eastings.
 
@@ -50,15 +40,15 @@
     """
 
-    kwargs = {'basename_out': basename_out, 'verbose': verbose}
+    kwargs = {'name_out': name_out, 'verbose': verbose}
 
     if use_cache is True:
         from caching import cache
-        result = cache(_convert_dem_from_ascii2netcdf, basename_in, kwargs,
-                       dependencies=[basename_in + '.asc',
-                                     basename_in + '.prj'],
+        result = cache(_convert_dem_from_ascii2netcdf, name_in, kwargs,
+                       dependencies=[name_in,
+                                     name_in[:-4] + '.prj'],
                        verbose=verbose)
 
     else:
-        result = apply(_convert_dem_from_ascii2netcdf, [basename_in], kwargs)
+        result = apply(_convert_dem_from_ascii2netcdf, [name_in], kwargs)
 
     return result
@@ -70,5 +60,5 @@
 # @param basename_out Stem of output filename.
 # @param verbose True if this function is to be verbose.
-def _convert_dem_from_ascii2netcdf(basename_in, basename_out = None,
+def _convert_dem_from_ascii2netcdf(name_in, name_out = None,
                                    verbose = False):
     """Read Digital Elevation model from the following ASCII format (.asc)
@@ -81,5 +71,5 @@
     from Scientific.IO.NetCDF import NetCDFFile
 
-    root = basename_in
+    root = name_in[:-4]
 
     # Read Meta data
@@ -122,8 +112,11 @@
     false_northing = float(L[1].strip())
 
+    if name_in[-4:] != '.asc':
+        raise IOError('Input file %s should be of type .asc.' % name_in)
+
     #Read DEM data
-    datafile = open(basename_in + '.asc')
-
-    if verbose: log.critical('Reading DEM from %s' % (basename_in + '.asc'))
+    datafile = open(name_in)
+
+    if verbose: log.critical('Reading DEM from %s' % (name_in))
 
     lines = datafile.readlines()
@@ -163,8 +156,8 @@
     assert len(lines) == nrows + 6
 
-    if basename_out == None:
-        netcdfname = root + '.dem'
-    else:
-        netcdfname = basename_out + '.dem'
+    if name_out == None:
+        netcdfname = name_in[:-4]+'.dem'
+    else:
+        netcdfname = name_out + '.dem'
 
     if verbose: log.critical('Store to NetCDF file %s' % netcdfname)
@@ -211,5 +204,5 @@
            
         if len(fields) != ncols:
-            msg = 'Wrong number of columns in file "%s" line %d\n' % (basename_in + '.asc', i)
+            msg = 'Wrong number of columns in file "%s" line %d\n' % (name_in, i)
             msg += 'I got %d elements, but there should have been %d\n' % (len(fields), ncols)
             raise Exception, msg
Index: /trunk/anuga_core/source/anuga/file_conversion/dem2dem.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/dem2dem.py	(revision 7813)
+++ /trunk/anuga_core/source/anuga/file_conversion/dem2dem.py	(revision 7814)
@@ -6,5 +6,5 @@
 from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_float
 
-def dem2dem(basename_in, stencil, cellsize_new, basename_out=None,
+def dem2dem(name_in, stencil, cellsize_new, name_out=None,
                  verbose=False):
     """Read Digitial Elevation model from the following NetCDF format (.dem)
@@ -26,9 +26,12 @@
     from Scientific.IO.NetCDF import NetCDFFile
 
-    root = basename_in
-    inname = root + '.dem'
+    if name_in[-4:] != '.dem':
+        raise IOError('Input file %s should be of type .dem.' % name_in)
+
+    if name_out != None and basename_out[-4:] != '.dem':
+        raise IOError('Input file %s should be of type .dem.' % name_out)
 
     #Open existing netcdf file to read
-    infile = NetCDFFile(inname, netcdf_mode_r)
+    infile = NetCDFFile(name_in, netcdf_mode_r)
 
     if verbose: log.critical('Reading DEM from %s' % inname)
@@ -51,8 +54,8 @@
 
     #Get output file name
-    if basename_out == None:
-        outname = root + '_' + repr(cellsize_new) + '.dem'
+    if name_out == None:
+        outname = name_in[:-4] + '_' + repr(cellsize_new) + '.dem'
     else:
-        outname = basename_out + '.dem'
+        outname = name_out
 
     if verbose: log.critical('Write decimated NetCDF file to %s' % outname)
Index: /trunk/anuga_core/source/anuga/file_conversion/dem2pts.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/dem2pts.py	(revision 7813)
+++ /trunk/anuga_core/source/anuga/file_conversion/dem2pts.py	(revision 7814)
@@ -18,5 +18,5 @@
 # @param verbose 
 # @return 
-def dem2pts(basename_in, basename_out=None,
+def dem2pts(name_in, name_out=None,
             easting_min=None, easting_max=None,
             northing_min=None, northing_max=None,
@@ -40,5 +40,5 @@
     """
 
-    kwargs = {'basename_out': basename_out,
+    kwargs = {'name_out': name_out,
               'easting_min': easting_min,
               'easting_max': easting_max,
@@ -49,10 +49,10 @@
     if use_cache is True:
         from caching import cache
-        result = cache(_dem2pts, basename_in, kwargs,
-                       dependencies = [basename_in + '.dem'],
+        result = cache(_dem2pts, name_in, kwargs,
+                       dependencies = [name_in],
                        verbose = verbose)
 
     else:
-        result = apply(_dem2pts, [basename_in], kwargs)
+        result = apply(_dem2pts, [name_in], kwargs)
 
     return result
@@ -68,5 +68,5 @@
 # @param northing_min 
 # @param northing_max 
-def _dem2pts(basename_in, basename_out=None, verbose=False,
+def _dem2pts(name_in, name_out=None, verbose=False,
             easting_min=None, easting_max=None,
             northing_min=None, northing_max=None):
@@ -81,10 +81,16 @@
     from Scientific.IO.NetCDF import NetCDFFile
 
-    root = basename_in
+    if name_in[-4:] != '.dem':
+        raise IOError('Input file %s should be of type .dem.' % name_in)
+
+    if name_out != None and basename_out[-4:] != '.pts':
+        raise IOError('Input file %s should be of type .pts.' % name_out)
+
+    root = name_in[:-4]
 
     # Get NetCDF
-    infile = NetCDFFile(root + '.dem', netcdf_mode_r) 
-
-    if verbose: log.critical('Reading DEM from %s' % (root + '.dem'))
+    infile = NetCDFFile(name_in, netcdf_mode_r) 
+
+    if verbose: log.critical('Reading DEM from %s' % (name_in))
 
     ncols = infile.ncols[0]
@@ -106,8 +112,8 @@
 
     # Get output file
-    if basename_out == None:
+    if name_out == None:
         ptsname = root + '.pts'
     else:
-        ptsname = basename_out + '.pts'
+        ptsname = name_out
 
     if verbose: log.critical('Store to NetCDF file %s' % ptsname)
Index: /trunk/anuga_core/source/anuga/file_conversion/esri2sww.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/esri2sww.py	(revision 7813)
+++ /trunk/anuga_core/source/anuga/file_conversion/esri2sww.py	(revision 7814)
@@ -1,23 +1,4 @@
 
-##
-# @brief Convert CSIRO ESRI file to an SWW boundary file.
-# @param bath_dir 
-# @param elevation_dir 
-# @param ucur_dir 
-# @param vcur_dir 
-# @param sww_file 
-# @param minlat 
-# @param maxlat 
-# @param minlon 
-# @param maxlon 
-# @param zscale 
-# @param mean_stage 
-# @param fail_on_NaN 
-# @param elevation_NaN_filler 
-# @param bath_prefix 
-# @param elevation_prefix 
-# @param verbose 
-# @note Also convert latitude and longitude to UTM. All coordinates are
-#       assumed to be given in the GDA94 datum.
+
 def esri2sww(bath_dir,
                   elevation_dir,
@@ -60,4 +41,7 @@
     from anuga.coordinate_transforms.redfearn import redfearn
 
+    if sww_file[-4:] != '.sww':
+        raise IOError('Output file %s should be of type .sww.' % sww_file)
+
     # So if we want to change the precision it's done here
     precision = netcdf_float 
Index: /trunk/anuga_core/source/anuga/file_conversion/ferret2sww.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/ferret2sww.py	(revision 7813)
+++ /trunk/anuga_core/source/anuga/file_conversion/ferret2sww.py	(revision 7814)
@@ -17,5 +17,5 @@
 
 
-def ferret2sww(basename_in, basename_out=None,
+def ferret2sww(basename_in, name_out=None,
                verbose=False,
                minlat=None, maxlat=None,
@@ -64,4 +64,7 @@
     _assert_lat_long(minlat, maxlat, minlon, maxlon)
 
+    if name_out != None and name_out[-4:] != '.sww':
+        raise IOError('Output file %s should be of type .sww.' % name_out)
+
     # Get NetCDF data
     if verbose: log.critical('Reading files %s_*.nc' % basename_in)
@@ -79,8 +82,8 @@
     file_e = NetCDFFile(basename_in + '_e.nc', netcdf_mode_r)  
 
-    if basename_out is None:
+    if name_out is None:
         swwname = basename_in + '.sww'
     else:
-        swwname = basename_out + '.sww'
+        swwname = name_out
 
     # Get dimensions of file_h
Index: /trunk/anuga_core/source/anuga/file_conversion/file_conversion.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/file_conversion.py	(revision 7813)
+++ /trunk/anuga_core/source/anuga/file_conversion/file_conversion.py	(revision 7814)
@@ -29,5 +29,5 @@
 
 
-def sww2obj(basefilename, size):
+def sww2obj(filename, size):
     """ Convert netcdf based data output to obj
 
@@ -39,8 +39,13 @@
     from Scientific.IO.NetCDF import NetCDFFile
 
+    if filename[-4:] != '.sww':
+        raise IOError('Output file %s should be of type .sww.' % sww_file)
+
+    basefilename = filename[:-4]
+
     # Get NetCDF
-    FN = create_filename('.', basefilename, 'sww', size)
-    log.critical('Reading from %s' % FN)
-    fid = NetCDFFile(FN, netcdf_mode_r)  #Open existing file for read
+    nc_fname = create_filename('.', basefilename, 'sww', size)
+    log.critical('Reading from %s' % nc_fname)
+    fid = NetCDFFile(nc_fname, netcdf_mode_r)  #Open existing file for read
 
     # Get the variables
@@ -81,71 +86,4 @@
         write_obj(FN, xx, yy, zz)
 
-
-##
-# @brief 
-# @param basefilename Stem of filename, needs size and extension added.
-def dat2obj(basefilename):
-    """Convert line based data output to obj
-    FIXME: Obsolete?
-    """
-
-    import glob, os
-    from anuga.config import data_dir
-
-    # Get bathymetry and x,y's
-    lines = open(data_dir+os.sep+basefilename+'_geometry.dat', 'r').readlines()
-
-    M = len(lines)  #Number of lines
-    x = num.zeros((M,3), num.float)
-    y = num.zeros((M,3), num.float)
-    z = num.zeros((M,3), num.float)
-
-    for i, line in enumerate(lines):
-        tokens = line.split()
-        values = map(float, tokens)
-
-        for j in range(3):
-            x[i,j] = values[j*3]
-            y[i,j] = values[j*3+1]
-            z[i,j] = values[j*3+2]
-
-    # Write obj for bathymetry
-    write_obj(data_dir + os.sep + basefilename + '_geometry', x, y, z)
-
-    # Now read all the data files with variable information, combine with
-    # x,y info and store as obj.
-
-    files = glob.glob(data_dir + os.sep + basefilename + '*.dat')
-    for filename in files:
-        log.critical('Processing %s' % filename)
-
-        lines = open(data_dir + os.sep + filename, 'r').readlines()
-        assert len(lines) == M
-        root, ext = os.path.splitext(filename)
-
-        # Get time from filename
-        i0 = filename.find('_time=')
-        if i0 == -1:
-            #Skip bathymetry file
-            continue
-
-        i0 += 6  #Position where time starts
-        i1 = filename.find('.dat')
-
-        if i1 > i0:
-            t = float(filename[i0:i1])
-        else:
-            raise DataTimeError, 'Hmmmm'
-
-        for i, line in enumerate(lines):
-            tokens = line.split()
-            values = map(float,tokens)
-
-            for j in range(3):
-                z[i,j] = values[j]
-
-        # Write obj for variable data
-        write_obj(data_dir + os.sep + basefilename + '_time=%.4f' % t, x, y, z)
-
 ##
 # @brief Convert time-series text file to TMS file.
@@ -153,5 +91,5 @@
 # @param quantity_names 
 # @param time_as_seconds 
-def timefile2netcdf(filename, quantity_names=None, time_as_seconds=False):
+def timefile2netcdf(file_text, quantity_names=None, time_as_seconds=False):
     """Template for converting typical text files with time series to
     NetCDF tms file.
@@ -180,5 +118,8 @@
     from anuga.utilities.numerical_tools import ensure_numeric
 
-    file_text = filename + '.txt'
+    if file_text[-4:] != '.txt':
+        raise IOError('Input file %s should be of type .txt.' % file_text)
+
+    filename = file_text[:-4]
     fid = open(file_text)
     line = fid.readline()
@@ -288,4 +229,7 @@
     to check if a tsh/msh file 'looks' good.
     """
+
+    if filename[-4:] != '.tsh' and filename[-4:] != '.msh':
+        raise IOError('Input file %s should be .tsh or .msh.' % name_out)
 
     if verbose == True: log.critical('Creating domain from %s' % filename)
Index: /trunk/anuga_core/source/anuga/file_conversion/sdf2pts.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/sdf2pts.py	(revision 7813)
+++ /trunk/anuga_core/source/anuga/file_conversion/sdf2pts.py	(revision 7814)
@@ -38,6 +38,6 @@
 
 
-def sdf2pts(basename_in,
-                              basename_out=None,
+def sdf2pts(name_in,
+                              name_out=None,
                               verbose=False):
     """Read HEC-RAS Elevation datal from the following ASCII format (.sdf)
@@ -99,8 +99,14 @@
     from Scientific.IO.NetCDF import NetCDFFile
 
-    root = basename_in
+    if name_in[-4:] != '.sdf':
+        raise IOError('Input file %s should be of type .sdf.' % name_in)
+
+    if name_out is None:
+        name_out = name_in[:-4] + '.pts'
+    elif name_out[-4:] != '.pts':
+        raise IOError('Input file %s should be of type .pts.' % name_out)
 
     # Get ASCII file
-    infile = open(root + '.sdf', 'r')
+    infile = open(name_in, 'r')
 
     if verbose: log.critical('Reading DEM from %s' % (root + '.sdf'))
@@ -170,8 +176,8 @@
 
     # Get output file, write PTS data
-    if basename_out == None:
-        ptsname = root + '.pts'
+    if name_out == None:
+        ptsname = name_in[:-4] + '.pts'
     else:
-        ptsname = basename_out + '.pts'
+        ptsname = name_out
 
     geo_ref = Geo_reference(zone, 0, 0, datum, projection, units)
Index: /trunk/anuga_core/source/anuga/file_conversion/sww2dem.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/sww2dem.py	(revision 7813)
+++ /trunk/anuga_core/source/anuga/file_conversion/sww2dem.py	(revision 7814)
@@ -29,5 +29,5 @@
 DEFAULT_BLOCK_SIZE = 10000
 
-def sww2dem(basename_in, basename_out=None,
+def sww2dem(name_in, name_out,
             quantity=None, # defaults to elevation
             reduction=None,
@@ -42,5 +42,4 @@
             origin=None,
             datum='WGS84',
-            format='ers',
             block_size=None):
     """Read SWW file and convert to Digitial Elevation model format
@@ -98,6 +97,13 @@
          apply_expression_to_dictionary
 
-    msg = 'Format must be either asc or ers'
-    assert format.lower() in ['asc', 'ers'], msg
+    basename_in, in_ext = os.path.splitext(name_in)
+    basename_out, out_ext = os.path.splitext(name_out)
+    out_ext = out_ext.lower()
+
+    if in_ext != '.sww':
+        raise IOError('Input format for %s must be .sww' % name_in)
+
+    if out_ext not in ['.asc', '.ers']:
+        raise IOError('Format for %s must be either asc or ers.' % name_out)
 
     false_easting = 500000
@@ -110,7 +116,4 @@
         reduction = max
 
-    if basename_out is None:
-        basename_out = basename_in + '_%s' % quantity
-
     if quantity_formula.has_key(quantity):
         quantity = quantity_formula[quantity]
@@ -122,15 +125,11 @@
         block_size = DEFAULT_BLOCK_SIZE
 
-    # Read SWW file
-    swwfile = basename_in + '.sww'
-    demfile = basename_out + '.' + format
-
     # Read sww file
     if verbose:
-        log.critical('Reading from %s' % swwfile)
-        log.critical('Output directory is %s' % basename_out)
+        log.critical('Reading from %s' % name_in)
+        log.critical('Output directory is %s' % name_out)
 
     from Scientific.IO.NetCDF import NetCDFFile
-    fid = NetCDFFile(swwfile)
+    fid = NetCDFFile(name_in)
 
     #Get extent and reference
@@ -168,5 +167,5 @@
         log.critical('------------------------------------------------')
         log.critical('Statistics of SWW file:')
-        log.critical('  Name: %s' % swwfile)
+        log.critical('  Name: %s' % name_in)
         log.critical('  Reference:')
         log.critical('    Lower left corner: [%f, %f]' % (xllcorner, yllcorner))
@@ -212,5 +211,5 @@
     if missing_vars:
         msg = ("In expression '%s', variables %s are not in the SWW file '%s'"
-               % (quantity, swwfile))
+               % (quantity, name_in))
         raise Exception, msg
 
@@ -300,5 +299,5 @@
 
     for i in xrange(nrows):
-        if format.lower() == 'asc':
+        if out_ext == '.asc':
             yg = i * cellsize
         else:
@@ -336,5 +335,5 @@
         grid_values[i] = NODATA_value
 
-    if format.lower() == 'ers':
+    if out_ext == '.ers':
         # setup ERS header information
         grid_values = num.reshape(grid_values, (nrows, ncols))
@@ -362,5 +361,5 @@
         import ermapper_grids
 
-        ermapper_grids.write_ermapper_grid(demfile, grid_values, header)
+        ermapper_grids.write_ermapper_grid(name_out, grid_values, header)
 
         fid.close()
@@ -383,7 +382,7 @@
         prjid.close()
 
-        if verbose: log.critical('Writing %s' % demfile)
-
-        ascid = open(demfile, 'w')
+        if verbose: log.critical('Writing %s' % name_out)
+
+        ascid = open(name_out, 'w')
 
         ascid.write('ncols         %d\n' %ncols)
@@ -440,4 +439,6 @@
     See sww2dem to find out what most of the parameters do.
 
+    basename_in is a path to sww file/s, without the .sww extension.
+
     Quantities is a list of quantities.  Each quantity will be
     calculated for each sww file.
@@ -473,5 +474,6 @@
                 basename_out = sww_file + '_' + quantity + '_' + extra_name_out
 
-            file_out = sww2dem(dir+os.sep+sww_file, dir+os.sep+basename_out,
+            file_out = sww2dem(dir+os.sep+sww_file+'.sww',
+                               dir+os.sep+basename_out,
                                quantity,
                                reduction,
Index: /trunk/anuga_core/source/anuga/file_conversion/sww2pts.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/sww2pts.py	(revision 7813)
+++ /trunk/anuga_core/source/anuga/file_conversion/sww2pts.py	(revision 7814)
@@ -1,4 +1,5 @@
 
 import numpy as num
+import os
 
 from anuga.coordinate_transforms.geo_reference import Geo_reference
@@ -15,5 +16,5 @@
 # @param verbose True if this function is to be verbose.
 # @param origin ??
-def sww2pts(basename_in, basename_out=None,
+def sww2pts(name_in, name_out=None,
             data_points=None,
             quantity=None,
@@ -48,14 +49,24 @@
         reduction = max
 
-    if basename_out is None:
+    basename_in, in_ext = os.path.splitext(name_in)
+    
+    if name_out != None:
+        basename_out, out_ext = os.path.splitext(name_out)
+    else:
         basename_out = basename_in + '_%s' % quantity
+        out_ext = '.pts'
+        name_out = basename_out + out_ext
 
-    swwfile = basename_in + '.sww'
-    ptsfile = basename_out + '.pts'
+    if in_ext != '.sww':
+        raise IOError('Input format for %s must be .sww' % name_in)
+
+    if out_ext != '.pts':
+        raise IOError('Output format for %s must be .pts' % name_out)
+
 
     # Read sww file
-    if verbose: log.critical('Reading from %s' % swwfile)
+    if verbose: log.critical('Reading from %s' % name_in)
     from Scientific.IO.NetCDF import NetCDFFile
-    fid = NetCDFFile(swwfile)
+    fid = NetCDFFile(name_in)
 
     # Get extent and reference
@@ -163,5 +174,5 @@
     G = Geospatial_data(data_points=data_points, attributes=interpolated_values)
 
-    G.export_points_file(ptsfile, absolute = True)
+    G.export_points_file(name_out, absolute = True)
 
     fid.close()
Index: /trunk/anuga_core/source/anuga/file_conversion/test_2pts.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/test_2pts.py	(revision 7813)
+++ /trunk/anuga_core/source/anuga/file_conversion/test_2pts.py	(revision 7814)
@@ -101,5 +101,5 @@
 
         #Convert to NetCDF pts
-        sdf2pts(root)
+        sdf2pts(root+'.sdf')
 
         #Check contents
@@ -208,5 +208,5 @@
         points = num.concatenate( (x[:,num.newaxis],y[:,num.newaxis]), axis=1 )
         points = num.ascontiguousarray(points)
-        sww2pts(domain.get_name(),
+        sww2pts(domain.get_name() + '.sww',
                 quantity = 'elevation',
                 data_points = points,
@@ -223,5 +223,5 @@
         points = domain.get_centroid_coordinates()
         #print points
-        sww2pts(domain.get_name(),
+        sww2pts(domain.get_name() + '.sww',
                 quantity = 'elevation',
                 data_points = points,
Index: /trunk/anuga_core/source/anuga/file_conversion/test_dem2dem.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/test_dem2dem.py	(revision 7813)
+++ /trunk/anuga_core/source/anuga/file_conversion/test_dem2dem.py	(revision 7814)
@@ -99,5 +99,5 @@
         stencil = num.ones((3,3), num.float) / 9.0
 
-        dem2dem(root, stencil=stencil, cellsize_new=100)
+        dem2dem(filename, stencil=stencil, cellsize_new=100)
 
         # Open decimated NetCDF file
@@ -194,5 +194,5 @@
         stencil = num.ones((3,3), num.float) / 9.0
 
-        dem2dem(root, stencil=stencil, cellsize_new=100)
+        dem2dem(filename, stencil=stencil, cellsize_new=100)
 
         # Open decimated NetCDF file
Index: /trunk/anuga_core/source/anuga/file_conversion/test_dem2pts.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/test_dem2pts.py	(revision 7813)
+++ /trunk/anuga_core/source/anuga/file_conversion/test_dem2pts.py	(revision 7814)
@@ -79,6 +79,6 @@
 
         #Convert to NetCDF pts
-        asc2dem(root)
-        dem2pts(root, easting_min=2002.0, easting_max=2007.0,
+        asc2dem(filename)
+        dem2pts(root+'.dem', easting_min=2002.0, easting_max=2007.0,
                 northing_min=3003.0, northing_max=3006.0,
                 verbose=False)
@@ -199,6 +199,6 @@
 
         #Convert to NetCDF pts
-        asc2dem(root)
-        dem2pts(root, easting_min=2002.0, easting_max=2007.0,
+        asc2dem(filename)
+        dem2pts(root+'.dem', easting_min=2002.0, easting_max=2007.0,
                 northing_min=3003.0, northing_max=3006.0)
 
@@ -328,6 +328,6 @@
 
         #Convert to NetCDF pts
-        asc2dem(root)
-        dem2pts(root, easting_min=2002.0, easting_max=2007.0,
+        asc2dem(filename)
+        dem2pts(root+'.dem', easting_min=2002.0, easting_max=2007.0,
                 northing_min=3003.0, northing_max=3006.0)
 
Index: /trunk/anuga_core/source/anuga/file_conversion/test_sww2dem.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/test_sww2dem.py	(revision 7813)
+++ /trunk/anuga_core/source/anuga/file_conversion/test_sww2dem.py	(revision 7814)
@@ -132,10 +132,10 @@
 
         #Export to ascii/prj files
-        sww2dem(self.domain.get_name(),
+        sww2dem(self.domain.get_name()+'.sww',
+                self.domain.get_name()+'_elevation.asc',
                 quantity = 'elevation',
                 cellsize = cellsize,
                 number_of_decimal_places = 9,
-                verbose = self.verbose,
-                format = 'asc')
+                verbose = self.verbose)
 
         #Check prj (meta data)
@@ -220,15 +220,16 @@
         os.remove(ascfile)
 
+        ascfile = self.domain.get_name() + '_depth.asc'
+        prjfile = self.domain.get_name() + '_depth.prj'
+
         #Export to ascii/prj files
-        sww2dem(self.domain.get_name(),
+        sww2dem(self.domain.get_name()+'.sww',
+                ascfile,
                 quantity = 'depth',
                 cellsize = cellsize,
                 number_of_decimal_places = 9,
-                verbose = self.verbose,
-                format = 'asc')
+                verbose = self.verbose)
         
         #Check asc file
-        ascfile = self.domain.get_name() + '_depth.asc'
-        prjfile = self.domain.get_name() + '_depth.prj'
         ascid = open(ascfile)
         lines = ascid.readlines()
@@ -353,10 +354,10 @@
 
         #Export to ascii/prj files
-        sww2dem(domain.get_name(),
+        sww2dem(domain.get_name() + '.sww',
+                domain.get_name() + '_elevation.asc',
                 quantity = 'elevation',
                 cellsize = cellsize,
                 number_of_decimal_places = 9,
                 verbose = self.verbose,
-                format = 'asc',
                 block_size=2)
 
@@ -525,10 +526,10 @@
 
         #Export to ascii/prj files
-        sww2dem(domain.get_name(),
+        sww2dem(domain.get_name()+'.sww',
+                domain.get_name() + '_elevation.asc',
                 quantity = 'elevation',
                 cellsize = cellsize,
                 number_of_decimal_places = 9,
                 verbose = self.verbose,
-                format = 'asc',
                 block_size=2)
 
@@ -720,5 +721,6 @@
 
         # Export to ascii/prj files
-        sww2dem(domain.get_name(),
+        sww2dem(domain.get_name() + '.sww',
+                domain.get_name() + '_elevation.asc',
                 quantity = 'elevation',
                 cellsize = cellsize,
@@ -728,6 +730,5 @@
                 northing_min = 6189050,
                 northing_max = 6189100,
-                verbose = self.verbose,
-                format = 'asc')
+                verbose = self.verbose)
 
         fid.close()
@@ -867,11 +868,10 @@
 
         #Export to ascii/prj files
-        sww2dem(self.domain.get_name(),
+        sww2dem(self.domain.get_name() + '.sww',
+                self.domain.get_name() + '_stage.asc',
                 quantity = 'stage',
                 cellsize = cellsize,
                 number_of_decimal_places = 9,
-                reduction = min,
-                format = 'asc',
-                verbose=self.verbose)
+                reduction = min)
 
 
@@ -974,10 +974,10 @@
 
         #Export to ascii/prj files
-        sww2dem(self.domain.get_name(),
+        sww2dem(self.domain.get_name() + '.sww',
+                self.domain.get_name() + '_stage.asc',
                 quantity = 'stage',
                 cellsize = cellsize,
                 number_of_decimal_places = 9,
                 reduction = 1,
-                format = 'asc',
                 verbose=self.verbose)
 
@@ -1082,11 +1082,10 @@
 
         #Export to ascii/prj files
-        sww2dem(self.domain.get_name(),
-                basename_out = 'datatest_depth',
+        sww2dem(self.domain.get_name()+'.sww',
+                name_out = 'datatest_depth.asc',
                 quantity = 'stage - elevation',
                 cellsize = cellsize,
                 number_of_decimal_places = 9,
                 reduction = min,
-                format = 'asc',
                 verbose = self.verbose)
 
@@ -1234,10 +1233,10 @@
 
         #Export to ascii/prj files
-        sww2dem(domain.get_name(),
+        sww2dem(domain.get_name()+'.sww',
+                domain.get_name()+'_elevation.asc',
                 quantity = 'elevation',
                 cellsize = cellsize,
                 number_of_decimal_places = 9,
-                verbose = self.verbose,
-                format = 'asc')
+                verbose = self.verbose)
 
 
@@ -1343,17 +1342,18 @@
 
         #Export to ers files
-        sww2dem(self.domain.get_name(),
+        outname = self.domain.get_name() + '_elevation.ers'
+        sww2dem(self.domain.get_name() + '.sww',
+                outname,
                 quantity = 'elevation',
                 cellsize = cellsize,
                 number_of_decimal_places = 9,
                 NODATA_value = NODATA_value,
-                verbose = self.verbose,
-                format = 'ers')
+                verbose = self.verbose)
 
         #Check header data
         from ermapper_grids import read_ermapper_header, read_ermapper_data
 
-        header = read_ermapper_header(self.domain.get_name() + '_elevation.ers')
-        #print header
+        header = read_ermapper_header(outname)
+
         assert header['projection'].lower() == '"utm-56"'
         assert header['datum'].lower() == '"wgs84"'
Index: /trunk/anuga_core/source/anuga/file_conversion/test_urs2sts.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/test_urs2sts.py	(revision 7813)
+++ /trunk/anuga_core/source/anuga/file_conversion/test_urs2sts.py	(revision 7814)
@@ -69,10 +69,10 @@
                                       va=va)
 
+        sts_file = base_name + '.sts'
+
         urs2sts(base_name,
-                basename_out=base_name, 
+                basename_out=sts_file, 
                 mean_stage=tide,verbose=False)
 
-        # now I want to check the sts file ...
-        sts_file = base_name + '.sts'
 
         #Let's interigate the sww file
@@ -184,12 +184,11 @@
                                            va=va)
 
+        sts_file = base_name + '.sts'
+
         urs2sts(base_name,
-                basename_out=base_name, 
+                basename_out=sts_file, 
                 central_meridian=123,
                 mean_stage=tide,
                 verbose=False)
-
-        # now I want to check the sts file ...
-        sts_file = base_name + '.sts'
 
         #Let's interigate the sww file
Index: /trunk/anuga_core/source/anuga/shallow_water/test_forcing.py
===================================================================
--- /trunk/anuga_core/source/anuga/shallow_water/test_forcing.py	(revision 7813)
+++ /trunk/anuga_core/source/anuga/shallow_water/test_forcing.py	(revision 7814)
@@ -248,5 +248,5 @@
         fid.close()
 
-        timefile2netcdf(filename)
+        timefile2netcdf(filename + '.txt')
         os.remove(filename + '.txt')
 
@@ -337,5 +337,5 @@
         fid.close()
 
-        timefile2netcdf(filename, time_as_seconds=True)
+        timefile2netcdf(filename + '.txt', time_as_seconds=True)
         os.remove(filename + '.txt')
 
Index: /trunk/anuga_core/source/anuga/shallow_water/test_forcing_terms.py
===================================================================
--- /trunk/anuga_core/source/anuga/shallow_water/test_forcing_terms.py	(revision 7813)
+++ /trunk/anuga_core/source/anuga/shallow_water/test_forcing_terms.py	(revision 7814)
@@ -543,5 +543,5 @@
 
         # Convert ASCII file to NetCDF (Which is what we really like!)
-        timefile2netcdf(filename)
+        timefile2netcdf(filename + '.txt')
         os.remove(filename + '.txt')
 
@@ -633,5 +633,5 @@
 
         # Convert ASCII file to NetCDF (Which is what we really like!)
-        timefile2netcdf(filename, time_as_seconds=True)
+        timefile2netcdf(filename + '.txt', time_as_seconds=True)
         os.remove(filename + '.txt')
 
