Changeset 2604
- Timestamp:
- Mar 27, 2006, 2:04:19 PM (17 years ago)
- Location:
- production/gippsland_2005
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
production/gippsland_2005/get_timeseries.py
r2404 r2604 12 12 13 13 #swwfile = project.newoutputname + '.sww' 14 swwfile = project.outputname + '.sww' 14 swwfile = project.outputname 15 16 # Causes a memory error 17 #swwfile = 'O:/2/cit/inundation/Gippsland Lakes/120106/lakes_100_628759.sww' 18 19 swwfile = 'O:/2/cit/inundation/Gippsland Lakes/lakes_100_314920.sww' 20 15 21 16 22 #Time interval to plot … … 39 45 return gauges, lines, gaugelocation 40 46 41 #gauges, buildings = get_gauges_from_file(project.gauge_filename)42 47 gauges, lines, locations = get_gauges_from_file(project.gauge_filename) 43 48 44 49 #Read model output 45 quantities = ['stage', 'elevation' , 'xmomentum', 'ymomentum']50 quantities = ['stage', 'elevation'] 46 51 f = file_function(swwfile, 47 52 quantities = quantities, 48 53 interpolation_points = gauges, 49 54 verbose = True, 50 use_cache = True)55 use_cache = False) 51 56 52 57 … … 61 66 stages = [] 62 67 elevations = [] 63 momenta = []64 velocity = []65 68 66 69 max_depth = 0 67 max_momentum = 068 max_velocity = 069 70 for i, t in enumerate(f.T): # T is a list of times 70 71 #if tmin < t < tmax: 71 72 w = f(t, point_id = k)[0] 72 73 z = f(t, point_id = k)[1] 73 uh = f(t, point_id = k)[2]74 vh = f(t, point_id = k)[3]75 74 #myloc = locations[k] 76 77 m = sqrt(uh*uh + vh*vh) #Absolute momentum78 vel = sqrt(uh*uh + vh*vh) / (w-z + 1.e-30) #Absolute velocity79 print vel80 #dep = w-z81 #vel = sqrt(uh*uh + vh*vh) / dep #Absolute velocity82 75 83 76 model_time.append(t) 84 77 stages.append(w) 85 78 elevations.append(z) #Should be constant over time 86 momenta.append(m)87 velocity.append(vel)88 79 89 80 if w-z > max_depth: 90 81 max_depth = w-z 91 if m > max_momentum:92 max_momentum = m93 if vel > max_velocity:94 max_velocity = vel95 print 'max speed', max_velocity96 82 97 83 … … 105 91 hold(False) 106 92 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') 112 94 name = 'Gauge_%d: (%.1f, %.1f)' %(k, g[0], g[1]) 113 95 #name = 'Gauge_%d: (%.1f, %.1f) Location: %s' %(k, g[0], g[1], myloc) … … 124 106 raw_input('Next') 125 107 126 127 #Momentum plot128 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 plot142 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')154 108 155 109 -
production/gippsland_2005/project.py
r2175 r2604 39 39 outputname = outputdir + basename + '.sww' #Used by post processing 40 40 41 gauge_filename = ' all_bld_ind.csv'41 gauge_filename = 'gauges.csv' 42 42 43 43 tide = 0.0
Note: See TracChangeset
for help on using the changeset viewer.