Changeset 8864


Ignore:
Timestamp:
May 11, 2013, 10:38:49 AM (12 years ago)
Author:
steve
Message:

Changed anuga.file.netcdf,NetCDFFile so that we get a better error if file not available
to read.

Location:
trunk/anuga_core/source/anuga
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/file/netcdf.py

    r8823 r8864  
    4242    """
    4343   
    44 
     44    using_scientific = using_netcdf4 = False
     45   
    4546    try:
    4647        from Scientific.IO.NetCDF import NetCDFFile
    47         return NetCDFFile(file_name, netcdf_mode)
     48        using_scientific = True
    4849    except:
    4950        from netCDF4 import Dataset
     51        using_netcdf4 = True
     52
     53    assert using_scientific or using_netcdf4
     54
     55    if using_scientific:
     56        return NetCDFFile(file_name, netcdf_mode)
     57
     58    if using_netcdf4:
    5059        if netcdf_mode == 'wl' :
    5160            return Dataset(file_name, 'w', format='NETCDF3_64BIT')
    5261        else:
    5362            return Dataset(file_name, netcdf_mode, format='NETCDF3_64BIT')
     63
    5464
    5565
  • trunk/anuga_core/source/anuga/operators/set_elevation_operators.py

    r8617 r8864  
    215215        node_index = num.zeros((self.domain.number_of_nodes)+1, dtype = num.int)
    216216
     217        # FIXME: SR Don't we calculate this for the domain already!
    217218        k = 0
    218219        node_index[0] = 0
Note: See TracChangeset for help on using the changeset viewer.