;+ ; NAME cm_tc.pro ; ; PURPOSE Convert a color-map image to truecolor format. ; ; SYNTAX imgtc = index_truecolor (imgcm) ; ; HISTORY Andrew L. Stanger HAO/NCAR 30 January 2003 ;- FUNCTION cm_tc, imgcm, red, green, blue, disp=disp ;--- Read FITS image header & pixel data. imgsz = SIZE (imgcm) xdim = imgsz [1] ydim = imgsz [2] ;--- Convert to byte pixels. ;--- Display image. IF (KEYWORD_SET (disp)) THEN $ BEGIN ;{ TVLCT, red, green, blue WINDOW, xsize=xdim, ysize=ydim TV, imgcm ; Display image. END ;} imgtc = BYTARR (xdim, ydim, 3) imgtc [*, *, 0] = red [imgcm [*, *]] imgtc [*, *, 1] = green [imgcm [*, *]] imgtc [*, *, 2] = blue [imgcm [*, *]] return, imgtc END