PRO correli,date,from,to ; ;CORRELATION of IR images to match the WL ones, one by one. ;This version is intended for the processing of the IR observations ;of 23, 25 June 1997 (SVST). It can be used for other data only ;after a careful inspection and changes of many intrinsic parameters. ;It is expected to be run from the 'irdata' directory, although ;it reads also data from the 'wldata' directory. ;Program steps: 1) Re-scaling the IR frames ; 2) Correlation of IR to WL frames (ALIGN_C2) ;INPUTS: date = 23 or 25 ; from = first frame ; to = last frame ; files 'irXX.*' (stabilized and MTF-deconvolved IR) ; 'wdeXX.*' (stabilized, MTF-deconv. and destretched WL) ;OUTPUTS: files 'iceXX.*' (correlated IR) ; 'wreXX.*' (like 'wde', but only working subfield) ;3 August 1999 ; on_error,1 ; IMAGE PARAMETERS --------------------------------------------- if (date ne 23) and (date ne 25) then $ message,'Sorry, I do not know how to handle this dataset' dat=strtrim(date,2) iim=intarr(224,224) ; IR read-in array wim=intarr(472,400) ; WL read-in array if date eq 23 then begin cix1=15 ;primary IR clean area cix2=214 ciy1=49 ciy2=216 isx=443 ;size of re-scaled IR images isy=368 coff=[23,-38] ;constant offset WL-IR aix1=109 ;correlation (alignment) subfield IR aix2=188 aiy1=103 aiy2=182 awx1=aix1+coff(0) ;correlation (alignment) subfield WL awx2=aix2+coff(0) awy1=aiy1+coff(1) awy2=aiy2+coff(1) wx=aix2-aix1+1-22 ;parameters for ALIGN_C2 (+/- 10 pix) wy=aiy2-aiy1+1-22 cx1=28 ;working subfield = final size IR, WL cx2=435 cy1=5 cy2=324 endif else begin cix1=11 ;primary IR clean area cix2=194 ciy1=40 ciy2=207 isx=407 ;size of re-scaled IR images isy=368 coff=[9,-56] ;constant offset WL-IR aix1=288 ;correlation (alignment) subfield IR aix2=367 aiy1=119 aiy2=198 awx1=aix1+coff(0) ;correlation (alignment) subfield WL awx2=aix2+coff(0) awy1=aiy1+coff(1) awy2=aiy2+coff(1) wx=aix2-aix1+1-22 ;parameters for ALIGN_C2 (+/- 10 pix) wy=aiy2-aiy1+1-22 cx1=13 ;working subfield = final size IR, WL cx2=400 cy1=5 cy2=304 endelse ; ----------------------------------------------------------------- for i=from,to do begin ;LOOP OVER FRAMES ; READING (path specifications) print,'reading '+strtrim(i,2) openr,1,dat+'jun/ir'+dat+'.'+strtrim(i,2) readu,1,iim close,1 openr,1,'../wldata/'+dat+'jun/wde'+dat+'.'+strtrim(i,2) readu,1,wim close,1 ; ROTATING 0.5 deg clockwise im=ROT(iim,0.5,cubic=(-0.5)) ; RE-SCALING ir=CONGRID(im(cix1:cix2,ciy1:ciy2),isx,isy,cubic=(-0.5)) ; CORRELATION offset=NINT(ALIGN_C2(wim(awx1:awx2,awy1:awy2), $ ir(aix1:aix2,aiy1:aiy2),flg,wx,wy)) print,' offset =',offset offset=offset+coff ;constant+variable offset ir=SHIFT(ir,offset(0),offset(1)) ; EXTRACTION OF WORKING SUBFIELD ir=ir(cx1:cx2,cy1:cy2) wr=wim(cx1:cx2,cy1:cy2) ; WRITING openw,1,dat+'jun/ice'+dat+'.'+strtrim(i,2) writeu,1,ir close,1 openw,1,'../wldata/'+dat+'jun/wre'+dat+'.'+strtrim(i,2) writeu,1,wr close,1 endfor print,'Output size of images:',cx2-cx1+1,cy2-cy1+1 END