; --- run .r prep_data if needed ;;IDL> tv, bytscl(scans[36,10,600:*,400:*],min=2000,max=3500) ;;IDL> mycursor,/log,/rename,file='Rscan36',/cross, xstart=600,ystart=400 ;;RESTORE,'/data3/2023sep07/aligned_results/vissr-aligned-xu.sav' aprof=RF(averprof[0,*]) SET_PLOT,'X' LOADCT, 0, /SILENT CIRCLE, /FILL pPos=[0.13,0.13,0.96,0.96] xW=pPos[2]-pPos[0] yW=pPos[3]-pPos[1] figDir='~/article/2024/rbe_profiles/fig_profiles/1373-1069/' padding=100 fname='/data3/2023sep07/aligned_results/1373-1069-scan38.log' iWL=2 & wl='hab080' & tvSc=1.0 ;---iWL=3 & wl='hab060' & tvSc=0.8 ;---iWL=8 & wl='har040' & tvSc=0.6 ;iWL=9 & wl='har060' & tvSc=0.9 iWL=10 & wl='har080' & tvSc=1.1 scStart=-2 & scStop=+1 & spPt=0 ; it will change to 2 further in the code 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) ;;print, scanN 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] tmpImgb=REFORM(scans[scanN,2,MIN(xy[0,*])-padding:MAX(xy[0,*])+padding,MIN(xy[1,*])-padding:MAX(xy[1,*])+padding]) tmpImgr=REFORM(scans[scanN,10,MIN(xy[0,*])-padding:MAX(xy[0,*])+padding,MIN(xy[1,*])-padding:MAX(xy[1,*])+padding]) dimImgb=SIZE(tmpImgb,/DIM) dx=dimImgb[0] dy=dimImgb[1] SET_PLOT,'X' WINDOW, 0, XS=2*dx, YS=dy, /PIXMAP TV, BYTSCL(tmpImgb,min=1700,max=3500),0,0 TV, BYTSCL(tmpImgr,min=1700,max=3500),dx,0 LOADCT, 3, /SILENT PLOTS,xy[0,*]-min(xy[0,*])+padding,xy[1,*]-min(xy[1,*])+padding,/DEVICE, PSYM=8, SYMSIZE=0.3, COLOR=170 PLOTS,xy[0,0]-min(xy[0,*])+padding,xy[1,0]-min(xy[1,*])+padding,/DEVICE, PSYM=8, SYMSIZE=0.6, COLOR=170 PLOTS,xy[0,*]-min(xy[0,*])+padding+dx,xy[1,*]-min(xy[1,*])+padding,/DEVICE, PSYM=8, SYMSIZE=0.3, COLOR=170 PLOTS,xy[0,0]-min(xy[0,*])+padding+dx,xy[1,0]-min(xy[1,*])+padding,/DEVICE, PSYM=8, SYMSIZE=0.6, COLOR=170 ;;;X2PNG, filename=figDir+fileTemp+'-image.png',/COLOR LOADCT, 0 ; --- makes a strip plot of all 13 Ha positions WINDOW, 0, XS=13*dx, YS=dy, /PIXMAP tvScale=[1.2,1.1,1.0,0.85,0.55,0.45,0.4,0.4,0.6,0.9,1.0,1.1,1.2] for ii=0, 12 do begin tmpImg=REFORM(scans[scanN,ii,MIN(xy[0,*])-padding:MAX(xy[0,*])+padding,MIN(xy[1,*])-padding:MAX(xy[1,*])+padding]) TV, BYTSCL(tmpImg,min=1700*tvSCale[ii],max=3500*tvScale[ii]),ii*dx,0 LOADCT, 3, /SILENT PLOTS,xy[0,*]-min(xy[0,*])+padding+dx*ii,xy[1,*]-min(xy[1,*])+padding,/DEVICE, PSYM=8, SYMSIZE=0.2, COLOR=170 ;;PLOTS,xy[0,0]-min(xy[0,*])+padding,xy[1,0]-min(xy[1,*])+padding,/DEVICE, PSYM=8, SYMSIZE=0.6, COLOR=170 LOADCT, 0 ;ENDIF ENDFOR X2PNG, filename=figDir+fileTemp+'-all-scan.png',/COLOR ;------------------ -------------------- makes eps images of various wavelengths IF STRMID(wl,2,1) EQ 'b' THEN wS='-' ELSE Ws='+' headLine=STRMID(list[scanN],48,8)+' '+STRMID(list[scanN],57,6)+'UT H!9a!X'+wS+'0.0'+STRMID(wl,4,1)+' nm' tmpImg=REFORM(scans[scanN,iwl,MIN(xy[0,*])-padding:MAX(xy[0,*])+padding,MIN(xy[1,*])-padding:MAX(xy[1,*])+padding]) nx=(SIZE(tmpImg,/DIM))[0] ny=(SIZE(tmpImg,/DIM))[1] SET_PLOT,'X' iScale=5 tmp=CONGRID(tmpImg,nx*iScale,ny*iScale,/INTER) save,tmpImg, tmp, filename='ha-image-to-coalign.sav' WINDOW, XS=nx*iScale, YS=ny*iScale, /PIXMAP TV, BYTSCL(tmp,min=2000*tvSc,max=3700*tvSc) LOADCT, 2, /SILENT tmpPts=N_ELEMENTS(RF(xy[0,*])) PLOTS,iScale*xy[0,1:tmpPts-2]-iScale*min(xy[0,*])+iScale*padding,iScale*xy[1,1:tmpPts-2]-iScale*min(xy[1,*])+iScale*padding,/DEVICE, PSYM=8, SYMSIZE=2., COLOR=30 ; 2/30 - green, 2/80 - red PLOTS,iScale*xy[0,tmpPts-1]-iScale*min(xy[0,*])+iScale*padding,iScale*xy[1,tmpPts-1]-iScale*min(xy[1,*])+iScale*padding,/DEVICE, PSYM=8, SYMSIZE=2., COLOR=80 ; 2/30 - green, 2/80 - red PLOTS,iScale*xy[0,0]-iScale*min(xy[0,*])+iScale*padding,iScale*xy[1,0]-iScale*min(xy[1,*])+iScale*padding,/DEVICE, PSYM=4, SYMSIZE=7.5, THICK=8, COLOR=0 ; 2/30 - green, 2/80 - LOADCT, 0, /SILENT tmp=TVRD(/TRUE) SET_PLOT,'PS' !P.CHARSIZE=0.5 DEVICE,XS=8, YS=8, filename=figDir+fileTemp+'-'+wl+'.eps',/COLOR, BITS_PER_PIXEL=8, /avantgarde,/book TV, tmp, /TRUE, pPos[0], pPos[1], XS=xW, YS=yW, /NORM PLOT, [0,0], [1,1], YR=[0, ny*0.029*0.725], XR=[0,nx*0.029*0.725], YTIT='Mm', XTIT='Mm', $ POS=pPos,/NORM,/NODATA,/NOERASE,CHARSIZE=1 XYOUTS, 0.13, 4.5, headLine, CHARSIZE=0.9, COLOR=50 XYOUTS, 0.14, 4.51, headLine, CHARSIZE=0.9, COLOR=255 DEVICE, /CLOSE ; --- plots profile evolution at point spPt1 yspline=SPLINE(xscale, aprof, xspline) pPos=[0.15,0.13,0.95,0.89] xW=pPos[2]-pPos[0] yW=pPos[3]-pPos[1] SET_PLOT,'PS' !P.CHARSIZE=0.5 DEVICE,XS=8.9, YS=8, filename=figDir+fileTemp+'-evolution-'+EXTENSION(spPt,LENGTH=2)+'.eps',/COLOR, /avantgarde,/book spShift=0 PLOT, xspline/10., spShift+yspline, YR=[-20, 80], XR=[-0.15,0.15], XS=9, XTIT='nm', $ LINESTYLE=1, YTIT='Relative Intensity',POS=pPos,CHARSIZE=0.9,THICK=4, /NORM OPLOT, [-0.15,0.15],[0,0],LINESTYLE=1,THICK=2 AXIS, /XAXIS, XR=[-68.6,68.6],XS=1, CHARSIZE=0.9, xTITLE='km/s' ;this is km/s scale XYOUTS,-0.01, 70, 'b)', CHARSIZE=0.9, /DATA LOADCT, 13, /SILENT contrastArr=FLTARR(scanN+scStart+1,N_ELEMENTS(yspline)) FOR i=scanN+scStart, scanN+scStop DO BEGIN nScans=ABS(scStart)+ABS(scStop)+1 icnt=i-(scanN+scStart) color=0+125*(icnt)/FLOAT(nScans-1) sp=SPLINE(xscale, REFORM(scans[i,*,xy[0,spPt],xy[1,spPt]])/nKoef[spPt], xspline) ;;;;;;;;;;;; OPLOT, xspline/10., spShift+yspline-3*i, pSYM=-3, SYMSIZE=0.15, LINESTYLE=1, THICK=1, COLOR=0 OPLOT, xspline/10., spShift+sp-3*icnt, pSYM=-3, SYMSIZE=0.15, LINESTYLE=0, THICK=4, COLOR=color contrastProf=sp-yspline contrastArr[icnt,*]=contrastProf OPLOT, xspline/10., contrastProf, PSYM=-3, SYMSIZE=2, THICK=4, COLOR=color ENDFOR DEVICE, /CLOSE LOADCT, 0, /SILENT ; --- plots profile evolution at point spPt2 SpPt=2 yspline=SPLINE(xscale, aprof, xspline) pPos=[0.15,0.13,0.95,0.89] xW=pPos[2]-pPos[0] yW=pPos[3]-pPos[1] SET_PLOT,'PS' !P.CHARSIZE=0.5 DEVICE,XS=8.9, YS=8, filename=figDir+fileTemp+'-evolution-'+EXTENSION(spPt,LENGTH=2)+'.eps',/COLOR, /avantgarde,/book spShift=0 PLOT, xspline/10., spShift+yspline, YR=[-20, 80], XR=[-0.15,0.15], XS=9, XTIT='nm', $ LINESTYLE=1, YTIT='Relative Intensity',POS=pPos,CHARSIZE=0.9,THICK=4, /NORM OPLOT, [-0.15,0.15],[0,0],LINESTYLE=1,THICK=2 AXIS, /XAXIS, XR=[-68.6,68.6],XS=1, CHARSIZE=0.9, xTITLE='km/s' ;this is km/s scale XYOUTS,-0.01, 70, 'c)', CHARSIZE=0.9, /DATA LOADCT, 13, /SILENT contrastArr=FLTARR(scanN+scStart+1,N_ELEMENTS(yspline)) FOR i=scanN+scStart, scanN+scStop DO BEGIN nScans=ABS(scStart)+ABS(scStop)+1 icnt=i-(scanN+scStart) color=0+125*(icnt)/FLOAT(nScans-1) sp=SPLINE(xscale, REFORM(scans[i,*,xy[0,spPt],xy[1,spPt]])/nKoef[spPt], xspline) ;;;;;;;;;;;; OPLOT, xspline/10., spShift+yspline-3*i, pSYM=-3, SYMSIZE=0.15, LINESTYLE=1, THICK=1, COLOR=0 OPLOT, xspline/10., spShift+sp-3*icnt, pSYM=-3, SYMSIZE=0.15, LINESTYLE=0, THICK=4, COLOR=color contrastProf=sp-yspline contrastArr[icnt,*]=contrastProf OPLOT, xspline/10., contrastProf, PSYM=-3, SYMSIZE=2, THICK=4, COLOR=color ENDFOR DEVICE, /CLOSE LOADCT, 0, /SILENT ; --- plots profiles along the spine yspline=SPLINE(xscale, aprof, xspline) pPos=[0.15,0.13,0.95,0.89] SET_PLOT,'PS' !P.CHARSIZE=0.5 DEVICE,XS=8.9, YS=8, filename=figDir+fileTemp+'-profiles.eps',/COLOR, /avantgarde,/book spShift=0 PLOT, xspline/10., spShift+yspline, YR=[-20, 80], XR=[-0.15,0.15], XS=9, XTIT='nm', $ LINESTYLE=1, YTIT='Relative Intensity',POS=pPos,CHARSIZE=0.9,THICK=4,/NORM OPLOT, [-0.15,0.15],[0,0],LINESTYLE=1,THICK=2 AXIS, /XAXIS, XR=[-68.6,68.6],XS=1, CHARSIZE=0.9, xTITLE='km/s' ;this is km/s scale XYOUTS,-0.01, 70, 'a)', CHARSIZE=0.9, /DATA LOADCT, 13, /SILENT contrastArr=FLTARR(nPts,N_ELEMENTS(yspline)) FOR i=0, nPts-1 DO BEGIN color=255*i/FLOAT(nPts-1) sp=SPLINE(xscale, REFORM(scans[scanN,*,xy[0,i],xy[1,i]])/nKoef[i], xspline) ;;;;;;;;;;;; OPLOT, xspline/10., spShift+yspline-3*i, pSYM=-3, SYMSIZE=0.15, LINESTYLE=1, THICK=1, COLOR=0 OPLOT, xspline/10., spShift+sp-3*i, pSYM=-3, SYMSIZE=0.15, LINESTYLE=0, THICK=4, COLOR=color contrastProf=sp-yspline contrastArr[i,*]=contrastProf OPLOT, xspline/10., contrastProf, PSYM=-3, SYMSIZE=2, THICK=4, COLOR=color ENDFOR DEVICE, /CLOSE LOADCT, 0, /SILENT ; --- plots doppler and deapth of contrast profiles pPos=[0.15,0.13,0.95,0.89] DEVICE,XS=8.9, YS=8, filename=figDir+fileTemp+'-contrast.eps',/COLOR, /avantgarde,/book cogBlue=FLTARR(nPts) cogRed=FLTARR(nPts) maxBlue=FLTARR(nPts) maxRed=FLTARR(nPts) areaBlue=FLTARR(nPts) areaRed=FLTARR(nPts) FOR i=0, nPts-1 DO BEGIN tmp1=xspline[0:12] & tmp2=REFORM(contrastArr[i,0:12]) ind=WHERE(tmp2 LT 0) IF TOTAL(ind) GT 0 THEN BEGIN areaBlue[i]=TOTAL(tmp2[ind]) cogBlue[i]=TOTAL(tmp2[ind]*tmp1[ind])/areaBlue[i] ENDIF ELSE BEGIN areaBlue[i]=0 cogBlue[i]=0 ENDELSE tmp1=xspline[12:24] & tmp2=REFORM(contrastArr[i,12:24]) ind=WHERE(tmp2 LT 0) IF TOTAL(ind) GT 0 THEN BEGIN areaRed[i]=TOTAL(tmp2[ind]) cogRed[i]=TOTAL(tmp2[ind]*tmp1[ind])/areaRed[i] ENDIF ELSE BEGIN areaRed[i]=0 cogRed[i]=0 ENDELSE ENDFOR CIRCLE, /FILL imgNum=FINDGEN(nPts)+1 PLOT, cogBlue/10, imgNum, XTIT='!9l!X!Dcog!N, nm', LINESTYLE=0, PSYM=-5, YTIT='Data Point Number along the Spine', $ POS=pPos,/NORM, YR=[0.9,MAX(imgNum)+0.1],YS=1,XR=[-0.2,0.2],XS=9,CHARSIZE=0.9,/NODATA AXIS, /XAXIS, XR=[-91.5,91.5],XS=1,XMINOR=5, CHARSIZE=0.9, xTITLE='km/s' ;this is km/s scale68 tmp=areaBlue/1000 tmpbx=[0,tmp,0] tmpby=[1,imgNum,MAX(imgNum)] LOADCT, 1, /SILENT ;OPLOT, tmpbx, tmpby, PSYM=-3, SYMSIZE=0.15, COLOR=230 polyfill, tmpbx,tmpby,color=230 ; sign change for AreaRed and areaBlue for plotting purposed only tmp=-areaRed/1000 tmprx=[0,tmp,0] tmpry=[1,imgNum,MAX(imgNum)] LOADCT, 3, /SILENT OPLOT, tmprx, tmpry, PSYM=-3, SYMSIZE=0.15, COLOR=200 polyfill, tmprx,tmpry,color=160 ;OPLOT, tmprx, tmpry, PSYM=-3, SYMSIZE=0.15, COLOR=140 ;OPLOT, cogRed/10, imgNUm, PSYM=-3, SYMSIZE=0.3, THICK=4, COLOR=100 ;OPLOT, cogRed/10, imgNUm, PSYM=8, SYMSIZE=0.2, THICK=0, COLOR=255 ;OPLOT, cogRed/10, imgNUm, PSYM=8, SYMSIZE=0.15, THICK=0, COLOR=180 LOADCT,1 , /SILENT OPLOT, tmpbx, tmpby, PSYM=-3, SYMSIZE=0.15, COLOR=180 OPLOT, cogBlue/10, imgNUm, PSYM=-3, SYMSIZE=0.2, THICK=4, COLOR=100 OPLOT, cogBlue/10, imgNUm, PSYM=8, SYMSIZE=0.2, COLOR=255 OPLOT, cogBlue/10, imgNUm, PSYM=8, SYMSIZE=0.15, COLOR=180 LOADCT, 0, /SILENT OPLOT, [0,0],[0,nPts], LINESTYLE=1 XYOUTS,-0.01, 3.75, 'd)', CHARSIZE=0.9, /DATA DEVICE, /CLOSE LOADCT, 0, /SILENT SET_PLOT,'X' END