CD, current=cdir ;RESTORE,'/data/2023sep07/vissr_aligned/vissr-aligned-xu-correct.sav' ;.r /usr/local/harris/idl88/lib/graphics/arrow aprof=RF(averprof[0,*]) !P.FONT=0 SET_PLOT,'X' LOADCT, 0, /SILENT CIRCLE, /FILL event='1383-1261-scan23' figDir=CHECK_SLASH(cdir) fname='/data3/2023sep07/aligned_results/'+event+'.log' xy=READ_TABLE(fname) ; --- xy=REVERSE(xy,2) pos1=STRPOS(fname,'scan',0) pos2=STRPOS(fname,'.log',0) scanC=STRMID(fname,pos1+4,pos2-pos1-4) scanN=FIX(scanC) fileTemp=FILE_BASENAME(fname,'.log') dim=SIZE(xy,/DIM) nPts=dim[1] IF dim[0] EQ 3 THEN xy=xy[0:1,*] dim=SIZE(xy,/DIM) nPts=dim[1] ; --- plots profiles along the spine yspline=SPLINE(xscale, aprof, xspline) pPos=[0.12,0.12,0.95,0.93] xW=pPos[2]-pPos[0] yW=pPos[3]-pPos[1] SET_PLOT,'PS' !P.CHARSIZE=0.5 DEVICE,XS=8., YS=8, /avantgarde,/book, filename=figDir+fileTemp+'-method.eps',/COLOR PLOT, xspline/10., yspline, YR=[-20, 80], XR=[-0.15,0.15], XS=9, XTIT='nm', $ LINESTYLE=1, YTIT='Relative Intensity, I',POS=pPos,THICK=4,CHARSIZE=0.6,/NORM OPLOT, [-0.15,0.15],[0,0],LINESTYLE=1,THICK=2 AXIS, /XAXIS, XR=[-68.6,68.6],XS=1, CHARSIZE=0.6, xTITLE='km/s' ;this is km/s scale LOADCT, 13, /SILENT contrastArr=FLTARR(nPts,N_ELEMENTS(yspline)) FOR i=8, 8 DO BEGIN sp=SPLINE(xscale, REFORM(scans[scanN,*,xy[0,i],xy[1,i]])/nKoef[i], xspline) OPLOT, xspline/10., sp, pSYM=-3, SYMSIZE=0.15, LINESTYLE=0, THICK=4, COLOR=30 ; --- shaded area contrastProf=sp-yspline poly=[contrastProf[0:6],0,contrastProf[0]] polx=[xspline[0:6]/10,xspline[6]/10,xspline[0]/10] polyfill, polx,poly,color=100 OPLOT, xspline[12:24]/10., contrastProf[12:24], PSYM=-3, SYMSIZE=0.3, THICK=2, COLOR=250 poly=[0,contrastProf[12:24],0] polx=[xspline[12]/10,xspline[12:24]/10,xspline[12]/10] polyfill, polx,poly,color=230 OPLOT, xspline/10., contrastProf, PSYM=-3, SYMSIZE=2, THICK=4, COLOR=48 OPLOT, xspline[12:24]/10., contrastProf[12:24], PSYM=-3, SYMSIZE=2, THICK=4, COLOR=255 ; --- COG tmp1=xspline[0:6] & tmp2=contrastProf[0:6] ind=WHERE(tmp2 LT 0) IF TOTAL(ind) GT 0 THEN BEGIN areaBlue=TOTAL(tmp2[ind]) cogBlue=TOTAL(tmp2[ind]*tmp1[ind])/areaBlue ENDIF PLOTS, [cogBlue,cogBlue]/10,[-20,0],LINESTYLE=1 tmp1=xspline[12:24] & tmp2=contrastProf[12:24] ind=WHERE(tmp2 LT 0) IF TOTAL(ind) GT 0 THEN BEGIN areaRed=TOTAL(tmp2[ind]) cogRed=TOTAL(tmp2[ind]*tmp1[ind])/areaRed ENDIF PLOTS, [cogRed,cogRed]/10,[-20,0],LINESTYLE=1 level=0.5 hm1=sp[12]+ABS(sp[2]-sp[12])*level ; we use I@-1.0A and I@0.0 hm2=sp[12]+ABS(sp[22]-sp[12])*level ; we use I@+1.0A and I@0.0 hm=(hm1+hm2)/2 PLOTS, [-0.15,-0.1],[sp[2],sp[2]],LINESTYLE=1 PLOTS, [-0.15,-0.0],[sp[12],sp[12]],LINESTYLE=1 ARROW, -0.05,hm,0.065,hm,/SOLID,/DATA ARROW, 0.065,hm,-0.05,hm,/SOLID,/DATA ; ARROW, -0.0075,hm,-0.0075,-20, /SOLID, THICK=0, /DATA PLOTS, [0.0075,0.0075],[-20,hm], LINESTYLE=1, THICK=0, /DATA XYOUTS, -0.14,67, '!8I!D0.1!N!X',CHARSIZE=0.7,/DATA XYOUTS, -0.14,17, '!8I!Dmin!N!X',CHARSIZE=0.7,/DATA XYOUTS, -0.02,43, '!8FWHM!X',CHARSIZE=0.7,/DATA XYOUTS, -0.08,-15, '!8V!Ub!n!Dcog!N!X',CHARSIZE=0.7,/DATA XYOUTS, 0.06,-15, '!8V!Ur!n!Dcog!N!X',CHARSIZE=0.7,/DATA XYOUTS, -0.005,-15, '!8V!DFWHM!X',CHARSIZE=0.7,/DATA ENDFOR DEVICE, /CLOSE LOADCT, 0, /SILENT SET_PLOT,'X' END