Ignore:
Timestamp:
Jun 9, 2010, 12:28:24 PM (12 years ago)
Author:
hudson
Message:

New filename conventions for file conversion. Filenames must always be passed in with the correct extension.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/file_conversion/ferret2sww.py

    r7776 r7814  
    1717
    1818
    19 def ferret2sww(basename_in, basename_out=None,
     19def ferret2sww(basename_in, name_out=None,
    2020               verbose=False,
    2121               minlat=None, maxlat=None,
     
    6464    _assert_lat_long(minlat, maxlat, minlon, maxlon)
    6565
     66    if name_out != None and name_out[-4:] != '.sww':
     67        raise IOError('Output file %s should be of type .sww.' % name_out)
     68
    6669    # Get NetCDF data
    6770    if verbose: log.critical('Reading files %s_*.nc' % basename_in)
     
    7982    file_e = NetCDFFile(basename_in + '_e.nc', netcdf_mode_r) 
    8083
    81     if basename_out is None:
     84    if name_out is None:
    8285        swwname = basename_in + '.sww'
    8386    else:
    84         swwname = basename_out + '.sww'
     87        swwname = name_out
    8588
    8689    # Get dimensions of file_h
Note: See TracChangeset for help on using the changeset viewer.