Changeset 120
- Timestamp:
- 09/11/08 15:59:55 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/procs/ybinx.pro
r109 r120 5 5 ; ---------------------- 6 6 ; 7 IF debug_w THEN print, " " 7 8 IF debug_w THEN print, " Enter ybinx..." 9 IF debug_w THEN print, " " 8 10 9 11 ; organise density bins: either read array or build form single number and min/max in fld_glo_mmx.def … … 19 21 20 22 IF debug_w THEN print, ' bin_plt= ', bin_plt 23 IF debug_w THEN print, ' nbins= ', nbins 21 24 22 25 ; 3rd field to bin regression ? … … 27 30 28 31 IF sw3 THEN BEGIN 29 idxmsk = where(fld GT valmask/ 20.)32 idxmsk = where(fld GT valmask/10.) 30 33 IF idxmsk(0) NE -1 THEN fld(idxmsk) = valmask 31 34 IF idxmsk(0) NE -1 THEN fld3(idxmsk) = valmask 32 35 ENDIF 36 37 ; print min/max of field for debug 38 idxmskp = where(fld LE valmask/10.) 39 IF debug_w THEN print, ' Min/max fld= ', min(fld(idxmskp)), max(fld(idxmskp)) 40 IF debug_w THEN print, ' Min/max fld2= ', min(fld2(idxmskp)), max(fld2(idxmskp)) 33 41 34 42 ; remove mean seasonal cycle if required … … 102 110 max_idx = max(binpop) 103 111 104 IF debug_w THEN print, ' max bin size ', max_idx 105 112 IF debug_w THEN print, ' Max bin size ', max_idx 106 113 fldy = fltarr(nbins+1, max_idx) 107 114 fldy[*, *] = !values.f_nan … … 152 159 WHILE ib LE nbins DO BEGIN 153 160 161 binsz = binpop(ib) 154 162 155 binsz = binpop(ib)156 sfc_tot = total(surfb(ib, 0:binsz-1)) 157 IF sfc_tot GT 0 THEN BEGIN163 IF binsz GT 1 THEN BEGIN 164 165 sfc_tot = total(surfb(ib, 0:binsz-1)) 158 166 yplt(ib) = total(fldys(ib, 0:binsz-1))/sfc_tot 167 yerr(ib) = sqrt((moment(fldy(ib, 0:binsz-1)))[1]) 168 159 169 mean_fld = mean_fld + yplt(ib)*float(binpop(ib)) 170 171 ; print bin info 172 IF ib GT 0 AND ib LT nbins THEN print, ' Bin size, occurence, average: ', bin_interval(ib-1), bin_interval(ib), binpop(ib), (binpop(ib)/total(binpop))*100., yplt(ib) 173 IF ib EQ 0 THEN print, ' Bin size, occurence, average: min' , bin_interval(ib), binpop(ib), (binpop(ib)/total(binpop))*100. , yplt(ib) 174 IF ib EQ nbins THEN print, ' Bin size, occurence, average: ', bin_interval(ib-1),' max ', binpop(ib), (binpop(ib)/total(binpop))*100. , yplt(ib) 160 175 ENDIF ELSE yplt(ib) = !values.f_nan 161 176 … … 184 199 185 200 IF binsz GT 1 THEN BEGIN 201 186 202 idx1 = where(fldy(ib, 0:binsz-1) NE valmask) 187 203 idx2 = where(fldy2(ib, 0:binsz-1) NE valmask) … … 193 209 194 210 mean_fld = mean_fld + yplt(ib)*float(binpop(ib)) 211 212 ; print bin info 195 213 IF ib GT 0 AND ib LT nbins THEN print, ' Bin size, occurence, regress.: ', bin_interval(ib-1), bin_interval(ib), binpop(ib), (binpop(ib)/total(binpop))*100., yplt(ib) 196 214 IF ib EQ 0 THEN print, ' Bin size, occurence, regress.: min' , bin_interval(ib), binpop(ib), (binpop(ib)/total(binpop))*100. , yplt(ib) … … 228 246 res = execute(pltcmd) 229 247 230 ; plot error bars for regression 231 232 IF sw3 THEN BEGIN 233 pltcmd = 'pltsc,yplt-yerr,bin_plt,minc,maxc,minc2,maxc2,varlegend'+com_strplt+',ov1d=1,COLOR=1, thick=1, STY1D=-1,subtitle=""' 234 res = execute(pltcmd) 235 pltcmd = 'pltsc,yplt+yerr,bin_plt,minc,maxc,minc2,maxc2,varlegend'+com_strplt+',ov1d=1,COLOR=1, thick=1, STY1D=-1,subtitle=""' 236 res = execute(pltcmd) 237 ENDIF 248 ; plot +/- 1 stdedv for field binnig 249 250 pltcmd = 'pltsc,yplt-yerr,bin_plt,minc,maxc,minc2,maxc2,varlegend'+com_strplt+',ov1d=1,COLOR=1, thick=1, STY1D=-1,subtitle=""' 251 res = execute(pltcmd) 252 pltcmd = 'pltsc,yplt+yerr,bin_plt,minc,maxc,minc2,maxc2,varlegend'+com_strplt+',ov1d=1,COLOR=1, thick=1, STY1D=-1,subtitle=""' 253 res = execute(pltcmd) 238 254 239 255 IF debug_w THEN print, " ... Exit ybinx"
Note: See TracChangeset
for help on using the changeset viewer.