Changeset 2604


Ignore:
Timestamp:
Mar 27, 2006, 2:04:19 PM (18 years ago)
Author:
duncan
Message:

check in unknown changes

Location:
production/gippsland_2005
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • production/gippsland_2005/get_timeseries.py

    r2404 r2604  
    1212   
    1313#swwfile = project.newoutputname + '.sww'
    14 swwfile = project.outputname + '.sww'
     14swwfile = project.outputname
     15
     16# Causes a memory error
     17#swwfile = 'O:/2/cit/inundation/Gippsland Lakes/120106/lakes_100_628759.sww'
     18
     19swwfile = 'O:/2/cit/inundation/Gippsland Lakes/lakes_100_314920.sww'
     20
    1521
    1622#Time interval to plot
     
    3945    return gauges, lines, gaugelocation
    4046
    41 #gauges, buildings = get_gauges_from_file(project.gauge_filename)
    4247gauges, lines, locations = get_gauges_from_file(project.gauge_filename)
    4348
    4449#Read model output
    45 quantities = ['stage', 'elevation', 'xmomentum', 'ymomentum']
     50quantities = ['stage', 'elevation']
    4651f = file_function(swwfile,
    4752                  quantities = quantities,
    4853                  interpolation_points = gauges,
    4954                  verbose = True,
    50                   use_cache = True)
     55                  use_cache = False)
    5156
    5257
     
    6166    stages = []
    6267    elevations = []
    63     momenta = []
    64     velocity = []
    6568
    6669    max_depth = 0
    67     max_momentum = 0
    68     max_velocity = 0
    6970    for i, t in enumerate(f.T): # T is a list of times
    7071        #if tmin < t < tmax:
    7172        w = f(t, point_id = k)[0]
    7273        z = f(t, point_id = k)[1]
    73         uh = f(t, point_id = k)[2]
    74         vh = f(t, point_id = k)[3]
    7574        #myloc = locations[k]
    76 
    77         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
    8275       
    8376        model_time.append(t)       
    8477        stages.append(w)
    8578        elevations.append(z)  #Should be constant over time
    86         momenta.append(m)
    87         velocity.append(vel)
    8879
    8980        if w-z > max_depth:
    9081            max_depth = w-z
    91         if m > max_momentum:           
    92             max_momentum = m
    93         if vel > max_velocity:
    94             max_velocity = vel
    95             print 'max speed', max_velocity
    9682
    9783   
     
    10591    hold(False)
    10692
    107     if elevations[0] < -10:
    108         plot(model_time, stages, '-b')
    109     else:   
    110         plot(model_time, stages, '-b',
    111              model_time, elevations, '-k')
     93    plot(model_time, stages, '-b')     
    11294    name = 'Gauge_%d: (%.1f, %.1f)' %(k, g[0], g[1])
    11395    #name = 'Gauge_%d: (%.1f, %.1f) Location: %s' %(k, g[0], g[1], myloc)
     
    124106    raw_input('Next')
    125107
    126 
    127     #Momentum plot
    128     ion()
    129     hold(False)
    130     plot(model_time, momenta, '-r')
    131     title(name)
    132 
    133     title('%s (momentum)' %name)
    134     xlabel('time [s]')
    135     ylabel('sqrt( uh^2 + vh^2 ) [m^2/s]')   
    136     savefig('Gauge_%d_momentum' %k)
    137     #savefig('Gauge_%s_momentum' %myloc)
    138    
    139     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')
    154108   
    155109
  • production/gippsland_2005/project.py

    r2175 r2604  
    3939outputname = outputdir + basename  + '.sww' #Used by post processing
    4040
    41 gauge_filename = 'all_bld_ind.csv'
     41gauge_filename = 'gauges.csv'
    4242
    4343tide = 0.0
Note: See TracChangeset for help on using the changeset viewer.