Changeset 5496
- Timestamp:
- Jul 11, 2008, 4:38:08 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/fit_interpolate/interpolate.py
r5482 r5496 429 429 velocity_y_file, 430 430 stage_file=None, 431 froude_file=None, 431 432 #quantities = ['depth', 'velocity'], 432 433 time_thinning=1, … … 477 478 if stage_file is not None: 478 479 stage_writer = writer(file(stage_file, "wb")) 480 if froude_file is not None: 481 froude_writer = writer(file(froude_file, "wb")) 479 482 # Write heading 480 483 heading = [str(x[0])+ ':' + str(x[1]) for x in points] … … 484 487 velocity_y_writer.writerow(heading) 485 488 if stage_file is not None: 486 stage_writer.writerow(heading) 489 stage_writer.writerow(heading) 490 if froude_file is not None: 491 froude_writer.writerow(heading) 487 492 488 493 for time in callable_sww.get_time(): … … 492 497 if stage_file is not None: 493 498 stages = [time] 499 if froude_file is not None: 500 froudes = [time] 494 501 for point_i, point in enumerate(points): 495 502 quantities = callable_sww(time,point_i) … … 516 523 else: 517 524 velocity_y = 0 525 if depth < 1.e-30: # use epsilon 526 froude = NAN 527 else: 528 froude = sqrt(velocity_x*velocity_x + velocity_y*velocity_y)/ \ 529 sqrt(depth * 9.8066) # gravity m/s/s 518 530 depths.append(depth) 519 531 velocity_xs.append(velocity_x) … … 521 533 if stage_file is not None: 522 534 stages.append(w) 535 if froude_file is not None: 536 froudes.append(froude) 523 537 depth_writer.writerow(depths) 524 538 velocity_x_writer.writerow(velocity_xs) 525 539 velocity_y_writer.writerow(velocity_ys) 526 540 if stage_file is not None: 527 stage_writer.writerow(stages) 541 stage_writer.writerow(stages) 542 if froude_file is not None: 543 froude_writer.writerow(froudes) 528 544 529 545
Note: See TracChangeset
for help on using the changeset viewer.