Viewing contents of file '../idllib/iuedac/iuelib/pro/bs_plotflag.pro'
;******************************************************************************
;+
;*NAME:
;
;    	BS_PLOTFLAG     (RDAF General Production Library)    Jan 30, l983
;
;*CLASS: 
;
;    	Data Editing
;
;*CATEGORY:
;
;	IUESIPS          NEWSIPS
;    
;*PURPOSE:
;
;    	Overplot IUESIPS or NEWSIPS flagged data, overplot flagged interpolated
;       data, and overplot user flagged data when called indirectly by BSPOT
;    	through a call from FLAGBLEM.
;
;*CALLING SEQUENCE:
;
;    	BS_PLOTFLAG,WAVE,FLUX,EPS,NEWSIPS
;
;*PARAMETERS:
;
;    	WAVE 	(REQ) (I) (1) (R)
;           	Input wavelength vector in Angstroms from input IUESIPS LBLS or
;               NEWSIPS SILO file originally read by BSPOT and then passed into
;               FLAGBLEM.
;
;    	FLUX 	(REQ) (I) (1) (R)
;           	Input flux vector obtained from input IUESIPS LBLS or NEWSIPS
;               SILO file as above WAVE vector.
;
;    	EPS  	(REQ) (I) (1) (R)
;           	Input IUESIPS epsilon vector quality flags or NEWSIPS nu flags
;               to mark questionable data at each wavelength obtained from
;               input IUESIPS LBLS or NEWSIPS SILO file as above FLUX vector.
;
;       NEWSIPS (REQ) (I) (0) (I)
;               Equals 0 for IUESIPS data.  Equals 1 for NEWSIPS data.
;
;*EXAMPLES:
;
;    	See BSPOT.PRO
;
;*SYSTEM VARIABLES USED:
;
;	none
;
;*INTERACTIVE INPUT:
;
;    	See BSPOT.PRO
;
;*SUBROUTINES CALLED:
;
;	PARCHECK
;
;*FILES USED:
;
;*SIDE EFFECTS:
;
;*NOTES:
;
;    	See BSPOT.PRO
;
;*PROCEDURE:    
;
;*I_HELP nn:
;
;*MODIFICATION HISTORY:
;
;    	27-APR-88  HAA add RDAF Prolog
;       jan-10-90 jtb @gsfc modified for unix / sun idl version 1.2
;	jul-22-91 pjl @gsfc cleaned up; added npar equal 0 and PARCHECK;
;			    tested on SUN and VAX; updated prolog
;        6 Apr 94  PJL  added newsips parameter
;
;-
;******************************************************************************
 pro bs_plotflag,wave,flux,eps,newsips
;
 npar = n_params(0)
 if (npar eq 0) then begin
    print,'BS_PLOTFLAG,WAVE,FLUX,EPS,NEWSIPS'
    retall
 endif  ; npar eq 0
 parcheck,npar,4,'BS_PLOTFLAG'
;
 if (newsips) then begin
;
;  NEWSIPS flagged data - bits other than bit 6 that are set
;
    inx1 = where( (eps lt 0) and ( (abs(eps) and 32) eq 0 ),count1)
;
;  flagged interpolated or user flagged data - bit 6 that are set
;
    inx2 = where( (abs(eps) and 32) ne 0,count2)
 endif else begin
;
;  IUESIPS flagged data
;
    inx1 = where( (eps lt 0) and (eps ne -325) and (eps ne -210),count1)
    inx2 = where(eps eq -210,count2)      ; flagged interpolated data
    inx3 = where(eps eq -325,count3)      ; user flagged data
 endelse  ; newsips
;
;  overplot sips flagged data
;
 if (count1 gt 0) then if (inx1(0) ne -1) then begin
    ind = intarr(n_elements(inx1)+1)
    ind(0) = inx1
    ind(1) = inx1  ; at least 2 pts.
    oplot,wave(inx1),flux(inx1),psym=7
 endif  ; sips
;
;  overplot flagged interpolated data (and NEWSIPS user flagged data)
;
 if (count2 gt 0) then if (inx2(0) ne -1) then begin
    ind = intarr(n_elements(inx2)+1)
    ind(0) = inx2
    ind(1) = inx2  ; at least 2 pts.
    oplot,wave(ind),flux(ind),psym=2
 endif  ; interpolated
;
;  overplot user flagged data - IUESIPS
;
 if (not(newsips)) then begin
    if (count3 gt 0) then if (inx3(0) ne -1) then begin
       ind = intarr(n_elements(inx3)+1)
       ind(0) = inx3
       ind(1) = inx3  ; at least 2 pts.
       oplot,wave(ind),flux(ind),psym=1
    endif  ; user
 endif  ; not(newsips)
;
 return
 end  ; bs_plotflag