Ignore:
Timestamp:
Feb 2, 2006, 5:01:56 PM (19 years ago)
Author:
sexton
Message:

Fixes to velocity calculation

Location:
production/sydney_2006
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • production/sydney_2006/export_results.py

    r2317 r2326  
    2727    #quantityname = '((xmomentum/(stage-elevation))**2 + (ymomentum/(stage-elevation))**2)**0.5'  #Speed
    2828    #quantityname = 'xmomentum/(stage-elevation)'  #Speed
    29     quantityname = '(xmomentum**2 + ymomentum**2 + 1.e-30)**0.5/(stage-elevation)'  #Speed
     29    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)'  #Speed
    3030
    3131   
  • production/sydney_2006/get_timeseries.py

    r2313 r2326  
    55import project
    66from pyvolution.util import file_function
    7 from pyvolution.coordinate_transforms.redfearn import degminsec2decimal_degrees, redfearn
     7#from pyvolution.coordinate_transforms.redfearn import degminsec2decimal_degrees, redfearn
     8from coordinate_transforms.redfearn import degminsec2decimal_degrees, redfearn
    89from pylab import *
    910
     
    6162    elevations = []
    6263    momenta = []
     64    velocity = []
    6365
    6466    max_depth = 0
    65     max_momentum = 0   
     67    max_momentum = 0
     68    max_velocity = 0
    6669    for i, t in enumerate(f.T): # T is a list of times
    6770        #if tmin < t < tmax:
     
    7376
    7477        m = sqrt(uh*uh + vh*vh)   #Absolute momentum
     78        vel = sqrt(uh*uh + vh*vh) / (w-z + 1.e-30) #Absolute velocity
     79        print vel
     80        #dep = w-z
     81        #vel = sqrt(uh*uh + vh*vh) / dep #Absolute velocity
    7582       
    7683        model_time.append(t)       
    7784        stages.append(w)
    7885        elevations.append(z)  #Should be constant over time
    79         momenta.append(m)
     86        momenta.append(m)
     87        velocity.append(vel)
    8088
    8189        if w-z > max_depth:
    8290            max_depth = w-z
    8391        if m > max_momentum:           
    84             max_momentum = m   
     92            max_momentum = m
     93        if vel > max_velocity:
     94            max_velocity = vel
     95            print 'max speed', max_velocity
    8596
    8697   
     
    127138   
    128139    raw_input('Next')
     140
     141    #Speed plot
     142    ion()
     143    hold(False)
     144    plot(model_time, velocity, '-r')
     145    title(name)
     146
     147    title('%s (velocity)' %name)
     148    xlabel('time [s]')
     149    ylabel('sqrt( uh^2 + vh^2 ) / depth [m/s]')   
     150    savefig('Gauge_%d_speed' %k)
     151    #savefig('Gauge_%s_speed' %myloc)
     152   
     153    raw_input('Next')
    129154   
    130155
Note: See TracChangeset for help on using the changeset viewer.