function gt_or_expnum, item, header=header, string=string, short=short, spaces=spaces
;
;+
;NAME:
;	gt_or_expnum
;PURPOSE:
;	To extract the word corresponding to the observing region (OR) exposure
;	number and optionally return a string variable for that item.
;CALLING SEQUENCE:
;	x = gt_or_expnum(roadmap)
;	x = gt_or_expnum(index)
;	x = gt_or_expnum(index.sxt, /space)	;put single space before string
;	x = gt_or_expnum(index, space=3)	;put 3 spaces
;METHOD:
;	The input can be a structure or a scalar.  The structure can
;	be the index, or roadmap, or observing log.
;	NOTE: For FFI this is the ROI number if the exposure was a multiple ROI
;	exposure.
;INPUT:
;	item	- A structure or scalar.  It can be an array.  
;OPTIONAL INPUT:
;	string	- If present, return the string mnemonic (long notation)
;	short	- If present, return the short string mnemonic 
;	spaces	- If present, place that many spaces before the output
;		  string.
;OUTPUT:
;	returns	- The OR exposure number, a integer value or a string
;		  value depending on the switches used.  It is a vector
;		  if the input is a vector
;OPTIONAL OUTPUT:
;       header  - A string that describes the item that was selected
;                 to be used in listing headers.
;HISTORY:
;	Written 13-Nov-91 by M.Morrison
;	14-Jul-93 (MDM) - Added code to handle cases where FFI images are
;			  passed in.
;-
;
header_array = 'E#'
header_array = [header_array, header_array]	;no short option at this time
fmt = "(i2)"			;8 characters
;
siz = size(item)
typ = siz( siz(0)+1 )
if (typ eq 8) then begin
    ;Check to see if an index was passed (which has the tag nested)
    ;or a roadmap or observing log entry was passed
    tags = tag_names(item)
    if (tags(0) eq 'GEN') then out = item.sxt.pfi_ffi $
			else out = item.pfi_ffi
end else begin
    out = item
end
;
;---- If the item passed is byte type, then assume that it is a
;     raw telemetered value and the item's bits need to be extracted
siz = size(out)
typ = siz( siz(0)+1 )
if (typ eq 1) then out = mask(out, 4, 4)        ;if it is byte type - then mask
;
ffi = where((gt_pfi_ffi(item) MOD 2) EQ 1)	;MDM added 14-Jul-93
if (ffi(0) GE 0) then out(ffi) = 1

out = gt_conv2str(out, conv2str, conv2short, header_array, header=header, $
	string=string, short=short, spaces=spaces, fmt=fmt)
;
return, out
end
