Ignore:
Timestamp:
Jul 30, 2008, 4:59:59 PM (16 years ago)
Author:
ole
Message:

Rating curves for culverts

File:
1 edited

Legend:

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

    r5582 r5586  
    953953
    954954
     955def csv2array(file_name):
     956    """Convert CSV files of the form
     957   
     958    time, discharge, velocity
     959    0.0,  1.2,       0.0
     960    0.1,  3.2,       1.1
     961    ...
     962   
     963    to a dictionary of numeric arrays.
     964   
     965   
     966    See underlying function csv2dict for more details.
     967   
     968    """
     969   
     970   
     971    X, _ = csv2dict(file_name)
     972   
     973    Y = {}
     974    for key in X.keys():
     975        Y[key] = array([float(x) for x in X[key]])
     976       
     977    return Y   
     978   
     979           
    955980def csv2dict(file_name, title_check_list=None):
    956981    """
     
    961986    Two dictionaries are returned.
    962987   
    963     WARNING: Vaules are returned as strings.
     988    WARNING: Values are returned as strings.
    964989    do this to change a list of strings to a list of floats
    965990        time = [float(x) for x in time]
Note: See TracChangeset for help on using the changeset viewer.