; fig03 ;History ;2016/11/15 median time series for MFRSR SSA only ;2016/05/02 SSA timeseries 2005- 2014 at 440nm and 368nm ; To keep the consistency with monthly whisker plot, only choose data from March to October ;2015/10/20 temporily update for time series of SSA (v2) ;2014/07/08 modified because get_matchup_no2.pro was modified ;2014/01/23 quartile plot ;pro ;interquartile range(IQR) ;IQR = Q3 - Q1 : trimmed estimator (estimator derived from aother estimator by excluding some of extreme values) inst = '527' ;number_of_years=10 ;2005 to 2014 number_of_years=12 ;2005 to 2016 time = findgen(number_of_years)+2005 ;from 2005 to 2016 ;array number_year = fltarr(number_of_years) median_ssa = fltarr(7,number_of_years) ; Filters sza_min=30 & sza_max=75 aot440_min = 0.20 sphericity_min=95 ; minimal accepted sphericity [%] sky_error_max = 5.0 ; maximal sky error [%] delta_aot_max=0.01 ; use this condition for 440nm channel only mw_error_max = 0.02 ;delta_ssa440_max = 0.01 ;not used here dir='./' & name='gsfc' & title=' NASA/GSFC' y_min=0.85 & y_max=1.0 & y_lebel=y_min-0.008 extension = '.txt' ;extension = '.it0' !x.thick = 5.0 !y.thick = 5.0 !p.thick = 5.0 !p.charthick = 5.0 y0=0.85 stat='median' ;stat='average' mode='print' & name_output='fig03.ps' ;'yearly_'+stat+'_ssa_mfrsr_'+'AODge'+string(aot440_min,format='(f4.2)')+'.ps' ;mode='screen' ; Set plotting mode if mode eq 'screen' then begin ;set_plot,'X' & device,pseudo_color=8 device, decomposed=0 window, 1, xs=1200, ys=800 loadct, 39 endif else begin set_plot,'PS' & device,/color,/landscape,filename=name_output endelse !p.font=0 DEVICE, SET_FONT='Helvetica Bold Italic', /TT_FONT cgPlot, [0,1], /nodata, yrange=[y0,1], thick=2, xrange=[0,number_of_years*7+1], $ xtickformat='(A1)', ytitle='SSA', YStyle=1, XStyle=1, xticks=1 ;xtickformat='(A1)' means 'turnnig labels off' index = indgen(number_of_years)*7 width = ((!X.CRange[1] - !X.Crange[0]) / (number_of_years*7)) * 0.55 num=0. for h=0, number_of_years-1 do begin iyear = time[h] gsfc_read_matchup_allchan_adderr_v3_year, iyear, extension, inst, dir,name, delta_ssa440_max, sza_min, sza_max, aot440_min, sphericity_min, sky_error_max, delta_aot_max, mw_std_max, mw_error_max, aot_mfrsr_spec, w_mfrsr_spec, k_mfrsr_spec, aot_aero_spec, w_aero_spec, k_aero_spec, n_aero_spec, cvf, cvc, rvf, rvc, e_tot_aer,sf,sc,alb440,alb670,alb870,alb1020 data = w_mfrsr_spec ;mfrsr print, 'year: ', iyear print, 'num: ', n_elements(data[0,*]) print, 'SSA440: ', data[6,*] num=num+n_elements(data[0,*]) ;if h gt 0 then cgplots, [index[h]+0.5,index[h]+0.5],[y0,y_max],color='charcoal',thick=2, linestyle=2 ;grid line med_mfrsr = fltarr(7) for i=0, 6 do begin ;channels sample_size = n_elements(data[i,*]) if sample_size ge 10 and stat eq 'average' then median_ssa[i,h] = mean(data[i,*],/nan) ;average if sample_size ge 10 and stat eq 'median' then median_ssa[i,h] = median(data[i,*],/even) if sample_size lt 10 then median_ssa[i,h] = !values.f_nan ;; med_value = median(w_mfrsr_spec[i,*],/even) ;; plots, index[h]+i, med_value, psym=cgsymcat(16, color='Olive') ;cgBoxPlot_nowhisker, data[i,*], /overplot, xlocation=index[h]+1+i, width=width, $ ; color='light cyan', /fillboxes, boxcolor='light cyan', outlinecolor='blue', outliercolor='blue', stat=stat_mfrsr, thick=2 ;med_mfrsr[i] = stat_mfrsr.median endfor ;i (channels) print, 'median SSA (305,311,317,325,332,368,and 440nm): ',med_mfrsr number_year[h] = n_elements(data[0,*]) endfor ;h (year) ccolors=[cgcolor('red'),cgcolor('orange'),cgcolor('gold'),cgcolor('forestgreen'),cgcolor('blue'),cgcolor('black'),cgcolor('red')] cpsym =[-14,-15,-16,-14,-15,-16,-17] for i=0, 6 do begin cgPlot, index+3.5, median_ssa[i,*], psym=cpsym[i],color=ccolors[i], linestyle=2,/overplot,symsize=2, thick=2 endfor labels = string(time, format='(I4)') for j=0, number_of_years-1 do begin cgText, index[j]+3.8, y0-0.009, labels[j], Alignment=0.5, charthick=2, charsize=1.5;, color=cgcolor('black') ; cgText, index[j]+3.8, y_max-0.009, string(number_year[j],format='(I3)'), Alignment=0.5, charthick=2, charsize=1.5;, color=cgcolor('black') endfor cglegend, title=['305','311','317','325','332','368','440 nm'], psym=[14,15,16,14,15,16,17],$ symcolors=['red','orange','gold','forestgreen','blue','black','red'], location=[0.75,0.35], $ charsize=0.95,colors=['red','orange','gold','forestgreen','blue','black','red'],$ linestyle=[2,2,2,2,2,2,2] close,/all if mode eq 'print' then device,/close print, 'total num: ', num print, 'finished!' stop end