function STEPPER2, input1, input2, input3, $
	INFO_ARRAY=INFO_ARRAY, SUBSCRIPT=SUBSCRIPT, $
	NOSCALE=NOSCALE, COLOR=COLOR, $
	qstop=qstop
;+
;  NAME:
;	STEPPER2
;  PURPOSE:
;       Step through individual images a single frame at a time
;       and permit flagging the output vector with a 0 or 1.
;       It is possible to switch back and forth on a given image
;       as much as you want.  No movie mode here but otherwise
;       stepping or jumping through the data cube is the same
;       as in stepper.
;  SAMPLE CALLING SEQUENCE:
;	output = stepper2(input1, [input2, input3, $
;        INFO_ARRAY=INFO_ARRAY, SUBSCRIPT=SUBSCRIPT, $
;        NOSCALE=NOSCALE, COLOR=COLOR, $
;        qstop=qstop]
;	out = stepper2(data)
;	out = stepper2(index,data)
;	out = stepper2(index,data,info_array)
;	out = stepper2(data,info_array)
;  INPUT:
;	DATA = Three-dimensional array
;  OUTPUT
;       A vector of 0's and 1's permitting easy selection or
;       de-selection of images for further processing.
;  OPTIONAL INPUTS:
;	INDEX         = The index structure that goes with the data
;       INFO_ARRAY    = descriptive text string (pass as parameter or keyword)
;  OPTIONAL INPUT KEYWORDS:
;	INFO_ARRAY  = String array containing descriptive text
;	NOSCALE	    = If set, will turn off tvscale
;	SUBSCRIPT   = Subset of array is displayed.
;	COLOR	    = The color to use for displaying the info text string.
;  HISTORY:
;	11-Nov-2002, LWA; created from stepper to return 0/1 vector.
;	21-May-2003, LWA; corrected program to return vector of 0's and 1's
;-

on_error,2		; Return to caller

typ1 = data_type(input1)
typ2 = data_type(input2)

if keyword_set(subscript) then out=intarr(n_elements(subscript))

case 1 of
    (typ2 eq 0): begin
	;only data passed
		if n_elements(out) eq 0 then begin
	   	   nimg=data_chk(input1,/nimages)
		   out=intarr(nimg)
		endif
		STEPPER2_s1,input1, $
		INFO_ARRAY=INFO_ARRAY,$
		NOSCALE=NOSCALE, SUBSCRIPT=SUBSCRIPT, $
		COLOR=COLOR, out=out
    end
    (typ1 eq 8): begin
	;index,data or index,data,info passed
		if (n_elements(input3) ne 0) then info_array = input3
		if (n_elements(info_array) eq 0) $
	   	then info_array = get_info(input1, /noninteractive)
                if n_elements(out) eq 0 then begin
		   out=intarr(n_elements(input1))
		endif
		STEPPER2_s1,input2, $
		INFO_ARRAY=INFO_ARRAY,$
		NOSCALE=NOSCALE, SUBSCRIPT=SUBSCRIPT, $
		COLOR=COLOR, out=out
    end
    (typ2 eq 7): begin
	;data, info_array passed
                if n_elements(out) eq 0 then begin
                     nimg=data_chk(input1,/nimages)
                     out=intarr(nimg)
		endif
		STEPPER2_s1,input1, $
		INFO_ARRAY=input2, $
		NOSCALE=NOSCALE, SUBSCRIPT=SUBSCRIPT, $
		COLOR=COLOR,out=out
    end
endcase

if (keyword_set(qstop)) then stop
;outarr=where(out eq 0)
return, out

end
