function smthy_skip,ipd,yy=yy

;+
;NAME
;	smthy_skip
;PURPOSE
;	To creat movies with cadence longer than 32.8 minutes.
;CALLING SEQUENCE
;	out=smthy_skip(2,1992), 2 images per day for 1992
;INPUT
;	ipd, number of images per 24 hour day desired
;OPTIONAL KEYWORD INPUT
;	yy, years to process
;	   Default = 1991 through 2001
;OUTPUT
;	Image cube of desired cadence from smthy_jpg files.
;HISTORY
;	19-May-2017 LWA
;-

if not keyword_set(yy) then yy=string(indgen(11)+1991) $
   else yy=yy
yy=strtrim(yy,2)
for i=0,n_elements(yy)-1 do begin
   tmp=file_search('smthy_jpg/'+yy(i)+'/*')
   print,i,'   ',yy(i),n_elements(tmp)
   if yy eq '1991' then tmp=tmp(19:n_elements(tmp))
   if i eq 0 then begin
   jfil=tmp
   endif else begin 
   jfil=[jfil,tmp] 
   endelse
endfor
   tymz=anytim(gtym(jfil),/ints)
   mdur=anytim(tymz(n_elements(tymz)-1))-anytim(tymz(0))
   numjpg=long(mdur/((24./ipd)*60.*60.))
   imgtym=(lindgen(numjpg)*(24./ipd)*60.*60.)+anytim(tymz(0))
   imgtym=anytim(imgtym,/ints)
   nn0=tim2dset(tymz,imgtym,offset=off)
   tolong=2.*24.*60.*60.
   ok=where(abs(off) le tolong)
   nn1=nn0(ok)
   uu=uniq(nn1)
   nn2=nn1(uu)
   help,nn0,nn1,nn2
   data=intarr(512,512,n_elements(nn2))
   for j=0l,n_elements(nn2)-1 do begin
      if j mod 25 eq 0 then print,j,'  ',jfil(nn2(j))
      read_jpeg,jfil(nn2(j)),img
      img=bytscl(total(img,1))
      data(0,0,j)=img
   endfor
   return,data
end
