function gt_seq_tab, item, header=header, string=string, short=short, spaces=spaces ; ;+ ;NAME: ; gt_seq_tab ;PURPOSE: ; To extract the bits corresponding to DP Mode and optionally ; return a string mnemonic. ;CALLING SEQUENCE: ; x = gt_seq_tab(index) ; x = gt_seq_tab(roadmap) ; x = gt_seq_tab(index.gen, /string) ; x = gt_seq_tab(seq_tab, /short) ; x = gt_seq_tab(indgen(6)+1) ;used with menu selection ; x = gt_seq_tab(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. ;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 table 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 ; 10-Aug-2008 (Aki Takeda) Modified to accept FITS header ;- ; header_array = 'STab' fmt = '(i4)' ; siz = size(item) typ = siz( siz(0)+1 ) if (typ eq 8) then begin case 1 of (tag_exist(item,'GEN',/top)): out = item.sxt.seq_tab_serno ; index (tag_exist(item,'SIMPLE',/top)): out = item.seq_tab_ ; FITS else : out = item.seq_tab_serno ; readmap endcase end else begin out = item end ; out = gt_conv2str(out, conv2str, conv2short, header_array, header=header, $ string=string, short=short, spaces=spaces, fmt=fmt) ; return, out end