	FUNCTION YOList, idx, strFilter, header, conv=conv
;	--------------------------------------------------------------------
;+							16-Jan-92
;	NAME:
;		yolist
;	Purpose:
;		Convert requested fields of a data-vector to String-type 
;		for list directed output.
;       CALLING SEQUENCE:
;		ret = yolist(idx, strFilter, header, [/conv])
;	INPUT PARAMETERS:
;		idx		Structured Data-vector 
;		strFilter	The Names of fields of the data-
;				vector the user wishes
;				to convert to String-type. Example:
;				strFilter = ['day','time','periph']
;		conv		flag, when set code returns converted values
;				(e.g. effective exposure instead of mail-
;				box value).
;	RETURNED:
;		strIdx          a list of formatted strings containning the
;				items in 'strFilter'.
;	OPTIONAL:
;		header		a string header for the listing.
;	History:
;		written Mar '91 by GAL
;		updated 27-Mar-91
;		updated 1-Apr-91 for input list > 128 in length.
;	     	updated 12-June-91 for minor problem with IDX index
;			when "nrem" was 0.
;		updated 17-June - reform statement removed; SLF 
;		updated 1-Aug-91 extended the number of list parameters and
;			added header parameters to all list parameters.
;		updated 6-Aug-91 - added ObsRegion parameter
;		updated 12-Aug-91 - PFI_FWI changed to PFI_FFI and many
;			low-level routines updated to use keywords.
;		updated 16-Sep-91 - change FWI to FFI in SXT Structure fields
;		updated 25-Sep-91 - added conversion parameter (conv) to 
;			formal parameter list.
;		some changes 16-Jan-92
;-
;	--------------------------------------------------------------------

	IF ( N_PARAMS() eq 0 ) THEN BEGIN	;display documentation
	  yodoc
	  return, 1
	ENDIF	
	noReqTags = SIZE(strFilter)
	noReqTags = noReqTags(noReqTags(0))	;1st (and only) dimension
	capStrFil = STRUPCASE(strFilter)	;all field names are upper C.
        alist = INTARR(noReqTags)		
        idxNames = Tag_Names(idx)
        conv = KEYWORD_SET(conv)		;change conv to boolean flag
	
;	number of elements in input index-data IDX:
	nele = SIZE(idx)
	nele = nele(nele(0))			;assume IDX is 1-dimensional
	IF (nele gt 128) THEN BEGIN
	  nrep = nele/128
	  nrem = (nele MOD 128)
	  IF (nrem gt 0) THEN nrep = nrep + 1	;last loop for remainder
	ENDIF ELSE BEGIN
	  nrep = 1				;must do at least once
	  nrem = nele				;number of elements
	ENDELSE

;	IF strFilter list contains 'time' or 'day' Int2ex converts times 
;	into an external format:

	FOR i = 0, nrep-1 DO BEGIN	;n loops of 128 plus remainder
	  low = i * 128
	  hig = ((i+1) * 128)-1
	  IF (nrem ne 0) THEN BEGIN
	    IF (i eq nrep-1) THEN hig = i * 128 + nrem -1
	  ENDIF
	  time = fndfld(idx(low:hig), 'time')
	  day  = fndfld(idx(low:hig), 'day')
  	  INT2Ex, time, day, timBuf
	
	  FOR j = 0, noReqTags-1 DO BEGIN	;do for all requested fields
	
	    CASE capStrFil(j) OF		;What field is requested?
	     'TIME':   GetStrTim, timBuf, str, len, h=h
	     'DAY':    GetStrDat, timBuf, str, len, h=h 

	     'PERIPH' : BEGIN
			  periph = fndfld(idx(low:hig), 'periph')
			  GetStrperiph, periph,  str, len, h=h
			END
	     'FILTA':	str = GT_filta(idx(low:hig), h=h, /string)
	     'FILTB':	str = GT_filtb(idx(low:hig), h=h, /string)

	     'EXPLEVMODE': BEGIN
				explevmode = fndfld(idx(low:hig), 'explevmode')
				periph = fndfld(idx(low:hig), 'periph')
			  	GetStrExpLev, expLevMode, $
					periph, str, len, conv=conv, h=h
			   END
	     'EXPM':	str = GT_EXPMODE(idx(low:hig), h=h, /string)
	     'MBE':	str = GT_mbe(idx(low:hig), h=h, /string)
	     'DPE':	str = GT_dpe(idx(low:hig), h=h, /string)

	     'IMGPARAM':   BEGIN
				imgparam = fndfld(idx(low:hig), 'imgparam')
				GetStrImgPar, imgparam, str, len, h=h
			   END
;	     'EXPM':	str = GT_expMODE(idx(low:hig), h=h, /string)
	     'RES':	str = GT_res(idx(low:hig), h=h, /string)	     	     

	     'SHAPE_CMD':  BEGIN
				shape_cmd = fndfld(idx(low:hig), 'shape_cmd')
				GetStrShpCmd, shape_cmd, str, len, h=h
			   END
	     'SHAPE':		str = GT_shape_cmd(idx(low:hig), h=h, /string)

	     'FOV_CENTER': BEGIN
				fov_center = fndfld(idx(low:hig), 'fov_center')
				GetStrFOVCen, FOV_center, str, len, h=h
			   END
	     'FOV':		str = GT_FOV_center(idx(low:hig), h=h, /string)

;	     'PFI_FFI':GetStrPFIFFI, idx(low:hig).pfi_ffi, str, len, h=h
	     'Image':	srt = gt_pfi_ffi(idx(low:hig), h=h, /string)

	     'OBSREGION':GetStrObsReg, idx(low:hig).ObsRegion, str, len, h=h
	     'DP_MODE':GetStrDPmode, idx(low:hig).DP_mode, str, len, h=h

	     ELSE:	BEGIN
			  PRINT, 'Requested Information Not found for: ', $
				capstrfil(j)
			  h = '***'
			  str = string(replicate(32b,3))
			  str = replicate(str,hig-low)	;yes a bunch of blanks
			END
	    ENDCASE                                                      
	    IF (j eq 0) THEN BEGIN
	      strI = str
	      h1   = h          	;save 1st header
	    ENDIF ELSE BEGIN	
	      strI = strI + '  ' + str
	      h1 = h1 + '  ' + h	;build header
	    ENDELSE

	  ENDFOR			;end filter list

	  IF (i eq 0) THEN BEGIN
	    strIdx = strI
	  ENDIF ELSE BEGIN
	    strIdx = [strIdx,strI]
	  ENDELSE
	
	ENDFOR			;end repeats of 128 
 
	header = h1 
	  
	RETURN, strIdx
	END
