;+ ; suncirc.pro ; ; PURPOSE Draw a 1.0 Rsun circle on an image. ; ; SYNTAX suncirc, fits_image_file ; ; AUTHOR Andrew L. Stanger HAO/NCAR 30 Oct 2000 ; 23 Jan 2001: set xcen/ycen to array center if < 0. ; 12 Apr 2001: Use dispmin & dispmax for intensity scaling. ; 12 Apr 2001: Draw circle centered at array center. ;- PRO suncirc, fits_file lct, '/home/stanger/color/chip1.lut' xcen = -1 ycen = -1 dispmin = 0 dispmax = 0 img = readfits (fits_file, hdu) telescop = fxpar (hdu, 'TELESCOP') xdim = fxpar (hdu, 'NAXIS1') ydim = fxpar (hdu, 'NAXIS2') xcen = fxpar (hdu, 'CRPIX1', count=xcencnt) ycen = fxpar (hdu, 'CRPIX2', count=ycencnt) pixrs = fxpar (hdu, 'CRRADIUS', count=pixrscnt) roll = fxpar (hdu, 'CROTA1') dispmin = fxpar (hdu, 'DISPMIN') dispmax = fxpar (hdu, 'DISPMAX') telescop = STRUPCASE (STRTRIM (telescop, 2)) if (telescop EQ 'PSPT') then $ begin xcen = fxpar (hdu, 'CENTER_X', count=xcencnt) ycen = fxpar (hdu, 'CENTER_Y', count=ycencnt) xrad = fxpar (hdu, 'XRADIUS', count=pixrscnt) yrad = fxpar (hdu, 'YRADIUS', count=pixrscnt) pixrs = (xrad + yrad) / 2.0 ; Average. end if (xcencnt NE 1) then xcen = -1.0 if (ycencnt NE 1) then ycen = -1.0 if (pixrscnt NE 1) then pixrs = -1.0 print, 'xcen/ycen: ', xcen, ycen print, 'dispmin/dispmax: ', dispmin, dispmax imin = min (img, max=imax) print, 'imin/imax: ', imin, imax if (dispmin EQ dispmax) then $ begin tmin = imin tmax = imax end $ else $ begin tmin = dispmin tmax = dispmax end print, 'tmin/tmax: ', tmin, tmax xc = (xdim - 1) * 0.5 yc = (ydim - 1) * 0.5 IF (xcen LT 0.0) THEN xcen = (xdim - 1) / 2.0 IF (ycen LT 0.0) THEN ycen = (ydim - 1) / 2.0 print, 'xcen/ycen: ', xcen, ycen sizimg = size (img) WHILE (sizimg [1] GT 1000 OR sizimg [2] GT 1000) DO $ BEGIN img = rebin (img, xdim/2, ydim/2) xdim = xdim / 2 ydim = ydim / 2 xcen = xcen / 2.0 ycen = ycen / 2.0 xc = xc * 0.5 yc = yc * 0.5 pixrs = pixrs / 2.0 sizimg = size (img) END print, 'xc/yc: ', xc, yc, ' pixrs: ', pixrs window, xsize=xdim, ysize=ydim tv, bytscl (img, min=tmin, max=tmax, top=249) radius = 1.0 FOR it = 0, 361, 1 DO $ BEGIN theta = FLOAT (it) ierr = rcoord (radius, theta, x, y, 1, roll, xc, yc, pixrs) ix = FIX (x + 0.5) iy = FIX (y + 0.5) IF (it EQ 0) THEN plots, ix, iy, /device, color=251 $ ELSE plots, ix, iy, /device, color=251, /continue END ;FOR it = 0, 361, 1 DO $ ; BEGIN ; theta = FLOAT (it) ; ierr = rcoord (radius, theta, x, y, 1, roll, xcen, ycen, pixrs) ; ix = FIX (x + 0.5) ; iy = FIX (y + 0.5) ; IF (it EQ 0) THEN plots, ix, iy, /device, color=253 $ ; ELSE plots, ix, iy, /device, color=253, /continue ; END END