pro timeq2,movin,tim,step,out ; Procedure to make the frames in the movie equidistant in time. ; Version 2 - interpolation to arbitrary time_step. ; Based on linear interpolation of time-vector for each pixel. ; INPUTS: movin = input movie (3-D array) ; tim = 1-D array with original non-eqiudistant time data ; (e.g. tim=reform(sel(1,*)). ; step = desired time step ; OUTPUTS: out = interpolated output movie, equidistant in time, ; with time_step = step. ; Calling: INTERPOL ; Example: TIMEQ2,gms,tim,1,gmsi ; 17.5.96, Michal sim=size(movin) sit=size(tim) if (sim(0) ne 3) or (sit(0) ne 1) then goto,wrong if sim(3) ne sit(1) then goto,wrong n=sim(3) ; no. of frames in input movie print,'time beginning at',tim(0) ti=tim-tim(0) ; setting start of time log to zero m=fix(ti(n-1)/step) ; no. of interpolated frames print,'new number of frames:',m ti=ti/step ; non-equidistant time-abscissa tie=findgen(m) ; equidistant time-abscissa out=fltarr(sim(1),sim(2),m) ; output array for y=0,sim(2)-1 do begin for x=0,sim(1)-1 do begin out(x,y,*)=interpol(movin(x,y,*),ti,tie) endfor print,y endfor goto,fin wrong: print,'WRONG INPUT ARRAYS: bad dimensions or incompatible sizes' out=0 fin: end