;+ ; NAME fvs.pro ; ; PURPOSE Display FITS images. ; ; SYNTAX fvs, 'list', cm='color.lut', /gif ; ; list file containing a list of FITS images. ; gif write out the displayed image as a GIF file. ; cm pathname of an ASCII colormap file. ; Each line has the syntax: index red green blue ; where index = 0, 1, 2, ... 255, ; and red/green/blue are in the range [0:255]. ; wmin display minimum value. ; wmax display maximum value. ; ; ; EXAMPLES fvs, 'list' ; fvs, 'list', /gif ; fvs, 'list', cm='/home/stanger/color/bwcp' ; fvs, 'list', wmin=0.0, wmax=5.e-7 ; ; EXTERNAL ; PROCEDURES fitsdisp.pro ; fits_annotate.pro ; ; HISTORY Andrew L. Stanger HAO/NCAR 14 September 2001 ;- PRO fvs, fits_list, gif=gif, cm=cm, wmin=wmin, wmax=wmax ;{ ;--- Load color map. ;loadct, 3 ; standard RSI color table #3. ;lct, '/home/stanger/color/sunsetcp.lut' ; Load color table. lct, '/home/stanger/color/bwy.lut' ; Load default color map. IF (KEYWORD_SET (cm)) THEN $ lct, cm red = bytarr (256) green = bytarr (256) blue = bytarr (256) tvlct, red, green, blue, /GET ; Fetch RGB color look-up tables. PRINT, 'Position the cursor in the image window.' PRINT, 'Pressing the LEFT mouse button displays the NEXT image.' PRINT, 'Pressing the RIGHT mouse button displays the PREVIOUS image. PRINT, 'Pressing the MIDDLE mouse button terminates the program.' CLOSE, 11 fits_name = '' xb = 160 yb = 88 xdim_prev = 0 ydim_prev = 0 index = 0 floc = LONG (0) fpos = LONARR (1200) DEVICE, window_state = wstat IF (wstat [0] EQ 0) THEN window, xs=xb+320*2, ys=yb+256*2 ;--- Count the number to images files. OPENR, 11, fits_list WHILE (NOT EOF (11)) DO $ BEGIN ;{ READF, 11, fits_name index = index + 1 ENDWHILE ;} nimg = index CLOSE, 11 ;--- Image list loop. index = 0 OPENR, 11, fits_list WHILE (NOT EOF (11)) DO $ BEGIN ;{ POINT_LUN, -11, floc fpos [index] = floc ;--- Read FITS image header & pixel data. READF, 11, fits_name ; Get file name. PRINT, 'fits_name: ', fits_name ;--- Display FITS image in IDL window. fitsdisp, fits_name, xdim_prev, ydim_prev, gif=gif, wmin=wmin, wmax=wmax ;--- Use mouse button to control image list flow ;--- Left mouse button = forward. ;--- Middle mouse button = quit. ;--- Right mouse button = backwards. CURSOR, wx, wy IF (!ERR EQ 4) THEN $ BEGIN ;{ index = index - 1 IF (index LT 0) THEN index = 0 POINT_LUN, 11, fpos [index] ENDIF ELSE BEGIN index = index + 1 IF (index GE nimg) THEN index = 0 ENDELSE IF (!ERR EQ 2) THEN GOTO, FINISH ENDWHILE ;} FINISH: CLOSE, 11 END ;}