FUNCTION POINT_SELECT,P,Q,winP,winQ ;+ ;R=POINT_SELECT(P,Q) uses the mouse cursor to alternately select values ;from arrays P and Q that have been displayed in windows winP and winQ. ;Left click in the image to collect and print the coordinates of a point. ;Right-click to end the procedure. It is assumed that the windows are ;sized to fit the image arrays. ; ;Returned value R is a structure with six keys: Pv,Px,Py,Qv,Qx,Qy where ;Pv and Qv are the sample values at the selected coordinates and Px,Py,Qx ;Qy are the coordinates. ; ;HISTORY: ;Written by H. Rhody, January 25, 2005 ; ;Constructed by modification of sample_click. ;- !mouse.button=1 count=0 WHILE(!MOUSE.BUTTON NE 4) DO BEGIN WSET,winP & wshow CURSOR,Xp,Yp,/DEVICE,/DOWN IF !MOUSE.BUTTON EQ 1 THEN begin vp=(count eq 0) ? [xp,yp,P[Xp,Yp]] : [[vp],[xp,yp,P[xp,yp]]] WSET,winQ & wshow CURSOR,Xq,Yq,/DEVICE,/DOWN ENDIF IF !MOUSE.BUTTON EQ 1 THEN begin PRINT,FORMAT='("Pos 1=[",I3,",",I3,"], VALUE=",I6," Pos 2=[",I3,",",I3,"], VALUE=",I6)',$ Xp,Yp,P[Xp,Yp],Xq,Yq,Q[xq,yq] vq=(count eq 0) ? [xq,yq,Q[Xq,Yq]] : [[vq],[xq,yq,Q[xq,yq]]] count=count+1 ENDIF ENDWHILE RETURN,{Px:vP[0,*],Py:vP[1,*],Pv:vP[2,*],Qx:vQ[0,*],Qy:vQ[1,*],Qv:vQ[2,*]} END