- Timestamp:
- Feb 12, 2010, 9:22:29 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/australia_ph2/plot_comparisons/plot_250m_comparisons.py
r7542 r7622 1 1 """ 2 2 Program to plot the results from the Phase 2 comparisions. 3 Compares stage height results from models run with best available data against those 4 using the Geoscience Australia 250 m bathymetry/elevation grid (2005). 3 5 4 6 … … 19 21 path = r'/nas/gemd/georisk_models/inundation/data/australia_ph2/documents/250m comparisons' 20 22 path_list = [] 21 model_list = ['BatemansBay', 'Busselton', 'Carnarvon', 'Geraldton', 'GoldCoast', 'Gosford', ' Pt_hedland']23 model_list = ['BatemansBay', 'Busselton', 'Carnarvon', 'Geraldton', 'GoldCoast', 'Gosford', 'Hobart', 'Pt_hedland'] 22 24 23 25 # Choose figure name here! This controls what is plotted 24 26 #figure_name = 'Phase2comparions_percent.png' # Plots the mean percentage difference in stage 25 figure_name = 'Phase2comparions.png' # Plots the absolute difference in stage 27 #figure_name = 'Phase2comparions.png' # Plots the absolute difference in stage 28 #figure_name = 'greens_law_comparision.png' # Plots the absolute difference in stage compared to Greens Law 29 figure_name = 'greens_law_percent_comparision.png' # Plots the percentage difference in stage compared to Greens Law 30 26 31 figure_folder = join(path, 'figures') 27 32 figure_path = join(figure_folder, figure_name) 28 33 29 for model in model_list: 30 model_path = join(path, model, 'comparisons.csv') 31 path_list.append(model_path) 32 33 plot_dict = {'BatemansBay':'x', 'Busselton':'^', 'Carnarvon':'x', 'Geraldton':'h', 'GoldCoast': 'v', 'Gosford':'+', 'Pt_hedland':'+'} 34 colour_dict = {'BatemansBay':'r', 'Busselton':'b', 'Carnarvon': 2.03, 'Geraldton':'b', 'GoldCoast': 'r', 'Gosford':'r', 'Pt_hedland':'b'} 34 plot_dict = {'BatemansBay':'x', 'Busselton':'^', 'Carnarvon':'x', 'Geraldton':'h', 'GoldCoast': 'v', 'Gosford':'+', 'Hobart':'^','Pt_hedland':'+'} 35 colour_dict = {'BatemansBay':'r', 'Busselton':'b', 'Carnarvon': 'b', 'Geraldton':'b', 'GoldCoast': 'r', 'Gosford':'r', 'Hobart':'r','Pt_hedland':'b'} 35 36 36 37 mean_100m_stage = {'BatemansBay': 1.10, 'Busselton': 0.98, 'Carnarvon': 2.03, 'Geraldton':0.95, … … 38 39 event_dict = {'BatemansBay': 58284, 'Busselton': 27283, 'Carnarvon': 27283, 'Geraldton':27283, 39 40 'GoldCoast': 51469, 'Gosford': 51436, 'Hobart': 58260, 'Pt_hedland': 27283} 41 42 depth_list2 = [-60,-50,-40,-30,-20,-10,0,10] 43 twenty_m = [20,20,20,20,20,20,20,20] 44 fifty_m = [50,50,50,50,50,50,50,50] 45 46 for model in model_list: 47 model_path = join(path, model, 'comparisons.csv') 48 path_list.append(model_path) 40 49 # 41 50 pylab.cla() … … 48 57 orig_stage_index = header.index('stage_high_res_model') 49 58 print depth_index, stage_diff_index, orig_stage_index 59 50 60 depth = [] 51 61 stage_diff = [] … … 57 67 depth_dict = dict.fromkeys(depth).keys() 58 68 69 # Establish dictionaries and lists 59 70 stage_diff_dict = {} 60 71 orig_stage_dict = {} … … 63 74 orig_stage_mean_dict = {} 64 75 percent_diff_mean_dict = {} 76 77 greens_law_dict = {} 78 greens_law_percent_dict = {} 79 greens_law_mean_dict = {} 80 greens_law_percent_mean_dict = {} 81 82 65 83 key_list = [] 66 67 84 diff_mean_list = [] 68 85 percent_mean_list = [] 86 greens_law_diff_mean_list=[] 87 greens_law_percent_mean_list=[] 88 69 89 70 90 for key in depth_dict: 71 91 92 #print 'key',key 93 # Calculate Green's Law estimate 94 greens_estimate = mean_100m_stage[model_list[counter]]*numpy.power((100.0/abs(key+0.001)),(0.25)) 95 #print 'greens_estimate', greens_estimate 96 # Lists to store results 72 97 stage_diff_list = [] 73 98 orig_stage_list = [] 74 99 percent_diff_list = [] 100 greens_law_diff = [] 101 greens_law_percent = [] 102 103 # Loop through depths 75 104 for i in range(len(depth)): 76 105 if depth[i] == key: … … 78 107 orig_stage_list.append(orig_stage[i]) 79 108 percent_diff_list.append((stage_diff[i]/orig_stage[i])*100) 109 greens_law_diff.append(abs((orig_stage[i]-greens_estimate))) 110 greens_law_percent.append(abs(((orig_stage[i]-greens_estimate)/orig_stage[i])*100)) 111 80 112 stage_diff_dict[key] = stage_diff_list 81 113 orig_stage_dict[key] = orig_stage_list 82 114 percent_diff_dict[key] = percent_diff_list 115 greens_law_dict[key] = greens_law_diff 116 greens_law_percent_dict[key] = greens_law_percent 83 117 84 118 stage_diff_mean_dict[key] = numpy.mean(stage_diff_dict[key]) 85 119 orig_stage_mean_dict[key] = numpy.mean(orig_stage_dict[key]) 86 120 percent_diff_mean_dict[key] = numpy.mean( percent_diff_dict[key]) 121 greens_law_mean_dict[key] = numpy.mean(greens_law_dict[key]) 122 greens_law_percent_mean_dict[key] = numpy.mean(greens_law_percent_dict[key]) 123 87 124 key_list.append(key) 88 125 diff_mean_list.append(stage_diff_mean_dict[key]) 89 126 percent_mean_list.append(percent_diff_mean_dict[key]) 90 127 greens_law_diff_mean_list.append(greens_law_mean_dict[key]) 128 greens_law_percent_mean_list.append(greens_law_percent_mean_dict[key]) 129 #print 'greens_law_diff_mean_list', greens_law_diff_mean_list 91 130 pylab.semilogy() 92 131 pylab.xlabel('Depth (m)') … … 96 135 pylab.ylabel('Difference (m)') 97 136 pylab.scatter(key_list,diff_mean_list, marker = plot_dict[model_list[counter]],color = colour_dict[model_list[counter]]) 137 98 138 if figure_name == 'Phase2comparions_percent.png': 99 139 pylab.title('Mean percentage difference in stage height') 100 140 pylab.ylabel('Difference %') 101 141 pylab.scatter(key_list,percent_mean_list, marker = plot_dict[model_list[counter]],color = colour_dict[model_list[counter]]) 102 142 pylab.plot(depth_list2,twenty_m, color = 'black') 143 144 if figure_name == 'greens_law_comparision.png': 145 pylab.title('Greens Law mean difference in stage height') 146 pylab.ylabel('Difference (m)') 147 pylab.scatter(key_list,greens_law_diff_mean_list, marker = plot_dict[model_list[counter]],color = colour_dict[model_list[counter]]) 148 149 if figure_name == 'greens_law_percent_comparision.png': 150 pylab.title('Greens Law mean percentage difference in stage height') 151 pylab.ylabel('Difference %') 152 pylab.scatter(key_list,greens_law_percent_mean_list, marker = plot_dict[model_list[counter]],color = colour_dict[model_list[counter]]) 153 pylab.plot(depth_list2,twenty_m, color = 'black') 103 154 counter+=1 104 155 … … 110 161 pylab.text(-58, 600, 'East Coast', color = 'r') 111 162 pylab.text(-58, 400, 'West Coast', color = 'b') 112 163 pylab.text(-58, 22, '20%') 164 165 if figure_name == 'greens_law_comparision.png': 166 pylab.text(-58, 60, 'East Coast', color = 'r') 167 pylab.text(-58, 40, 'West Coast', color = 'b') 168 169 if figure_name == 'greens_law_percent_comparision.png': 170 pylab.text(-58, 5000, 'East Coast', color = 'r') 171 pylab.text(-58, 3000, 'West Coast', color = 'b') 172 pylab.text(-58, 22, '20%') 113 173 114 174 pylab.savefig(figure_path)
Note: See TracChangeset
for help on using the changeset viewer.