;+ ; NAME fvcp.pro ; ; PURPOSE Display an SMM C/P FITS image. ; ; SYNTAX fvcp, fits_image, /gif, cm='colormap.lut' ; ; fits_image filename of SMM C/P FITS image. ; gif write displayed image as a GIF file. ; cm pathname of 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 fvcp, '19981101.1234.mk3.cpb.fts' ; fvcp, '19981101.1234.mk3.rpb.fts',cm='/home/stanger/color/bwy.lut' ; fvcp, '19981101.1234.mk3.rpb.fts', /gif ; ; EXTERNAL ; PROCEDURES fv_annotate.pro ; ; HISTORY Andrew L. Stanger HAO/NCAR 14 September 2001 ; 28 Dec 2005: Updated for SMM C/P. ;- PRO fvcp, fits_name, gif=gif, cm=cm, wmin=wmin, wmax=wmax ; --- Load color map. IF (KEYWORD_SET (cm)) THEN $ lct, cm $ ELSE $ lct, '/home/stanger/color/quallab.lut' ; Load default color table. red = BYTARR (256) green = BYTARR (256) blue = BYTARR (256) TVLCT, red, green, blue, /GET ; Fetch RGB color look-up tables. ; --- Define annotation borders: left & bottom. ;xb = 160 ;yb = 88 xb = 152 ; Left border width yb = 64 ; Bottom border height xdim_prev = 0 ydim_prev = 0 dispmin = 0.0 dispmax = 0.0 ; --- Extract "base name" for optional output file. ftspos = STRPOS (fits_name, '.fts') basename = STRMID (fits_name, 0, ftspos) print, 'basename: ', basename ;--- Read FITS image header & pixel data. img = readfits (fits_name, hdu) ; --- Read housekeeping extension. hk = readfits (fits_name, hdu_hk, exten_no=1) ;--- Extract information from header. xdim = fxpar (hdu, 'NAXIS1') ydim = fxpar (hdu, 'NAXIS2') ;--- Resize window [if image size has changed]. if (xdim NE xdim_prev OR ydim NE ydim_prev) THEN $ WINDOW, xsize=xdim+xb, ys=ydim+yb, RETAIN=2 print, 'xdim + xb: ', xdim + xb print, 'ydim + yb: ', ydim + yb xdim_prev = xdim ydim_prev = ydim ;--- Get information from FITS header. orbit_id = fxpar (hdu, 'ORBIT-ID') image_id = fxpar (hdu, 'IMAGE-ID') telescop = fxpar (hdu, 'TELESCOP') instrume = fxpar (hdu, 'INSTRUME') dateobs = fxpar (hdu, 'DATE-OBS') timeobs = fxpar (hdu, 'TIME-OBS') type_obs = fxpar (hdu, 'TYPE-OBS') dataform = fxpar (hdu, 'DATAFORM') rsun = fxpar (hdu, 'RSUN') srsun = STRING (rsun, FORMAT='(F7.2)') solar_p0 = fxpar (hdu, 'SOLAR_P0') solar_b0 = fxpar (hdu, 'SOLAR_B0') bunit = fxpar (hdu, 'BUNIT') bscale = fxpar (hdu, 'BSCALE') bzero = fxpar (hdu, 'BZERO') datamin = fxpar (hdu, 'DATAMIN') datamax = fxpar (hdu, 'DATAMAX') dispmin = fxpar (hdu, 'DISPMIN', count=countmin) dispmax = fxpar (hdu, 'DISPMAX', count=countmax) print, 'rsun: ', rsun print, 'solar_p0: ', solar_p0 print, 'solar_b0: ', solar_b0 print, 'bscale/bzero: ', bscale, bzero print, 'datamin/datamax: ', datamin, datamax print, 'dispmin/dispmax: ', dispmin, dispmax imin = MIN (img, max=imax) print, 'imin/imax: ', imin, imax ;--- "Erase" left annotation area. winleft = BYTARR (xb, ydim) winleft [*, *] = 255 TV, winleft, 0, yb ;--- "Erase" bottom annotation area. winbottom = BYTARR (xb + xdim, yb) winbottom [*, *] = 255 TV, winbottom, 0, 0 ;--- Determine min/max intensity levels to display. dmin = dispmin dmax = dispmax IF (KEYWORD_SET (wmin)) THEN dmin = wmin IF (KEYWORD_SET (wmax)) THEN dmax = wmax print, 'dmin/dmax: ', dmin, dmax ;--- Display image. TV, BYTSCL (img, min=dispmin, max=dispmax, top=249), xb, yb ;--- Annotate image. fv_annotate_cp, hdu, hdu_hk, xdim, ydim, xb, yb ;--- Write displayed image as a GIF file (if "gif" keyword is set). IF (KEYWORD_SET (gif)) THEN $ BEGIN gif_file = basename + '.gif' img_gif = TVRD () WRITE_GIF, gif_file, img_gif, red, green, blue END END