;+
; ZMOVINATE 
;
; Generate a list of (floating-point) indices into an array of times,
; representing where in the array each frame of a movie should be sampled.
;
;
; FORM
;	a = zmovinate(times,cadence,start,duration)
;
; USAGE
; 	mreadfits,files,ahdr,a
; 	frame_indices = zmovinate(zintervals(ahdr),60)
;
;
; INPUT PARAMETERS
;	times - an array of the frame times (relative to start of the movie)
;	cadence - (OPTIONAL) The number of seconds between frames
;
; RETURN VALUE
;
;	Gives back a list of indices into an array of images/headers
;	corresponding to the cadence of times specified (in seconds) by
;	<interval>.
;
; 	If <cadence> is not specified, zmovinate should guess -- but 
;	doesn't.
;
;-
function zmovinate,times,cadence,duration=duration,start=start

if not isvalid(start) then start = min(times)
if not isvalid(duration) then duration = max(times) - min(times)

return,interpol(lindgen(n_elements(times)),times,cadence*lindgen(long(duration/cadence)+1))

end
