pro destreo,movin,movout,wid,optio,reb ; DESTRETCHING of a movie in a 3-D array MOVIN, result is a 3-D array MOVOUT. ; Main for DEFORMO (procedures called by DEFORMO are SMOOTHE, DISTORTI, ; MEAN, SCONVOL, ODD, (KCONVOL) (Oslo)). ; ; WID - FWHM of Gaussian window in determination of displacement map. ; (reasonable value: 32[16] pix, i.e. 2") ; Reference image: either the floating average of movie frames ; or preceeding destretched frame (recurrent definition). ; This is selected by "OPTIO": optio=0, recurrent. ; optio=num>1, floating average, where num gives the number of frames ; to be averaged. (reasonable value: 5 - 7 frames) ; REB: down-rebining parameter for image correlation ; (reb=1 is best for scale ~ 0.125", reb=2 for ~ 0.062"). ; It depends also on WID: for large wid large reb can be used. ; ------------------ PARAMETERS TO BE SET --------------------------- smo = 3 ;13 ; SMOOTHING PARAMETER FOR UNSHARP MASKING (17[9]~1", 25[13]~1.5") umq = 0 ;0.5 ; UNSHARP MASKING COEFF. (0: no masking, 1: total difference) ; ------------------------------------------------------------------- smov=size(movin) if smov(0) ne 3 then begin print,'DESTREO: Input must be a 3-D array!' stop endif nima=smov(3) print,'number of frames:',nima movout=movin*0 ; reference selection switch if optio eq 0 then goto,recur ; floating average reference optio=optio>3 optio=optio0 ul=ll+fix(optio)-1 if ul gt (nima-1) then begin ul=fix(nima-1) ll=ul-fix(optio)+1 ; only for series 8 (big time-lag of last frame) ; if i eq nima-1 then ll=i-3 endif print,'reference',i,' averaged from-to',ll,ul ref=total(movin(*,*,ll:ul),3)/optio ; total returns float if smov(4) eq 1 then ref=bytscl(ref) ; conversion to bytes if smov(4) eq 2 then ref=fix(ref) ; conversion to integer print,'processing frame no.',i DEFORMO,movin(*,*,i),ref,war,smo,umq,wid,reb,/interp movout(0,0,i)=war endfor goto,fin ; recurrent reference recur: ref=movin(*,*,0) movout(0,0,0)=ref for i=1,nima-1 do begin print,'processing frame no.',i DEFORMO,movin(*,*,i),ref,war,smo,umq,wid,reb,/interp movout(0,0,i)=war ref=movout(*,*,i) endfor fin: print,'End of program' end