PRO DIG_DOPPL,cube,x0,xdiam,ydiam,shft,xc,yc,doppl ; ;Calculation of a Dopplergram in H-alpha core. ; For the spectroheliograph dispersion 0.25 A/pix at H-alpha, corresponding to ; 11.4 km/s per pixel, the obtained velocity step is 0.57 km/s (refinement 20) ; ;INPUTS: cube - a 3D integer data array (lambda, y(slit), x(scan)) ; x0 - centre line position (pix) from DIG_FLAT ; xdiam,ydiam - x,y diameters of the solar disk (pix) ; shft - a 1D float array with x-shifts (pix) to rectify the solar disc ; xc,yc - coordinates of the disk centre (pix); shft,xc,yc from DISKCOR3 ;OUTPUT: doppl - a 2D float array with resulting Dopplergram ; ;Method: The line position is determined using two 'slits' with a fixed distance ; 4 pix (1 A) located in the opposite wings of the H-alpha core. We look for such ; position of both slits where the intensities on them are 'equal'. ; Since the dispersion is too low, we make the linear interpolation of the intensities ; in the H-alpha profile with a factor of 20. ; ; Needs about 1G of memory. Side effect: cube array set to 0. ; ; Copyright M. Sobotka and M. Klvana, ASU AVCR Ondrejov, Czech Rep., 2009 ; scale=(-0.57) ;km/s per 1/20 pix; + away, - to us si=size(cube) ;3D size dopl=intarr(si(3),si(2)) ;array for dopplergram x0=round(x0) cube=cube(x0-4:x0+4,*,*) ;necessary range for H-alpha cube=rebin(cube,180,si(2),si(3)) ;refining 20x Ha, 1 step = 0.57 km/s cube=cube(0:160,*,*) ;cut away constant tail difc=cube-shift(cube,80,0,0) ;compare shifted spectra (shift 80) cube=0 ;to save memory difc=abs(difc(80:160,*,*)) ;abs difference in the usefull range ;at which position is the minimum of difference? for i=0,si(3)-1 do begin for j=0,si(2)-1 do begin mi=min(difc(*,j,i),pos) dopl(i,j)=pos ;store the position into the dopplergram endfor endfor ;rectification (like DISKCOR3) dopl=float(dopl) aspect=float(ydiam)/float(xdiam) ;aspect ratio dopl=congrid(dopl,round(si(3)*aspect),si(2),cubic=(-0.5)) si=size(dopl) ; new size, 2D doppl=dopl*0. for j=0,si(2)-1 do begin xx=findgen(si(1))+shft(j) rect=interpolate(dopl(*,j),xx) doppl(*,j)=rect endfor doppl=shift(doppl,si(1)/2-xc,si(2)/2-yc) cenx=si(1)/2+1 ceny=si(2)/2+1 ;what is disk and what is not disk x1=findgen(si(1)) ; cartesian coordinates xx=fltarr(si(1),si(2)) for j=0,si(2)-1 do xx(*,j)=x1 y1=findgen(si(2)) yy=fltarr(si(1),si(2)) for i=0,si(1)-1 do yy(i,*)=y1 xx=xx-cenx yy=yy-ceny rr=sqrt(xx^2+yy^2) ; distance array wdisk=where(rr lt ydiam/2-3, cdisk) wnon =where(rr gt ydiam/2-3) ;scaling hi=histogram(doppl(wdisk),bin=1,locations=lampix) hmax=max(hi,hmaxpos) zero=lampix(hmaxpos)+0.5 ; most frequent speed taken as zero ; zero=total(doppl(wdisk))/cdisk ; another option, not used doppl=scale*(doppl-zero) ;km/s doppl(wnon)=0. doppl=doppl>(-15.) ;range limits from -15 to +15 km/s doppl=doppl<15. print,'Dopplergram calculated' END