function gt_seq_num, item, header=header, string=string, short=short, spaces=spaces
;
;+
;NAME:
;	gt_seq_num
;PURPOSE:
;	To extract the bits corresponding to DP Mode and optionally
;	return a string mnemonic.
;CALLING SEQUENCE:
;	print, gt_seq_num()			;to list the nemonics
;	x = gt_seq_num(index)
;	x = gt_seq_num(roadmap)
;	x = gt_seq_num(index.gen, /string)
;	x = gt_seq_num(seq_num, /short)
;	x = gt_seq_num(indgen(6)+1)		;used with menu selection
;	x = gt_seq_num(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.  If the input
;	is non-byte type, it assumes that the bit extraction had
;	already occurred and the "mask" is not performed on the input.
;INPUT:
;	item	- A structure or scalar.  It can be an array.  If this
;		  value is not present, a help summary is printed on the
;		  names used.
;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 sequence number selected, 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
;-
;
header_array = 'Seq'
conv2str = ['???', '1-1', '2-1', '2-2', '3-1', '3-2', '3-3', '3-4', $
                        '4-1', '4-2', '5-1', '5-2', '5-3', '5-4']
conv2short = conv2str	;no short notation right now
;
if (n_params(0) eq 0) then begin
    print, 'String Output for GET_SEQ_NUM'
    for i=1,13 do print, i, '   ', conv2str(i), '   ', conv2short(i)
    return, ''
end
;
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.seq_num $
			else out = item.seq_num
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 )
out = out>0<13	;check the range
;
out = gt_conv2str(out, conv2str, conv2short, header_array, header=header, $
	string=string, short=short, spaces=spaces)
;
return, out
end
