;+ ; ; NAME mouse_wedge ; ; FUNCTION Determine pixel coordinates of wedge vertices ; using the mouse. ; ; HISTORY Andrew L. Stanger HAO/NCAR 5 February 1999 ; 18 Feb 1999: Write min/max radii & angles to log file. ;- PRO mouse_wedge, xdim, ydim, xcen, ycen, pixrs, roll, $ aoinum, logfile, pvfile, xv, yv, nver, polypix rxmin = xcen rxmax = xdim - 1 axmin = xcen axmax = xdim - 1 rymin = ycen rymax = ydim - 1 aymin = ycen aymax = ydim - 1 angle = 0.0 radius = 0.0 TVCRS, xcen, ycen ; Enable cursor PRINT, 'Using the mouse to define a wedge-shaped area.' PRINT, 'Position mouse at minimum radius & click left button : ' CURSOR, rxmin, rymin, /DEVICE, WAIT=3 PRINT, 'rxmin, rymin: ', rxmin, rymin WAIT, 0.5 PRINT, 'Position mouse at maximum radius & click left button : ' CURSOR, rxmax, rymax, /DEVICE, WAIT=3 PRINT, 'rxmax, rymax: ', rxmax, rymax WAIT, 0.5 PRINT, 'Position mouse at minimum angle & click left button : ' CURSOR, axmin, aymin, /DEVICE, WAIT=3 PRINT, 'axmin, aymin: ', rxmin, rymin WAIT, 0.5 PRINT, 'Position mouse at maximum angle & click left button : ' CURSOR, axmax, aymax, /DEVICE, WAIT=3 PRINT, 'axmax, aymax: ', rxmax, rymax WAIT, 0.5 ierr=rcoord (rmin, angle, rxmin, rymin, -1, roll, xcen, ycen, pixrs) ierr=rcoord (rmax, angle , rxmax, rymax, -1, roll, xcen, ycen, pixrs) ierr=rcoord (radius, angmin, axmin, aymin, -1, roll, xcen, ycen, pixrs) ierr=rcoord (radius, angmax, axmax, aymax, -1, roll, xcen, ycen, pixrs) 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, 'Mouse-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 ;--- Write info to screen. PRINT, STRING (rmin, FORMAT='(F7.2)'), ' --> ', $ STRING (rmax, FORMAT='(F7.2)'), ' Rsun ', $ STRING (angmin, FORMAT='(F7.2)'), ' --> ', $ STRING (angmax, FORMAT='(F7.2)'), ' degrees' xv = [xll, xul, xur, xlr, xll] yv = [yll, yul, yur, ylr, yll] nver = 5 ;--- Stores polygon 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