function gt_serialnum, item, header=header, string=string, spaces=spaces ; ;+ ;NAME: ; gt_serialnum ;PURPOSE: ; To extract the serial number of SXT images. ; ;CALLING SEQUENCE: ; p = gt_serialnum(index) ; p = gt_serialnum(roadmap, /str) ;INPUT: ; item - The input must be a structure. The structure can ; be the index, or roadmap, or observing log. ;OPTIONAL INPUT: ; string - If present, return the string format ; spaces - If present, place that many spaces before the output ; string. ;OUTPUT: ; returns - Serial number of the SXT images. ;OPTIONAL OUTPUT: ; header - A string that describes the item that was selected ; to be used in listing headers. ;HISTORY: ; Written 27-Jul-2010 (Aki Takeda) gt_percentover was modified ; to return the serial number. ;- ; header_array = ['%Img', '???'] ; siz = size(item) typ = siz( siz(0)+1 ) if (typ eq 8) then begin ; tags = tag_names(item) case 1 of (tag_exist(item,'GEN',/top)) : out = item.sxt.serial_num (tag_exist(item,'SIMPLE',/top)) : out = item.serial_n else : out = item.serial_num endcase end else begin print, 'GT_SERIALNUM: Input must be a structure' out = 0 end ; fmt = '(i7)' out = gt_conv2str(out, conv2str, conv2short, header_array, header=header, $ string=string, short=short, spaces=spaces, fmt=fmt) ; if (n_elements(out) eq 1) then out = out(0) ;turn it into a scalar return, out end