[107] | 1 | ;+ |
---|
| 2 | ; |
---|
| 3 | ; .. _flux_evaluation_tpr_map.pro: |
---|
| 4 | ; |
---|
| 5 | ; =========================== |
---|
| 6 | ; flux_evaluation_tpr_map.pro |
---|
| 7 | ; =========================== |
---|
| 8 | ; |
---|
| 9 | ; DESCRIPTION |
---|
| 10 | ; =========== |
---|
| 11 | ; |
---|
| 12 | ; SEE ALSO |
---|
| 13 | ; ======== |
---|
| 14 | ; |
---|
| 15 | ; :ref:`project_profile.sh` |
---|
| 16 | ; :ref:`project_init.pro` |
---|
| 17 | ; :ref:`cm_project.pro` |
---|
| 18 | ; |
---|
| 19 | ; TODO |
---|
| 20 | ; ==== |
---|
| 21 | ; |
---|
| 22 | ; make it work : need output of flux_evaluation_tpr_timeseries.pro |
---|
| 23 | ; |
---|
| 24 | ; uncomment var |
---|
| 25 | ; |
---|
| 26 | ; coding rules |
---|
| 27 | ; |
---|
| 28 | ; EXAMPLES |
---|
| 29 | ; ======== |
---|
| 30 | ; |
---|
| 31 | ; :: |
---|
| 32 | ; |
---|
| 33 | ; IDL> date1 = 20000101L |
---|
| 34 | ; IDL> date2 = 20091231L |
---|
| 35 | ; IDL> flux_evaluation_tpr_map, date1, date2 |
---|
| 36 | ; |
---|
| 37 | ; EVOLUTIONS |
---|
| 38 | ; ========== |
---|
| 39 | ; |
---|
| 40 | ; $Id$ |
---|
| 41 | ; |
---|
| 42 | ; $URL$ |
---|
| 43 | ; |
---|
| 44 | ; - fplod 20111130T142224Z cratos (Linux) |
---|
| 45 | ; |
---|
| 46 | ; * try to make it work on my account on cratos |
---|
| 47 | ; * remove x_site_location and x_site_location because already exist |
---|
| 48 | ; |
---|
| 49 | ;- |
---|
[106] | 50 | pro flux_evaluation_tpr_map, $ |
---|
| 51 | ; var, $ ;; flux variable (swr, lwr, lhf, shf) to calculate the statistics |
---|
| 52 | date1, $ ;; start date (in julian date. eg. 20000101) |
---|
| 53 | date2 ;; end date (in julian date eg. 20091231) |
---|
| 54 | |
---|
| 55 | @common |
---|
[107] | 56 | @cm_project |
---|
[106] | 57 | reinitplt, /z,/invert |
---|
| 58 | key_portrait = 1 |
---|
[107] | 59 | openps, FILENAME = project_od_env+'flux_evaluation_tpr_map.ps' |
---|
| 60 | ; |
---|
[106] | 61 | ;; part to change |
---|
| 62 | |
---|
| 63 | min_obs=10. ;; this will allow to calculate statistics at locations with more than 180. valid observation |
---|
| 64 | |
---|
| 65 | ;; choose the appropriate min and max values for the following. |
---|
| 66 | |
---|
| 67 | bias_mi=-5 & bias_ma=5 & bias_int=0.5 |
---|
| 68 | std_mi=0.5 & std_ma=1.5 & std_int=0.05 |
---|
| 69 | rmsd_mi=0 & rmsd_ma=15 & rmsd_int=1.5 |
---|
| 70 | cor_mi=0.5 & cor_ma=1. & cor_int=0.025 |
---|
| 71 | |
---|
| 72 | ;; TPR locations. This needs to be updated with time since more locations are added to the array. |
---|
| 73 | |
---|
| 74 | sitelist=['5n165e','8s67e','12s55e', '8s55e', '8s80.5e', '1.5s80.5e', '0n80.5e', '1.5n80.5e', '1.5s90e', $ |
---|
| 75 | '0n90e', '1.5n90e', '4n90e','8n90e','12n90e', '15n90e', '5s95e', $ |
---|
| 76 | '8s165e', '8s180w', '8s155w', '8s125w', '8s110w', '8s95w', '5s156e', '5s165e', '5s180w', '5s170w', $ |
---|
| 77 | '5s155w', '5s140w', '5s125w', '5s110w', '5s95w', '2s156e', '2s165e', '2s180w', '2s170w', '2s155w', '2s140w', $ |
---|
| 78 | '2s125w', '2s110w', '2s95w', '0n147e', '0n156e', '0n165e', '0n180w', '0n170w', '0n155w', '0n140w', '0n125w', $ |
---|
| 79 | '0n110w', '0n95w', '2n147e', '2n156e', '2n165e', '2n180w', '2n170w', '2n155w', '2n140w', '2n125w', '2n110w', $ |
---|
| 80 | '2n95w', '5n147e', '5n156e', '5n170w', '5n155w', '5n140w', '5n125w', '5n110w', '5n95w', $ |
---|
| 81 | '8n156e', '8n165e', '8n180w', '8n170w', '9n140w', '8n125w', '8n110w', '8n95w', $ |
---|
| 82 | '0n0e', '0n10w', '0n23w', '0n35w', '10s10w', '12n23w', '12n38w', '14s32w', '15n38w', '19s34w', '20n38w', $ |
---|
| 83 | '21n23w', '4n23w', '4n38w', '6s10w', '8n38w', '8s30w'] |
---|
| 84 | |
---|
| 85 | ;; This program will create the following text files with statistics of respective variables |
---|
[107] | 86 | |
---|
[106] | 87 | close,/all |
---|
| 88 | |
---|
| 89 | erase |
---|
| 90 | ;; PLOTING THE MAPS |
---|
| 91 | |
---|
[107] | 92 | fi = project_od_env + 'flux_stat.txt' |
---|
[106] | 93 | res=read_ascii(fi,data_start=1) |
---|
| 94 | ff=res.field1 |
---|
| 95 | |
---|
| 96 | lat=reform(ff(0,*)) |
---|
| 97 | lon=reform(ff(1,*)) |
---|
| 98 | cor=reform(ff(2,*)) |
---|
| 99 | bias=reform(ff(3,*)) |
---|
| 100 | std=reform(ff(4,*)) |
---|
| 101 | rmsd=reform(ff(5,*)) |
---|
| 102 | |
---|
| 103 | corr_t=total(cor)/n_elements(cor) |
---|
| 104 | bias_t=total(bias)/n_elements(bias) |
---|
| 105 | std_t=total(std)/n_elements(std) |
---|
| 106 | rmsd_t=total(rmsd)/n_elements(rmsd) |
---|
| 107 | cstat=string(corr_t, bias_t, std_t, rmsd_t, format='(f4.2,3x,f7.2,3x,f4.2,3x,f5.2)') |
---|
| 108 | |
---|
[107] | 109 | file= project_id_env + 'mask_oaflux_30N30S.nc' |
---|
[106] | 110 | initncdf, file |
---|
| 111 | domdef, 30,390,-30,30 |
---|
| 112 | msk=ncdf_lec(file,var='msk') |
---|
| 113 | marge1=[0,0,-5,0] |
---|
| 114 | |
---|
| 115 | plt, msk,realcont=2,/nocont,/nofill,xminor=1,yminor=1,lct=64,cor_mi, cor_ma,int=cor_int, $ |
---|
| 116 | title='1) Correlation ', subtitle='', small=[1,4,1],/rempl,marge=marge1 |
---|
| 117 | |
---|
| 118 | NN=n_elements(lat) |
---|
| 119 | |
---|
| 120 | usersym, [-.5,.5,.5,-.5,-.5],[-.5,-.5,.5,.5,-.5],/fill |
---|
| 121 | |
---|
| 122 | for n=0,NN-1 do begin |
---|
| 123 | x=lon(n) |
---|
| 124 | y=lat(n) |
---|
| 125 | c=cor(n) |
---|
| 126 | cmi=cor_mi & cma=cor_ma & dc=cma-cmi |
---|
| 127 | col=((10+244*(c-cmi)/dc) > 10) < 254 |
---|
| 128 | plots, x,y,psym=8,symsize=1.5,color=col |
---|
| 129 | endfor |
---|
| 130 | |
---|
| 131 | usersym, [-.5,.5,.5,-.5,-.5],[-.5,-.5,.5,.5,-.5] |
---|
| 132 | |
---|
| 133 | for n=0,NN-1 do begin |
---|
| 134 | x=lon(n) |
---|
| 135 | y=lat(n) |
---|
| 136 | c=cor(n) |
---|
| 137 | plots, x,y,psym=8,symsize=1.5,color=0 |
---|
| 138 | endfor |
---|
| 139 | |
---|
| 140 | plt,msk,realcont=2,/nocont,/nofill,xminor=1,yminor=1,lct=64,bias_mi, bias_ma, int=bias_int,/noer, marge=marge1, $ |
---|
| 141 | title='2) Mean bias', subtitle='', small=[1,4,2],/rempl |
---|
| 142 | |
---|
| 143 | NN=n_elements(lat) |
---|
| 144 | |
---|
| 145 | usersym, [-.5,.5,.5,-.5,-.5],[-.5,-.5,.5,.5,-.5],/fill |
---|
| 146 | |
---|
| 147 | for n=0,NN-1 do begin |
---|
| 148 | x=lon(n) |
---|
| 149 | y=lat(n) |
---|
| 150 | c=bias(n) |
---|
| 151 | cmi=bias_mi & cma=bias_ma & dc=cma-cmi |
---|
| 152 | col=((10+244*(c-cmi)/dc) > 10) < 254 |
---|
| 153 | plots, x,y,psym=8,symsize=1.5,color=col |
---|
| 154 | endfor |
---|
| 155 | |
---|
| 156 | usersym, [-.5,.5,.5,-.5,-.5],[-.5,-.5,.5,.5,-.5] |
---|
| 157 | |
---|
| 158 | for n=0,NN-1 do begin |
---|
| 159 | x=lon(n) |
---|
| 160 | y=lat(n) |
---|
| 161 | c=bias(n) |
---|
| 162 | plots, x,y,psym=8,symsize=1.5,color=0 |
---|
| 163 | endfor |
---|
| 164 | plt,msk,realcont=2,/nocont,/nofill,xminor=1,yminor=1,lct=64,rmsd_mi, rmsd_ma, int=rmsd_int,/noer, $ |
---|
| 165 | title='3) RMSD ', subtitle='', small=[1,4,3],/rempl, marge=marge1 |
---|
| 166 | |
---|
| 167 | NN=n_elements(lat) |
---|
| 168 | |
---|
| 169 | usersym, [-.5,.5,.5,-.5,-.5],[-.5,-.5,.5,.5,-.5],/fill |
---|
| 170 | |
---|
| 171 | for n=0,NN-1 do begin |
---|
| 172 | x=lon(n) |
---|
| 173 | y=lat(n) |
---|
| 174 | c=rmsd(n) |
---|
| 175 | cmi=rmsd_mi & cma=rmsd_ma & dc=cma-cmi |
---|
| 176 | col=((10+244*(c-cmi)/dc) > 10) < 254 |
---|
| 177 | plots, x,y,psym=8,symsize=1.5,color=col |
---|
| 178 | endfor |
---|
| 179 | |
---|
| 180 | usersym, [-.5,.5,.5,-.5,-.5],[-.5,-.5,.5,.5,-.5] |
---|
| 181 | for n=0,NN-1 do begin |
---|
| 182 | x=lon(n) |
---|
| 183 | y=lat(n) |
---|
| 184 | c=rmsd(n) |
---|
| 185 | plots, x,y,psym=8,symsize=1.5,color=0 |
---|
| 186 | endfor |
---|
| 187 | plt,msk,realcont=2,/nocont,/nofill,xminor=1,yminor=1,lct=64,std_mi, std_ma, int=std_int,/noer, $ |
---|
| 188 | title='4) STD ratio', subtitle='', small=[1,4,4],/rempl, marge=marge1 |
---|
| 189 | |
---|
| 190 | NN=n_elements(lat) |
---|
| 191 | |
---|
| 192 | usersym, [-.5,.5,.5,-.5,-.5],[-.5,-.5,.5,.5,-.5],/fill |
---|
| 193 | |
---|
| 194 | for n=0,NN-1 do begin |
---|
| 195 | x=lon(n) |
---|
| 196 | y=lat(n) |
---|
| 197 | c=std(n) |
---|
| 198 | cmi=std_mi & cma=std_ma & dc=cma-cmi |
---|
| 199 | col=((10+244*(c-cmi)/dc) > 10) < 254 |
---|
| 200 | plots, x,y,psym=8,symsize=1.5,color=col |
---|
| 201 | endfor |
---|
| 202 | |
---|
| 203 | usersym, [-.5,.5,.5,-.5,-.5],[-.5,-.5,.5,.5,-.5] |
---|
| 204 | |
---|
| 205 | for n=0,NN-1 do begin |
---|
| 206 | x=lon(n) |
---|
| 207 | y=lat(n) |
---|
| 208 | c=std(n) |
---|
| 209 | plots, x,y,psym=8,symsize=1.5,color=0 |
---|
| 210 | endfor |
---|
| 211 | |
---|
| 212 | erase |
---|
| 213 | ;; computing the pdf |
---|
| 214 | |
---|
| 215 | x=mooring & y=product |
---|
| 216 | mio=-50 & mao=300 & inx=25 & nx=(mao-mio)/inx+1l & xx=mio+indgen(nx)*inx |
---|
| 217 | mis=-50 & mas=300 & iny=25 & ny=(mas-mis)/iny+1l & yy=mis+indgen(ny)*iny |
---|
| 218 | pdf=fltarr(nx,ny) |
---|
| 219 | for i=0, nx-2 do begin |
---|
| 220 | for j=0,ny-2 do begin |
---|
| 221 | xmi=xx(i) & xma=xx(i+1) |
---|
| 222 | ymi=yy(j) & yma=yy(j+1) |
---|
| 223 | ind=where((x ge xmi) and (x le xma) and (y ge ymi) and (y le yma)) |
---|
| 224 | pdf(i,j)=float(n_elements(ind)) |
---|
| 225 | ; print, xmi,xma,ymi,yma,n_elements(ind) |
---|
| 226 | endfor |
---|
| 227 | endfor |
---|
| 228 | |
---|
| 229 | scontour, pdf,xx,yy ,small=[2,1,1],/noer, charsize=1, nlevels=30,/fill, $ |
---|
| 230 | xtitle='TAO Flux', ytitle='Product', title='PDF' |
---|
| 231 | xyouts, 0, -150, cstat, charsize=1.2 |
---|
| 232 | |
---|
| 233 | closeps |
---|
| 234 | |
---|
| 235 | end |
---|