Changeset 5196


Ignore:
Timestamp:
Apr 9, 2008, 10:08:44 AM (16 years ago)
Author:
duncan
Message:

Additional functionality. Output stage .csv as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/fit_interpolate/interpolate.py

    r4869 r5196  
    324324                        velocity_x_file,
    325325                        velocity_y_file,
     326                        stage_file=None,
    326327                        #quantities = ['depth', 'velocity'],
    327328                        verbose=True,
     
    353354    velocity_x_writer = writer(file(velocity_x_file, "wb"))
    354355    velocity_y_writer = writer(file(velocity_y_file, "wb"))
     356    if stage_file is not None:
     357        stage_writer = writer(file(stage_file, "wb"))
    355358    # Write heading
    356359    heading = [str(x[0])+ ':' + str(x[1]) for x in points]
     
    359362    velocity_x_writer.writerow(heading)
    360363    velocity_y_writer.writerow(heading)
     364    if stage_file is not None:
     365        stage_writer.writerow(heading)   
    361366   
    362367    for time in callable_sww.get_time():
     
    364369        velocity_xs = [time]
    365370        velocity_ys = [time]
     371        if stage_file is not None: 
     372            stages = [time] 
    366373        for point_i, point in enumerate(points):
    367374            quantities = callable_sww(time,point_i)
     
    391398            velocity_xs.append(velocity_x)
    392399            velocity_ys.append(velocity_y)
     400            if stage_file is not None:
     401                stages.append(w)
    393402        depth_writer.writerow(depths)
    394403        velocity_x_writer.writerow(velocity_xs)
    395404        velocity_y_writer.writerow(velocity_ys)
     405        if stage_file is not None:
     406            stage_writer.writerow(stages)       
    396407
    397408
Note: See TracChangeset for help on using the changeset viewer.