;+
; NAME:
;	SMEI_SEQUENCE::CALC_COUNT
;
;
; PURPOSE:
;	To calculate the number of images in a SMEI sequence
;
;
; CATEGORY:
;	SMEI_SEQUENCE
;
;
; CALLING SEQUENCE:
;	seqref -> calc_count
;
;
; SIDE EFFECTS:
;	The count field is updated.
;
;
; MODIFICATION HISTORY:
;	Original: 10/12/02; SJT
;-

pro smei_sequence::calc_count

si = self -> get_first()
if not obj_valid(si) then begin
    self.n_image = 0
    return
endif 

n = 0l

while obj_valid(si) do begin
    si = si -> get_next()
    n = n+1
endwhile

self.n_image = n

end
