;+ ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ; lct2lut.pro IDL procedure ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ; Convert Pre-defined IDL tables to ASCII table format. ; ; Andrew L. Stanger HAO/NCAR 6 May 1996 ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ; ; SYNTAX ; lct2lut ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ; - common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr PRO lct2lut DEVICE, PSEUDO_COLOR = 8 WINDOW, XSIZE = 256, YSIZE = 32, COLORS = 256 r_orig = bytarr (256) g_orig = bytarr (256) b_orig = bytarr (256) lbuf = bindgen (256) ibuf = bytarr (256, 32) ibuf (0:255,*) = ibuf for j = 0, 31 do $ for i = 0, 255 do $ ibuf (i,j) = i tv, ibuf lctnames = '' LOADCT, GET_NAMES = lctnames, FILE = lctfile ;Get table names slct = size (lctnames) print, 'size (lctnames): ', size (lctnames) nfiles = slct (1) FOR i = 0, nfiles - 1 DO $ BEGIN lutname = lctnames (i) + '.lut' lutbyte = byte (lutname) nlut = strlen (lutname) FOR j = 0, nlut - 1 DO $ BEGIN if (lutbyte (j) EQ 32) THEN lutbyte (j) = 95 ; space to underscore if (lutbyte (j) EQ 47) THEN lutbyte (j) = 45 ; / to - END lutname = string (lutbyte) LOADCT, i TVLCT, r_orig, g_orig, b_orig, /GET openw, 1, lutname FOR j = 0, 255 DO $ printf, 1, j, r_orig (j), g_orig (j), b_orig (j), $ FORMAT = '(I3,1X,I3,1X,I3,1X,i3)' close, 1 END END