Changeset 3419


Ignore:
Timestamp:
Jul 25, 2006, 2:23:44 PM (18 years ago)
Author:
duncan
Message:

add time column

Location:
inundation/fit_interpolate
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/fit_interpolate/interpolate.py

    r3417 r3419  
    278278        return A
    279279
    280 def interpolate_sww2csv(sww_file, points,
     280def interpolate_sww2csv(sww_file,
     281                        points,
    281282                        depth_file,
    282283                        velocity_file,
     
    308309    velocity_writer = writer(file(velocity_file, "wb"))
    309310    # Write heading
    310     depth_writer.writerow([str(x[0])+ ':' + str(x[1]) for x in points])
    311     velocity_writer.writerow([str(x[0])+ ':' + str(x[1]) for x in points])
     311    heading = [str(x[0])+ ':' + str(x[1]) for x in points]
     312    heading.insert(0, "time")
     313    depth_writer.writerow(heading)
     314    velocity_writer.writerow(heading)
    312315    #for row in someiterable:
    313316        #csvwriter.writerow(row)
    314317    for time in callable_sww.get_time():
    315         depths = []
    316         velocitys = []
     318        depths = [time]
     319        velocitys = [time]
    317320        for point_i, point in enumerate(points):
    318321            quantities = callable_sww(time,point_i)
  • inundation/fit_interpolate/test_interpolate.py

    r3417 r3419  
    14131413                            verbose=False)
    14141414
    1415         depth_answers_array = [[6.0, 1.5], [15., 10.5]]
    1416         velocity_answers_array = [[5./6.0, 5./1.5], [5./15., 5./10.5]]
     1415        depth_answers_array = [[0.0, 6.0, 1.5], [2.0, 15., 10.5]]
     1416        velocity_answers_array = [[0.0, 5./6.0, 5./1.5], [2.0, 5./15., 5./10.5]]
    14171417        depth_file_handle = file(depth_file)
    14181418        depth_reader = csv.reader(depth_file_handle)
Note: See TracChangeset for help on using the changeset viewer.