;+
; NAME:
;	SMEI_SEQUENCE::GET_SUMMARY
;
;
; PURPOSE:
;	Generate a summary of the images in a SMEI sequence
;
;
; CATEGORY:
;	SMEI_SEQUENCE
;
;
; CALLING SEQUENCE:
;	desc = seqref->get_summary()
;
;
; KEYWORD PARAMETERS:
;	/nofile		If set, then don't include the filename
;	/print		If set, then print the description.
;	/nohead		If set, then don't add a header.
;	/numbered	If set, then add a sequence number before the
;			description 
;
;
; OUTPUTS:
;	desc	string	A string array with the descriptions.
;
;
; MODIFICATION HISTORY:
;	Original: 13/12/02; SJT
;	Add NUMBERED keyword: 15/4/10; SJT
;-

function smei_sequence::get_summary, nofile = nofile, print = print, $
                                     nohead = nohead, numbered = numbered

desc = string(self -> get_name(), self -> get_count(), $
              format = "('Sequence',A,' has ',I0,' Images')")

im = self -> get_first()
while obj_valid(im) do begin
    desc = [desc, im -> get_summary(nofile = nofile)]
    im = im -> get_next()
endwhile

if keyword_set(print) then print, desc, format = "(A)"

if n_elements(desc) eq 1 then desc = [desc, ''] $
else if keyword_set(numbered) then begin
    ipl = floor(alog10(self -> get_count()))+1
    nums = string(indgen(n_elements(desc)-1)+1, format = $
                  "(I"+string(ipl, format = "(I0)")+",') ')")
    for j = 0, ipl+1 do desc[0] = ' '+desc[0]
    desc[1:*] = nums+desc[1:*]
endif

if keyword_set(nohead) then return, desc[1:*]

return, desc

end
