;+
; NAME:
;	SMEI_SEQUENCE::GET_N_PLANES
;
;
; PURPOSE:
;	Return number of available planes in the images of a SMEI
;	sequence. 
;
;
; CATEGORY:
;	SMEI_SEQUENCE
;
;
; CALLING SEQUENCE:
;	planes=seqref->get_n_planes()
;
;
; OUTPUTS:
;	planes	The number of available RAW images planes in the sequence.
;
;
; MODIFICATION HISTORY:
;	Original: 19/5/03; SJT
;-

function smei_sequence::get_n_planes

img = self -> get_first()
if not obj_valid(img) then return, 0

npl = 100                   ; Lots more than we'll ever have (I hope).

while obj_valid(img) do begin
    if img -> get_pflags(/compact) then return, 0
    npl = npl < (img -> get_planes())
    img = img -> get_next()
endwhile

return, npl

end
