function gt_temp_ccd, item, header=header, string=string, short=short, spaces=spaces
;
;+
;Name
;	gt_temp_ccd
;Purpose:
;	To convert the SXT CCD temperature to
;	degrees C.
;Input:
;	item	- Index structure or just the mail box byte value
;		  The roadmap is not acceptible as input
;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 CCD temperature, a floating point 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.
;Example:
;	t = gt_temp_ccd( index )
;	t = gt_temp_ccd( index.sxt.temp_ccd )
;	t = gt_temp_ccd( 200 )
;History:
;	Written 10-Oct-91 by M.Morrison
;	12-Nov-91 MDM - Modified for more flexible input
;-
;
header_array = 'CCD T '
fmt = '(f6.2)'
;
;Conversion parameters taken from: MicroVAX file "calc2_temp_fm1.tab"
;
;----------------------------------------
;FLIGHT Camera Temperature Conversion
;Post Jan-91 camera rework
;Program: CALC_FEB91.PRO  Ver 1.0  4-Feb-91
;Program Run:  4-FEB-1991 16:44:50.61
;
;Conversion from 8-bit SXTE-U (inverted) DN to Resistance (kOhm)
;
dn2resist = [  36.555, -0.14268]
;
;Conversion from Resistance (kOhm) to Temperature (C)
order = 10
resist2temp = [ 60.500, -21.857, 3.5709, -0.35864, 2.23152E-02, $
	 -8.86856E-04, 2.28632E-05, -3.80006E-07, 3.92392E-09, $
	 -2.28741E-11, 5.74783E-14]
;----------------------------------------
;

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 "periph" tag
    ;nested under "sxt", or a roadmap or observing log entry was
    ;passed
    tags = tag_names(item)
    if (tags(0) eq 'GEN') then out = item.sxt.temp_ccd $
                        else out = item.temp_ccd
end else begin
    out = item
end
;
out = poly(out, dn2resist)  ;convert dn to resistance
out = poly(out, resist2temp)    ;convert resistance to temperat
;
out = gt_conv2str(out, conv2str, conv2short, header_array, header=header, $
        string=string, short=short, spaces=spaces, fmt=fmt)
;
return, out
end
