;+ ; ; NAME kb_wedge ; ; FUNCTION Determine pixel coordinates of wedge vertices ; using the keyboard. ; ; HISTORY Andrew L. Stanger HAO/NCAR 5 February 1999 ; 18 Feb 1999: Write min/max radii & angles to log file. ;- PRO kb_wedge, xdim, ydim, xcen, ycen, pixrs, roll, $ aoinum, logfile, pvfile, xv, yv, nver, polypix print, 'Using the keyboard to define a wedge-shaped area.' print, 'Enter the minimum & maximum radii : ' read, rmin, rmax print, 'Enter the minimum & maximum angles : ' read, angmin, angmax ierr = rcoord (rmin, angmin, xll, yll, 1, roll, xcen, ycen, pixrs) ierr = rcoord (rmax, angmin, xul, yul, 1, roll, xcen, ycen, pixrs) ierr = rcoord (rmin, angmax, xlr, ylr, 1, roll, xcen, ycen, pixrs) ierr = rcoord (rmax, angmax, xur, yur, 1, roll, xcen, ycen, pixrs) ;--- Write Region information into log file. OPENW, lulog, logfile, /GET_LUN PRINTF, lulog, 'Keyboard-Defined Straight Wedge Region: ', $ STRING (aoinum, FORMAT='(i3)') PRINTF, lulog, STRING (rmin, FORMAT='(F7.2)'), ' --> ', $ STRING (rmax, FORMAT='(F7.2)'), ' Rsun ', $ STRING (angmin, FORMAT='(F7.2)'), ' --> ', $ STRING (angmax, FORMAT='(F7.2)'), ' degrees' PRINTF, lulog, 'polygon vertices file: ', pvfile CLOSE, lulog FREE_LUN, lulog xv = [xll, xul, xur, xlr, xll] yv = [yll, yul, yur, ylr, yll] nver = 5 ;--- Store vertices into a disk file. store_poly, pvfile, xv, yv, nver ;--- Determine coordinates of all pixel within polygon area. polypix = POLYFILLV (xv, yv, xdim, ydim) ;--- pixels in polygon. ;--- Draw polygon perimeter. PLOTS, xv, yv, color=253, /DEVICE PLOTS, xv [0], yv [0], color=253, /DEVICE, /CONTINUE END