PRO STEPPER3_S1,header, DATA, INFO_ARRAY=INFO_ARRAY,$ NOSCALE=NOSCALE, SUBSCRIPT=SUBSCRIPT,quiet=quiet, $ COLOR=COLOR,out=out,pauz=pauz,bin=bin,sho_pfi=sho_pfi ;+ ; NAME: ; STEPPER3_s1 ; PURPOSE: ; Step through individual images a single frame at a time ; and permit flagging the output vector with a 0, 1 or 2. ; It is possible to switch back and forth on a given image ; as much as you want. Sstepping or jumping through the data ; cube is the same as in stepper. ; INPUTS: ; DATA = Three-dimensional array ; OUTPUT ; A vector of 0's, 1's or 2'2permitting easy selection or ; de-selection of images for further processing. ; PROCEDURE ; In addition to the usual stepper commands this version ; draws the PFI OR for an "o", a Stonyhurst disk and all ; of the NOAA active region numbers for an "r", and a ; dotted limb for an "l". ; 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. ; PAUZ = Number of sec to wait between frames. (Default=0.0) ; bin = Magnification to use in plotting PFi FOV. ; /sho_pfi, show PFI FOV with every image. ; /quiet, do not print out the intro info. ; HISTORY: ; 4-May-2005 LWA, Created from stepper2_s1. ; 5-May-2005 LWA, Replaced j, k, l with 0, 1, 2. ; Moved flag messages to bottom of screen. ; 14-May-2005 LWA, Added a 4th flag. Now: 0, 1, 2 or 3. ; 14-Oct-2005 LWA, Changed xyouts charsize to 1.5. ; 6-Dec-2005 LWA, Debut xyouts, extra charsize. ; 9-Dec-2005 LWA, Moved xyouts a bit left. ; 7-Jan-2008 LWA, Added 5th flat. Now: 0, 1, 2, 3, or 4. ; 22-Feb-2008 AkT, Added l to draw solar limb as a guide. ; 25-Jan-2009 LWA, Added keyword pauz. ; 6-May-2009 LWA, Added OR and NOAA AR capability. ; 12-May-2009 LWA, Added keyword bin for plotting PFI FOV. ; 4-May-2010 LWA Added keyword quiet. ; 8-May-2013 LWA Added /quiet in call to get_rb0p. ;- ;on_error,2 ; Return to caller ans= '' if not keyword_set(pauz) then pauz=0.0 else pauz=pauz if not keyword_set(bin) then bin=1. else bin=bin if n_elements(color) eq 0 then color=255 ; Default color nimg=data_chk(DATA,/nimages) quiet=keyword_set(quiet) if (n_elements(subscript) eq 0) then subscript = indgen(nimg) n_sel = n_elements(subscript) ; See if we should turn off the tvscl option: if keyword_set(noscale) then nosc = 0 else nosc = 2 DISP = nosc ; Set up info_array if it does not exist already: if n_elements(info_array) eq 0 then begin if n_elements(info_p) eq 0 then $ info_array = strtrim(string(indgen(nimg))+' :',2) $ else info_array = info_p endif stt=0 ; Starting image stt = min(abs(stt-subscript)) & stt=!c & !c=0 ; Get closest index i = stt qdisp = 1 qmovie = 0 qprint = 1 ;always print the menu message the first time qdone = 0 qfirst = 1 while not qdone do begin if not quiet then begin if (qfirst or qprint) then begin print, '-------- STEPPER3 Options --------' print,'There are ',strtrim(string(nimg),2),' images in the array' print,'There are ',strtrim(string(n_sel),2),' images selected' print, 'Enter "b" to step backwards' print, ' "m" for movie mode' print, ' "s" to select new start index' print, ' "l" to draw solar limb that should be.' print, ' "0" to set out(i) to 0.' print, ' "1" to set out(i) to 1.' print, ' "2" to set out(i) to 2.' print, ' "3" to set out(i) to 3.' print, ' "4" to set out(i) to 4.' print, ' "q" to quit' print, ' "anything else" to step forward' end endif qprint = 0 if (not qfirst) then ans = get_kbrd(1-qmovie) ans = strlowcase(ans) ; Convert to lower case if (qmovie) and (ans ne '') then begin qmovie = 0 qdisp = 0 ;;ans = '-' ;zero out the answer which stopped movie (might be "q") end qdisp = qfirst case ans of '-': ;do nothing 'm': begin ;movie mode selected ;print,'Type anything to abort movie mode ("q" will exit movie and STEPPER)' qmovie = 1 qdisp = 1 end 'b': begin i = i-1 if i lt 0 then i=n_sel-1 qdisp = 1 end 'q': qdone = 1 's': begin print,'* Enter the requested start image number',format='($,a)' read,i i=min(abs(i-subscript)) i=!c !c=0 qdisp = 1 end 'l': begin ; draw limb circle at the position that should be. date=strmid(info_array(i),strpos(info_array(i),'-')-2,9) rad=get_rb0p(date,/radius,/quiet)/4.91 ; draw_circle,256.,280.5,rad-3,/dev,linestyle=1 ; print,header(i).crpix1-1,header(i).crpix2-1,rad-3 draw_circle,bin*header(i).crpix1-1,bin*header(i).crpix2-1,bin*rad-3,/dev,linestyle=1 end 'r': begin plot_nar,header(i),/noerase end 'o': begin pfi_movy_loc,header(i),bin=bin end '0': begin out(i)=0 xyouts,charsize=1.5,/norm,0.15,0.05,'Switched out('+strtrim(i,2)+') value to'+string(out(i)) end '1': begin out(i)=1 xyouts,charsize=1.5,/norm,0.15,0.05,'Switched out('+strtrim(i,2)+') value to'+string(out(i)) end '2': begin out(i)=2 xyouts,charsize=1.5,/norm,0.15,0.05,'Switched out('+strtrim(i,2)+') value to'+string(out(i)) end '3': begin out(i)=3 xyouts,charsize=1.5,/norm,0.15,0.05,'Switched out('+strtrim(i,2)+') value to'+string(out(i)) end '4': begin out(i)=4 xyouts,charsize=1.5,/norm,0.15,0.05,'Switched out('+strtrim(i,2)+') value to'+string(out(i)) end '*': stop else: if (not qfirst) then begin i = i + 1 if i ge n_sel then i = 0 qdisp = 1 end endcase if (qdisp) then begin j = subscript(i) ; Get selected images x0=0 & y0=0 case DISP of ; rebinn,noscale 0: tv,data(*,*,j), x0, y0 ; 0 , 0 2: tvscl,data(*,*,j), x0, y0 ; 0 , 2 endcase xyouts,charsize=1.5,/norm,0.15,0.09,'Currently out('+strtrim(i,2)+') is set to'+string(out(i)) break_point = 38 ; Break point if (get_logenv('STEPPER_BREAK') ne '') then break_point = fix(getenv('STEPPER_BREAK')) if strlen(info_array(j)) le break_point then begin xyouts,charsize=1.5,/norm,x0,y0+.90,info_array(j),color=color endif else begin str0 = strmid(info_array(j),0,break_point) str1 = strmid(info_array(j),break_point,strlen(info_array(j))) xyouts,charsize=1.5,/norm,x0+.02,y0+.91,str1,color=color xyouts,charsize=1.5,/norm,x0,y0+.95,str0,color=color endelse if sho_pfi then pfi_movy_loc,header(i),bin=bin,/quiet wait,pauz end qfirst = 0 end return end