Bench Spectrograph Automation

			GWC Data Streams

			Revised: May 8, 1996 by S. Gott
                        Revised: March 14, 2008, by sg (added thermal stream)


BSA Data Stream:
----------------

system	stream			description
------	------			-----------
wiyn	bsa.main		Bench Spectrograph Automation data stream.
wiyn    bsa.thermal             Bench MONSOON Detector Temperatures

BSA Data Stream Attributes:
--------------------------

-->bsa.main

attribute	type   number	keyword		units		description
---------	----   ------	--------	-----		-----------
collimatorname	string	1	COLNAME		NONE		The name of the collimator in use.
gratingname	string	1	GRATNAME	NONE		The name of the grating in use.
gratingangle	double	1	GRATANGL	RADIANS		The grating angle.
gratingorder	int	1	GRATORDR	NONE		The grating order.
cameraname	string	1	CAMNAME		NONE		The name of the camera in use.
cameraangle	double	1	CAMANGLE	RADIANS		The camera angle.
cameraanglecal	double	1	CAMANGCA	RADIANS		The camera angle calibration offset.
camerafocus	double	1	CAMFOCUS	INCHES		The camera focus position.
cameradistance	double	1	CAMDIST		INCHES		The grating-camera distance.
fibername	string	1	FIBNAME		NONE		The name of the fiber cable in use.
fiberfocus	double	1	FIBFOCUS	INCHES		The fiber focus position.
dewarangle	double	1	DEWARANG	RADIANS		The dewar angle.
filternamea	string	1	FILTNAMA	NONE		The name of the filter in slot a.
filternameb	string	1	FILTNAMB	NONE		The name of the filter in slot b.
filternamec	string	1	FILTNAMC	NONE		The name of the filter in slot c.
filternamed	string	1	FILTNAMD	NONE		The name of the filter in slot d.
filterpositiona	int	1	FILTPOSA	NONE		The position of filter mechanism a.
filterpositionb	int	1	FILTPOSB	NONE		The position of filter mechanism b.
filterpositionc	int	1	FILTPOSC	NONE		The position of filter mechanism c.
filterpositiond	int	1	FILTPOSD	NONE		The position of filter mechanism d.
shutter		int	1	SHUTTER		NONE		The position of the shutter.
stage		int	1	STAGEPOS	NONE		The position of the ATV/FBI stage.
illumination	int	1	FBIILLUM	NONE		The FBI illumination setting.
blink		int	1	FBIBLINK	NONE		The FBI blink setting.
scs		int	1	SCSLAMP		NONE		The SCS lamp selection.
stop		int	1	BSASTOP		NONE		The BSA safety stop state.
simulation	int	1	SIMULATE	NONE		The simulation mode state.
temperature	double	1	SPECTEMP	DEGREES_C	The spectrograph temperature.
room		int	1	BSAROOM		NONE		The spectrograph room light sensor state.

-->bsa.thermal

attribute       type   number   keyword         units           description
---------       ----   ------   --------        -----           -----------
temp1           string  1       BSTEMP1         Kelvin          Lakeshore sensor A, CCD Temperature
temp2           string  1       BSTEMP2         Kelvin          Lakeshore sensor B, tank coldplate


/* BSA device states (from bsa_states.h) */

#define BSA_OFF			(0)
#define BSA_ON			(1)

#define BSA_OUT			(0)	/* filter positions */
#define BSA_IN			(1)
#define BSA_LOAD		(2)

#define BSA_SCS_OFF		(0)	/* SCS lamp selections */
#define BSA_SCS_QUARTZ		(1)
#define BSA_SCS_THAR		(2)
#define BSA_SCS_CUAR		(3)

#define BSA_STAGE_ATV		(0)	/* ATV/FBI stage positions */
#define BSA_STAGE_OUT		(1)
#define BSA_STAGE_FBI		(2)

#define BSA_SHUTTER_CLOSED	(0)	/* shutter positions */
#define BSA_SHUTTER_OPEN	(1)
#define BSA_SHUTTER_UNKNOWN	(2)

#define BSA_ESTOP_RUN		(0)	/* safety stop states */
#define BSA_ESTOP_STOP		(1)