Changeset 5786 for anuga_work/production/busselton/get_gauges.py
- Timestamp:
- Sep 25, 2008, 2:24:38 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/busselton/get_gauges.py
r5608 r5786 14 14 compress,zeros,fabs,take 15 15 fid = NetCDFFile(filename+'.sts', 'r') #Open existing file for read 16 permutation = fid.variables['permutation'][:] 16 17 x = fid.variables['x'][:]+fid.xllcorner #x-coordinates of vertices 17 18 y = fid.variables['y'][:]+fid.yllcorner #y-coordinates of vertices … … 27 28 28 29 maxname = 'max_sts_stage.csv' 29 fid_max = open(project.boundaries_dir +sep+maxname,'w')30 s = ' x, y, max_stage \n'30 fid_max = open(project.boundaries_dir_event+sep+maxname,'w') 31 s = 'index, x, y, max_stage \n' 31 32 fid_max.write(s) 32 33 for j in range(len(x)): 33 locx=int(x[j]) 34 locy=int(y[j]) 34 index= permutation[j] 35 35 stage = quantities['stage'][:,j] 36 36 xmomentum = quantities['xmomentum'][:,j] 37 37 ymomentum = quantities['ymomentum'][:,j] 38 38 39 s = '% .6f, %.6f, %.6f\n' %(x[j], y[j], max(stage))39 s = '%d, %.6f, %.6f, %.6f\n' %(index, x[j], y[j], max(stage)) 40 40 fid_max.write(s) 41 41 42 fid_sts = open(project.boundaries_dir +sep+basename+'_'+str(locx)+'_'+str(locy)+'.csv', 'w')42 fid_sts = open(project.boundaries_dir_event+sep+basename+'_'+ str(index)+'.csv', 'w') 43 43 s = 'time, stage, xmomentum, ymomentum \n' 44 44 fid_sts.write(s) … … 54 54 return quantities,elevation,time 55 55 56 quantities,elevation,time=get_sts_gauge_data(os.path.join(project.boundaries_dir ,project.scenario_name),verbose=False)56 quantities,elevation,time=get_sts_gauge_data(os.path.join(project.boundaries_dir_event,project.scenario_name),verbose=False) 57 57 58 58 print len(elevation), len(quantities['stage'][0,:])
Note: See TracChangeset
for help on using the changeset viewer.