;+
; NAME:
;	SMEI_SEQUENCE::GET_IMAGE
;
;
; PURPOSE:
;	Get the reference for an image in the sequence.
;
;
; CATEGORY:
;	SMEI_SEQUENCE
;
;
; CALLING SEQUENCE:
;	imref = seqref->get_image(location)
;
;
; INPUTS:
;	location	long	The sequence number of the required image.
;
;
; OUTPUTS:
;	imref	objref	The reference to the selected image.
;
;
; MODIFICATION HISTORY:
;	Original: 10/12/02; SJT
;-

function smei_sequence::get_image, location

if location gt self -> get_count() - 1 or location lt 0 then begin
    smei_msg, /alert, "The requested image is out of range"
    return, -1
endif

im = self -> get_first()
for j = 1, location do im = im -> get_next()

return, im

end
                       
