Changeset 9057
- Timestamp:
- Mar 3, 2014, 10:05:11 AM (11 years ago)
- Location:
- trunk/anuga_core/source/anuga_validation_tests/case_studies/towradgi
- Files:
-
- 3 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga_validation_tests/case_studies/towradgi/Compare_results_with_fieldObs.py
r9051 r9057 8 8 from anuga.utilities import plot_utils as util 9 9 10 10 11 swwdir='MODEL_OUTPUTS/' 11 #swwdir='MODEL_bridges_n0p04/'12 swwname='Towradgi_historic_flood.sww' #'Aug98_hort_discontinous.sww' #'Towradgi_historic_flood.sww' 12 13 13 p=util.get_output(swwdir+ 'Towradgi_historic_flood.sww')14 p=util.get_output(swwdir+swwname) 14 15 p2=util.get_centroids(p,velocity_extrapolation=True) 15 16 floodLevels=scipy.genfromtxt('Validation/historic_1998_flood_levels_towradgi_ck.csv', delimiter=',',skip_header=1) 17 pioneerLevel=scipy.genfromtxt('Validation/pioneer_timeseries.txt', 18 skip_header=1) 16 19 17 20 # Extract modelled peak at the coordinates in floodLevels … … 27 30 modelled_ind[i]=myInd 28 31 modelled_level[i]=p2.stage[:,myInd].max() 32 33 if(i==0): 34 pyplot.clf() 35 pyplot.plot(p2.time,p2.stage[:, myInd],color='red') 36 pyplot.plot((pioneerLevel[:,0]-540.)*60., pioneerLevel[:,2],color='black') 37 pyplot.xlabel('Time') 38 pyplot.ylabel('Stage (m)') 39 pyplot.title('Pioneer Bridge Stage') 40 pyplot.savefig('Pioneer_Bridge_Stage.png') 41 29 42 30 43 pyplot.clf() … … 53 66 tif_outdir='OUTPUT_TIFS' 54 67 CellSize=5.0 55 util.Make_Geotif(swwdir+'Towradgi_historic_flood.sww', 68 print 'Making tifs' 69 util.Make_Geotif(swwdir+swwname, 56 70 ['depth','velocity','depthIntegratedVelocity','elevation'],'max', 57 71 CellSize=CellSize,EPSG_CODE=32756,output_dir=tif_outdir) 58 72 print 'Made tifs' 59 73 # Plot depth raster with discrepency between model and data 60 74 depthFile=tif_outdir+'/Towradgi_historic_flood_depth_max_max.tif' … … 66 80 pyplot.figure(figsize=(12,6)) 67 81 pyplot.plot([X.min(),X.max()],[Y.min(),Y.max()],' ') 68 pyplot.imshow(myDepth,extent=[X.min(),X.max(),Y.min(),Y.max()],origin='lower',cmap=pyplot.get_cmap('Greys')) 82 print 'Imshow' 83 #import pdb 84 #pdb.set_trace() 85 pyplot.imshow(scipy.flipud(myDepth),extent=[X.min(),X.max(),Y.min(),Y.max()],origin='lower',cmap=pyplot.get_cmap('Greys')) 69 86 pyplot.gca().set_aspect('equal') 70 87 pyplot.colorbar(orientation='horizontal').set_label('Peak Depth in model (m)') 71 pyplot.scatter(floodLevels[:,0], floodLevels[:,1], c=floodLevels[:,3]-modelled_level,s=20,cmap=pyplot.get_cmap('spectral')) 88 er1=floodLevels[:,3]-modelled_level 89 #er1=er1*(er1<1.0) + 1.0*(er1>=1.0) 90 #er1=er1*(er1> -1.0) - 1.0*(er1<=-1.0) 91 pyplot.scatter(floodLevels[:,0], floodLevels[:,1], c=er1,s=20,cmap=pyplot.get_cmap('spectral')) 72 92 pyplot.colorbar().set_label(label='Field observation - Modelled Peak Depth (m)') 73 93 pyplot.xlim([p.x.min()+p.xllcorner,p.x.max()+p.xllcorner]) … … 75 95 pyplot.savefig('Spatial_Depth_and_Error.png') 76 96 except: 77 'Cannot make GIS plot -- perhaps GDAL etc are not installed?'97 print 'Cannot make GIS plot -- perhaps GDAL etc are not installed?'
Note: See TracChangeset
for help on using the changeset viewer.