;+ ; NAME fitsdispcp.pro ; ; PURPOSE Display a FITS image. ; ; SYNTAX fitsdispcp, img, hdu ; ; EXAMPLE fitsdispcp, img, hdu ; fitsdispcp, img, hdu, /gif ; ; EXTERNAL ; PROCEDURES fits_annotate_cp.pro ; ; HISTORY Andrew L. Stanger HAO/NCAR 14 September 2001 ;- PRO fitsdispcp, fits_name, xdim_prev, ydim_prev, xb, yb, $ wmin=wmin, wmax=wmax print, '*** fitsdispcp ***' ; xb = 160 ; X-axis border for annotation. ; yb = 88 ; Y-axis border for annotation. ftspos = STRPOS (fits_name, '.fts') basename = STRMID (fits_name, 0, ftspos) ; print, 'basename: ', basename img = readfits (fits_name, hdu) ;--- Extract image size from FITS header. xdim = fxpar (hdu, 'NAXIS1') ydim = fxpar (hdu, 'NAXIS2') ;--- "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 ;--- Resize window if it has changed. if (xdim NE xdim_prev OR ydim NE ydim_prev) THEN $ WINDOW, xsize=xdim+xb, ys=ydim+yb ; print, 'xdim + xb: ', xdim + xb ; print, 'ydim + yb: ', ydim + yb xdim_prev = xdim ydim_prev = ydim ;--- Extract 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)') bunit = fxpar (hdu, 'BUNIT') datamin = fxpar (hdu, 'DATAMIN') datamax = fxpar (hdu, 'DATAMAX') dispmin = fxpar (hdu, 'DISPMIN') dispmax = fxpar (hdu, 'DISPMAX') telescop = STRTRIM (telescop, 2) ; IF (telescop NE 'SPARTAN 201' AND instrume NE 'WLC') THEN $ ; BEGIN ; PRINT, 'TELESCOP: ', telescop, ' should be "SPARTAN 201".' ; PRINT, 'INSTRUME: ', instrume, ' should be "WLC".' ; RETURN ; END ;--- Display image. dmin = dispmin dmax = dispmax ; IF (KEYWORD_SET (wmin) OR wmin EQ 0.0) THEN dmin = wmin IF (KEYWORD_SET (wmin)) THEN dmin = wmin IF (KEYWORD_SET (wmax)) THEN dmax = wmax TV, BYTSCL (img, min=dmin, max=dmax, top=249), xb, yb ;--- Draw box around image. ; wvec, xb, yb, xdim+xb-1, yb, 251 ; wvec, xdim+xb-1, yb, xdim+xb-1, ydim+yb-1, 251 ; wvec, xdim+xb-1, ydim+yb-1, xb, ydim+yb-1, 251 ; wvec, xb, ydim+yb-1, xb, yb, 251 ; wvec, 0, yb, xb, yb, 251 ;--- Annotate image. fits_annotate_cp, hdu, xdim, ydim, xb, yb, wmin=wmin, wmax=wmax RETURN END