!--------------------------------------------------------------------
!
!      BC_STI  RESOURCE FILE
!
!
!      This file is used to construct the trigger, error, and success status
!      fields in the observation status file.
!
!
!--------------------------------------------------------------------
!                          REVISION HISTORY
!--------------------------------------------------------------------
!            PR
!   DATE   NUMBER  User      Description
! -------- ------  --------- -------------------------------------
! 09/30/96 31813   Rose      Created 
! 06/24/99 38324   WMiller   Set ENV vars
! 11/30/99 39546   Rose      Unix version
! 01/31/01 43165   MSwam     Add ARCH_SERVER,ARCH_DB for nocal check
! 11/02/01 44524   J.Baum    add ENV variables for exposure_times.pl
! 01/30/02 44524_1 J.Baum    fix value of OK_TO_UPDATE_DATABASE
! 06/17/02 45279   Slowinski change order of triggering
! 10/08/03 49496   MSwam     change OTFR_WORLD to UPDATE_EXPOSURE_TIMES
! 11/13/03 49799   J.Baum    Add FGS_DATA_ID ENV parameter 
! 06/24/04 51412   Sherbert  For PR 50437 Remove DISPLAY_ORDER
! 11/13/06 49671   Hamilton  Changed HT to FT
!
!--------------------------------------------------------------------

PROCESS_NAME = bc_sti		! Short name for process id
TASK = <xpoll -p $PATH_FILE -r bc_sti>
CLASS = STI
DESCRIPTION = 'STIS calibration'
SYSTEM = OPUS
COMMAND = bc_sti.csh		! Name of the command procedure

OSF_RANK = 1			! First Trigger
OSF_TRIGGER1.BC = w		! Need a 'Wait for CALSTIS' flag in Calibration
OSF_TRIGGER1.DATA_ID = sdm	! Also need the Data_id set to STIS
OSF_TRIGGER2.BC = w		! Need a 'Wait for CALSTIS' flag in Calibration
OSF_TRIGGER2.DATA_ID = sas	! STIS Association
OSF_TRIGGER3.BC = w		! Need a 'Wait for CALSTIS' flag in Calibration
OSF_TRIGGER3.DATA_ID = sti	! STIS Association

OSF_PROCESSING.BC  = p		! Set the processing flag to 'Processing'

XPOLL_STATE.01 = OSF_NORMAL	! Normal: Completed the CALSTIS step
OSF_NORMAL.BC	   = c		! Normal: Completed CALIBRATION
OSF_NORMAL.CA	   = w		! Normal: Completed CALIBRATION

XPOLL_STATE.03 = OSF_ERROR	! Return status of 03 indicates error.
OSF_ERROR.BC       = e		! Error:  Set the error flag

XPOLL_STATE.07 = OSF_NOCAL	! Exit status = 7 means no calibration.
OSF_NOCAL.BC	   = n		! No calibration required.
OSF_NOCAL.CA	   = n		! No calibration required.
OSF_NOCAL.AC	   = n		! No calibration required.
OSF_NOCAL.FT	   = w		! No calibration required.

XPOLL_STATE.09 = OSF_SDM	! Exit status = 9 means no calibration.
OSF_SDM.BC	   = n		! No calibration required.
OSF_SDM.RQ	   = w		! No calibration required.

XPOLL_ERROR.BC = x              ! Set osf to this if exit state is undefined.

POLLING_TIME       = 10		! Wait (seconds) before polling for next 
ENV.INPATH  	   = STI_SIS_DIR	! Directory where the input files are found
ENV.OUTPATH 	   = STI_CAL_DIR	! Directory where output files are written
MINBLOCKS 	   = 1000000	! blocks required on output disk
EXTENSION 	   = _raw.fits	! This input file extension must exist

ENV.ARCH_SERVER    = ARCH_SERVER
ENV.ARCH_DB        = ARCH_DB

ENV.OPUS_DB = OPUS_DB
ENV.SPSS_DB = SPSS_DB
ENV.DSQUERY = DSQUERY
ENV.ASSIST_DB = ASSIST_DB
!     variables used by exposure_times.pl
ENV.OK_TO_UPDATE_DATABASE = OK_TO_UPDATE_DATABASE ! determined by path file
ENV.UPDATE_EXPOSURE_TIMES = update_exposure_times 
ENV.FGS_PATH_NAME = FGS_PATH      ! fgs path name or NULL, set in path file
ENV.FGS_DATA_ID = fgs             ! data_id used in FGS piplfgs path name or NULL, set in path file
ENV.FGS_RCHECK_COLUMN = RJ        ! RCHECK stage in fgs pipeline
ENV.FGS_HOLD_STATUS = h           ! RJ value indicating a hold status  
ENV.FGS_RESTART_STATUS = w        ! RJ value to restart RCHECK process
