pro gsstab2,logarr,reffn,shfts ; CORRECTION OF GLOBAL SHIFTS of a series of frames stored at the disk ; by SAVE2. ; Stabilization is made in a 128x128 working subfield of 312x312 frame. ; Then, the stabilized frame is cutted to 288x288 to remove the border ; effects of SHIFT. ; Stabilized frames are stored using RESTORE2. ; Inputs: LOGARR - log array with frame numbers in log(1,*) ; REFFN - no. of reference frame ; files 'imre.frame_no' ; Outputs: SHFTS - array: frame_no, shift_x, shift_y, flg ; files 'spotgs.frame_no' ; Procedures called: ALIGN_C2, FIVEPOIN, MAXLOC, MEAN, NINT ; Special version of 15.3.95, Michal. ;............PARAMETERS.................................... wx=128-34 ;this allows the shifts up to +/- 16 pixels wy=128-34 ; (see comments in ALIGN_C2) st1='/dat/granny_3/sob/d1/imre.' ; PATH...in st2='/dat/granny_3/sob/d1/spotgs.' ; PATH...out ;.......................................................... si=size(logarr) nima=si(2) print,'number of frames:',nima shfts=intarr(4,nima) ; Read reference frame seq=strtrim(string(fix(reffn)),2) restore2,st1+seq,ref ; full 600x450 image ref=ref(15:326,21:332) ; sunspot frame ref=ref(98:225,98:225) ; working subfield print,'Reference frame '+seq+' ready' ; Loop over frames for i=0,nima-1 do begin ; Read frno=fix(logarr(1,i)) seq=strtrim(string(frno),2) print,'Processing image '+seq restore2,st1+seq,ima ; full 600x450 image ; Extract sunspot frame and working subfield ima=ima(15:326,21:332) ; sunspot frame wrk=ima(98:225,98:225) ; working subfield ; Alignment ; .......................................... offset=nint(align_c2(ref,wrk,flg,wx,wy)) ; .......................................... shfts(0,i)=[frno,offset,flg] print,i,' shifts:',offset imsh=shift(ima,offset(0),offset(1)) ; Cut the borders and save the 288x288 stabilized frame save2,st2+seq,imsh(12:299,12:299) endfor end