pro finddrift,seq,dark,first,last,cent,thre

cent=fltarr(3,last-first+1) & nt = (n_elements(thre) eq 1)
exten='.0000' & dark=strtrim(string(dark),2)	;get name of dark
strput,exten,dark,5-strlen(dark)
fzrd,seq+exten,dk	;read dark
exten='.0000'
for i=first,last do begin	;loop over image series
  imno=strtrim(string(i),2)
  strput,exten,imno,5-strlen(imno)
  fzrd,seq+exten,img & img=img-dk	;read image and dark correct
  if nt then begin
    cent(0,i-first)=center(img,thre) & endif $
  else begin 
    cent(0,i-first)=center(img)
  endelse
endfor

end

