Changeset 3190 for production/sydney_2006/get_timeseries.py
- Timestamp:
- Jun 21, 2006, 9:31:57 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
production/sydney_2006/get_timeseries.py
r2885 r3190 5 5 import project 6 6 from pyvolution.util import file_function 7 from coordinate_transforms.redfearn import degminsec2decimal_degrees, redfearn7 #from coordinate_transforms.redfearn import degminsec2decimal_degrees, redfearn 8 8 from pylab import * 9 9 from matplotlib.ticker import MultipleLocator, FormatStrFormatter 10 10 11 swwfile = project.outputname + '.sww' 12 13 11 swwfile = project.outputname + '.sww' 12 #swwfile = project.outputdir + timestampdir + sep + project.outputname + '.sww' 13 # place to store figures 14 #graphloc = project.outputdir + timestampdir + sep 15 graphloc = project.outputdir 14 16 15 17 #Time interval to plot 16 tmin = 1300017 tmax = 2100018 tmin = 2*60 19 tmax = 10*60 18 20 19 21 def get_gauges_from_file(filename): … … 34 36 gaugelocation.append(location) 35 37 36 #Return gauges and raw data for subsequent storage37 38 return gauges, lines, gaugelocation 38 39 … … 40 41 gauges, lines, locations = get_gauges_from_file(project.gauge_filename) 41 42 42 print 'number of gauges for Benfield: ', len(gauges)43 print 'number of gauges: ', len(gauges) 43 44 44 45 #Read model output … … 50 51 use_cache = True) 51 52 52 53 53 print 'size f', size(f.quantities['stage'],axis=0), size(f.quantities['stage'],axis=1) 54 54 55 from math import sqrt, atan, degrees 55 56 from Numeric import ones … … 85 86 uh = f(t, point_id = k)[2] 86 87 vh = f(t, point_id = k)[3] 87 myloc = locations[k]88 gaugeloc = locations[k] 88 89 depth = w-z 89 90 90 91 m = sqrt(uh*uh + vh*vh) #Absolute momentum 91 92 vel = sqrt(uh*uh + vh*vh) / (w-z + 1.e-30) #Absolute velocity … … 135 136 model_time, elevations, '-k') 136 137 #name = 'Gauge_%d: (%.1f, %.1f)' %(k, g[0], g[1]) 137 name = 'Gauge_%d: (%.1f, %.1f) Location: %s' %(k, g[0], g[1], myloc)138 name = 'Gauge_%d: (%.1f, %.1f) Location: %s' %(k, g[0], g[1], gaugeloc) 138 139 title(name) 139 140 … … 144 145 shadow=True, 145 146 loc='upper right') 146 #savefig('Gauge_%d_stage' %k) 147 savefig('Gauge_%s_stage' %myloc) 148 149 # raw_input('Next') 147 #('Gauge_%d_stage' %k) 148 savefig('%sGauge_%s_stage' %(graphloc, gaugeloc)) 149 #savefig('Gauge_%s_stage.eps' %gaugeloc) 150 150 151 151 #Momentum plot … … 159 159 ylabel('sqrt( uh^2 + vh^2 ) [m^2/s]') 160 160 #savefig('Gauge_%d_momentum' %k) 161 savefig(' Gauge_%s_momentum' %myloc)161 savefig('%sGauge_%s_momentum' %(graphloc, gaugeloc)) 162 162 163 # raw_input('Next')164 165 163 #Bearing plot 166 164 ion() … … 181 179 ylabel(' atan(vh/uh) [degrees from North]') 182 180 #savefig('Gauge_%d_bearing' %k) 183 savefig('Gauge_%s_bearing' %myloc) 184 185 # raw_input('Next') 181 savefig('%sGauge_%s_bearing' %(graphloc, gaugeloc)) 186 182 187 183 #Speed plot … … 195 191 ylabel('sqrt( uh^2 + vh^2 ) / depth [m/s]') 196 192 #savefig('Gauge_%d_speed' %k) 197 savefig('Gauge_%s_speed' %myloc) 198 199 # raw_input('Next') 200 201 whichone = '_%s' %myloc 193 savefig('%sGauge_%s_speed' %(graphloc, gaugeloc)) 194 195 whichone = '_%s' %gaugeloc 202 196 thisfile = project.gaugetimeseries+whichone+'.csv' 203 197 fid = open(thisfile, 'w')
Note: See TracChangeset
for help on using the changeset viewer.