Ignore:
Timestamp:
Oct 11, 2006, 2:22:34 PM (17 years ago)
Author:
duncan
Message:

more error handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/shallow_water/data_manager.py

    r3741 r3750  
    41914191    quantities = ['HA','UA','VA']
    41924192
     4193    for file_name in files_in:
     4194        if os.access(file_name, os.F_OK) == 0 :
     4195            msg = 'File %s does not exist or is not accessible' %file_name
     4196            raise IOError, msg
     4197       
    41934198    hashed_elevation = None
    41944199    for file_in, file_out, quantity in map(None, files_in,
     
    42474252   
    42484253    lon, lat = lon_lat2grid(lonlatdep)
     4254    lon_sorted = lon[:]
     4255    lon_sorted.sort()
     4256   
     4257    if not lon == lon_sorted:
     4258        msg = "Longitudes in mux file are not in ascending order"
     4259        raise IOError, msg
     4260    lat_sorted = lat[:]
     4261    lat_sorted.sort()   
     4262    if not lat == lat_sorted:
     4263        msg = "Latitudes in mux file are not in ascending order"
     4264   
    42494265    nc_file = Write_nc(quantity,
    42504266                       file_out,
Note: See TracChangeset for help on using the changeset viewer.