	PRO SENSOR_POINT, PITCH, YAW, SOLAR_X, SOLAR_Y
;+
; Project     :	SOHO - CDS
;
; Name        :	SENSOR_POINT
;
; Purpose     :	Calculate pointing from sun sensor data in the telemetry.
;
; Explanation :	Calculates the pointing based on the sun sensor data in the
;		telemetry.  The effects of the slit and scan mirror mechanisms
;		are not taken into account.  Nor are the effects of the pixel
;		selection on the (VDS) detector.
;
; Use         :	SENSOR_POINT, PITCH, YAW, SOLAR_X, SOLAR_Y
;
; Inputs      :	PITCH	= Sun sensor pitch telemetry word, from either the
;			  raster or exposure headers.  Can be either a scalar
;			  or an array.
;		YAW	= Sun sensor yaw telemetry word.
;
; Opt. Inputs :	None.
;
; Outputs     :	SOLAR_X	  = Pointing in the X direction, in arcsec.
;		SOLAR_Y	  = Pointing in the Y direction, in arcsec.
;
; Opt. Outputs:	None.
;
; Keywords    :	None.
;
; Calls       :	SENSOR_DECODE
;
; Common      :	None.
;
; Restrictions:	The formulas used to calculate the pointing are based on
;		equations 15 and 16 in "Notes on Pointing Calculation in CDS",
;		Version 2.0, MKC, 1/3/94.  They should be replaced with a more
;		exact calculation later.
;
;		Also, this routine should be upgraded to incorporate
;		information about the spacecraft roll.
;
; Side effects:	None.
;
; Category    :	Data handling, telemetry.
;
; Prev. Hist. :	None.
;
; Written     :	William Thompson, GSFC, 29 August 1994
;
; Modified    :	Version 0.1, William Thompson, GSFC, 29 August 1994
;
; Version     :	Version 0.1, 29 August 1994
;-
;
	ON_ERROR,2
;
;  Check the number of arguments.
;
	IF N_PARAMS() NE 4 THEN MESSAGE,	$
		'Syntax:  SENSOR_POINT, PITCH, YAW, SOLAR_X, SOLAR_Y'
;
;  The following constants are used in the calculation.
;
	P_FACTOR = [4.0, 1.0]		;pitch factor in arcsec/ADU
	Y_FACTOR = [4.0, 1.0]		;yaw factor in arcsec/ADU
	PITCH0	 = 0.0			;pitch origin in arcsec
	YAW0     = 0.0			;yaw factor in arcsec
;
;  Extract the values for the sun sensor pitch and yaw.
;
	SENSOR_DECODE, PITCH, P_BITS, P_MAG, P_RANGE
	SENSOR_DECODE, YAW,   Y_BITS, Y_MAG, Y_RANGE
;
;  Calculate the pointing in arcsec.  According to the "Notes on Pointing"
;  referred to above, the response of the sun sensor is not perfectly linear,
;  and the linear approximation may result in errors of order an arcminute
;  between the center of the sun and the edge of the sun.
;
	SOLAR_X  =  Y_MAG * Y_FACTOR(Y_RANGE) - YAW0
	SOLAR_Y  = -P_MAG * P_FACTOR(P_RANGE) + PITCH0
;
	RETURN
	END
