; Data from Steele and McEwen, 1990, Table 3. r=[0.21,0.46,0.30] dr=[0.10,0.10,0.07] g=[2.20,2.56,5.15] dg=[0.32,0.36,0.27] e0=[3.4,1.8,3.1] de0=[1.0,0.2,0.9] rbyg=r/g drbyg=rbyg*SQRT((dg/g)^2+(dr/r)^2) s=sort(e0) e0=e0(s) de0=de0(s) rbyg=rbyg(s) drbyg=drbyg(s) n=3 xr=[MIN(e0-de0),MAX(e0+de0)] ;yr=[MIN(rbyg-drbyg),MAX(rbyg+drbyg)] yr=[0.0,0.5] PLOT,e0,rbyg,PSYM=6,XRANGE=xr,YRANGE=yr $ ,XTITLE='Characteristic Energy (keV)' $ ,YTITLE='Red/Green Ratio' $ ,TITLE='Data from Steele & McEwen, JGR 95, p. 10329' FOR i=0,n-1 DO BEGIN PLOTS,[e0(i),e0(i)],[rbyg(i)-drbyg(i),rbyg(i)+drbyg(i)] PLOTS,[e0(i)-de0(i),e0(i)+de0(i)],[rbyg(i),rbyg(i)] ENDFOR yf=1 var=1 cur=svdfit(e0,rbyg,2,weight=1.0/drbyg,yfit=yf,variance=var) ;OPLOT,e0,yf ;PRINT,cur yf2=1 var2=1 cur2=svdfit(e0,rbyg,2,weight=1.0/(drbyg+abs(cur(1))*de0),yfit=yf2,variance=var2) nxr=!X.CRANGE OPLOT,nxr,cur2(0)+cur2(1)*nxr,THICK=2 ;OPLOT,e0,yf2,thick=2 PRINT,cur2 END