PRO plotfit,w,bl,dbl,params,rmse,ymax=ymax ; INPUTS: ; w = wavelengths of measured brightnesses (Angstroms) ; bl = measured brightnesses (kR/A) ; dbl = probable errors in measured brightnesses (kR/A) ; params = 2-element array: ; params(0) = t = trial blackbody temperature ; params(1) = factor = multiplier to adjust blackbody luminosity to PLBS ; OPTIONAL OUTPUTS ; rmse = RMS error of fit (in units of probable errors in measurements) IF N_Elements(ymax) EQ 0 THEN ymax=100 ; Safe upper bound planck,w,params,pl ; Calculate Planck function dif=bl-pl ; Errors in blackbody fit ; Get RMS error of blackbody fit relative to measurement errors rmse=SQRT(TOTAL((dif/dbl)^2)/N_ELEMENTS(dbl)) ; get MEAN squared error ; plot observed brightnesses and error bars PLOT,w,bl,PSYM=7 $ ,XTITLE='Wavelength ('+angstrom()+')',XRANGE=[5000,8500],XSTYLE=1 $ ,YTITLE='Brightness (kR/'+angstrom()+')',YRANGE=[0,MAX(bl+dbl)