C****************************************************************
C* 								*
C*								*
C*	DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY *
C*	EITHER FOR THE CREATION OR FOR THE CLINICAL EFFICACY	*
C*	OF THIS PROGRAM. USERS MUST ASSUME FULL RESPONSIBILITY	*
C*	FOR ANY RESULTS OR DIAGNOSES OBTAINED FROM THE USE	*
C*	OF THIS PROGRAM. QUESTIONS ON THE EXECUTION OF THIS	*
C*	PROGRAM MUST BE REFERRED BACK TO THE ORIGINAL AUTHOR.	*
C*								*
C* AUTHOR:	SALLY FORSTER					*
C*		C/O DEPARTMENT OF NUCLEAR MEDICINE		*
C*		GUY'S HOSPITAL				*
C*		LONDON, ENGLAND					*
C*								*
C*		TEL: 01-407-7600 EXT 2583/4			*
C*								*
C****************************************************************
	FUNCTION FFPICK(IP)
C*****PICKS X,Y VALUES FROM THE CURVE
C*****ACCEPTS ONE(X) OR TWO(X,Y)PARAMETERS
C*****RETURNS FUNCTION VALUE=-1 FOR PARAMETER ERROR
	IMPLICIT LOGICAL*1(A)
	IMPLICIT INTEGER*2 (D-Z)
	COMMON/SCREEN/AX(512),CYSCAL,CXSCAL,K,MM,CMA
	COMMON//SAVDES(256),CURVE1(512),CURVE2(512)
	COMMON/CH/F(4),CSR(20)
	COMMON/INPARA/CPAR(10)
	COMMON/WINDOW/FST,LST
	COMMON/LINEAR/ALIN,AINTER,ATOSEC
	FFPICK=1
	IF(IP.GT.3)GOTO 150
	IF(CPAR(1))10,150,500
10	IF(IP.GE.2.AND.CPAR(2).GE.0)GOTO 150
	IF(IP.EQ.3.AND.CPAR(3).GE.0)GOTO 150
	CALL TTON
	CALL CHSET(1,19)
	CALL WRITEL('X=',2)
	CALL CHSET(1,20)
	CALL WRITEL('Y=',2)
	CALL PCKMRK(JJ)
	CALL TTOF
	CSR(INT(-CPAR(1)))=FLOAT(JJ)
80	WRITE(7,200)JJ,CURVE1(JJ)
	IF(IP.GE.2)CSR(INT(-CPAR(2)))=CURVE1(JJ)
	IF(IP.NE.3)GOTO 110
C*****II=GROUP
	IF(.NOT.ATOSEC)GOTO 100
	CSEC=CURVE1(JJ)
	GOTO 109
100	IF(.NOT.ALIN)GOTO 102
	III=0
	GOTO 106
102	GP=0
	DO 105 II=1,SAVDES(118)
	III=(II-1)*5
	GP=GP+SAVDES(119+III)
	IF(JJ.LE.GP)GOTO 106
105	CONTINUE
	GOTO 150
106	CSEC=FLOAT(SAVDES(122+III))/FLOAT(SAVDES(123+III))
	CSEC=CURVE1(JJ)*CSEC
	CSR(INT(-CPAR(3)))=CSEC
109	WRITE(7,210)CSEC
110	CALL CLEAXY(19,0,12)
	CALL CLEAXY(20,0,12)
	RETURN
150	FFPICK=-1
	RETURN
200	FORMAT(1X,'X    = ',I6/,1X,'Y    = ',G13.6)
210	FORMAT(1X,'Y/SEC= ',G13.6)
C******PICK Y VALUE FOR SENT X VALUE
500	IF(IP.LT.2)GOTO 150
	JJ=INTPAR(1)
	IF(JJ.GT.SAVDES(108))GOTO 150
	GOTO 80
	END
