PRO focus_trends, DO_PS = DO_PS, $ FT=FT ; ; Plot the streak zeroth-order core FWHM fits vs observation date ; ; Output plot into ps file if KEYWORD_SET(DO_PS) then pre_print_landscape !p.multi = 0 ; The data is in an rdb format file, focus_trends.rdb ft = rdb_read(!DDIDL+'/marx/focus_trends.rdb') ; Remove any that have negative values of strkFWHM: posfwhm = where(ft.strkFWHM GT 0.0) ft = ft(posfwhm) ; Convert the 90% confidence errors into 1-sigma: ft.strkFWHMerr = ft.strkFWHMerr/1.65 ; Setup the Julian dates along xaxis juldayval = LONG(indgen(n_elements(ft))+1.0) for id=0, n_elements(ft)-1 do begin juldayval(id) = JULDAY(ft(id).month, ft(id).day, ft(id).year) end ; Plot the FWHM values dummy = LABEL_DATE(DATE_FORMAT = '%N/%D') plot, juldayval, ft.strkFWHM, PSYM=4, $ XRANGE=[min(juldayval)-10.0,max(juldayval)+10.0], XSTYLE=1, $ XTICKFORMAT = 'LABEL_DATE', $ XTITLE='Observation Date, (1999 to 2001)', $ YRANGE=[0.,55.0], YSTYLE=1, $ YTITLE='FWHM from streak events (um)', $ TITLE='Zeroth-order 1D FWHM vs Time' plot_errors, juldayval, juldayval, juldayval, $ ft.strkFWHM - ft.strkFWHMerr, ft.strkFWHM + ft.strkFWHMerr ; Calc and print the weighted mean value print, '' print, ' Weighted Mean:' vals = ft.strkFWHM errs = ft.strkFWHMerr ; weights are 1/sigma^2 weights = 1.0/(errs)^2 mean = TOTAL(weights*vals)/TOTAL(weights) mean_err = SQRT(1.0/TOTAL(weights)) print, 'mean and error = ', mean, mean_err ; and Chi-square chi2n = TOTAL( ((ft.strkFWHM-mean)/ft.strkFWHMerr)^2 ) / $ FLOAT(n_elements(ft)-1) print, ' chi-squared / N-1 = '+string(chi2N) print, '' ; Add the mean to the plot oplot, [0.0,max(juldayval)+1.0], mean*[1.0,1.0], LINESTYLE=2 oplot, [0.0,max(juldayval)+1.0], (mean-mean_err)*[1.0,1.0], LINESTYLE=1 oplot, [0.0,max(juldayval)+1.0], (mean+mean_err)*[1.0,1.0], LINESTYLE=1 xyouts, juldayval(0),50.0, 'Ave FWHM = '+STRING(mean,FORMAT='(F5.1)') + $ ' +/- ' + STRING(mean_err,FORMAT='(F5.2)') + ' um' xyouts, juldayval(0),48.0, 'Chi^2 / (N-1) = '+STRING(chi2n,FORMAT='(F5.2)') ; and add observation info too lab_offset = 3.0 for id=0,n_elements(ft)-1 do begin label_str = strpad(ft(id).obsid,5,/RIGHT) + ' - ' + $ ft(id).object + ' ('+ft(id).PItype+')' xyouts, juldayval(id)-0.5, lab_offset, label_str, $ orientation=90.0, CHARSIZE=0.8 if lab_offset LT 10.0 then lab_offset=17.0 else lab_offset=3.0 end ; label the plot... plot_creator_label, '~/idl/marx/focus_trends.pro' if KEYWORD_SET(DO_PS) then begin device, /close SPAWN, 'cp idl.ps focus_trends.ps' set_plot, 'X' end RETURN END