!-------------------------------------------------------------------------------
!
!  fgseng.resource 
!
!      This file is used to construct the trigger, error, and success 
!      status fields in the observation status file.
!
!--------------------------------------------------------------------
!                          REVISION HISTORY
!--------------------------------------------------------------------
!  MOD             PR
! LEVEL   DATE   NUMBER  User       Description
! ----- -------- ------  ------     -------------------------------------
!  000  10/24/01 44684   Goldst     Created initial version
!  001  01/25/02 44684   jschultz   various additions and modifications
!  002  03/11/02 45016   Goldst     Added OSF_TRIGGER1.DATA_ID
!  003  03/13/03 47496   jschultz   add new XPOLL_STATE and OSF_HOLD settings 
!                                   to use when need to hold FOF processing
!  004  03/25/03 47061   J.Baum     Add two new dangles
!  005  08/12/03 49253   Goldst     Added JCONN_JAR keyword
!  006  02/15/05 51570   Sontag     Added missing XPOLL_ERROR line
!  007  03/18/05 51570   MSwam      Sync with operational override
!       08/12/10 64432   MSwam      use path-defined DB_TYPE (SYBASE or MSSQL)
!     10/31/2011 67820   LThompson  add OSF_SUCCESS.AE to trigger next stage
!-------------------------------------------------------------------------------

!---------------------
! General Process info
!---------------------
PROCESS_NAME  = fgseng 
TASK          = <xpoll -p $PATH_FILE -r fgseng>
COMMAND       = fgseng.csh ^CL
DESCRIPTION   = 'Produce FGS Subset Files from FOF Files'
SYSTEM        = FOF 
CLASS         = fof
OSF_RANK      = 1
POLLING_TIME  = 10         ! Wait (seconds) before polling again 

!-------------
! OSF settings
!-------------
OSF_TRIGGER1.FE      = w    ! Process Trigger OSF 
OSF_TRIGGER1.DATA_ID = fof  ! Trigger class ID
OSF_PROCESSING.FE    = p    ! Process Processing OSF
OSF_SUCCESS.FE       = c    ! Success status: FE stage complete
OSF_SUCCESS.AE       = w    ! Success status: trigger AE stage
OSF_FAILURE.FE       = f    ! Process Failure OSF
OSF_HOLD.FE          = h    ! hold for MSC file processing
 
!-------------------
! Directories to use
!-------------------
ENV.INPATH   = FOF_INPUT_DIR   ! Contains input FOF Files
ENV.OUTPATH  = FOF_FGS_DIR     ! Contains output FGS Subset Files

!-----------------------
!message reporting level
!-----------------------
MSG_RPT_LVL  = JMSG_REPORT_LEVEL     ! message report level to use.  Set
                                     ! MSG_RPT_LVL equal to JMSG_REPORT_LEVEL
				     ! to cause your report level to be set
				     ! to what JMSG_REPORT_LEVEL is set to in 
				     ! your path file.  Otherwise set MSG_RPT_LVL
				     ! to one of he following:
				     ! ALL, NONE, DIAG, INFO, WARN, ERROR, FATAL
!--------------
! Database info
!--------------
DB_TYPE    = DB_TYPE       ! database type to use.
DB_SERVER  = DSQUERY       ! database server to use.  Set DB_SERVER equal to
                           ! DSQUERY.  This will cause your server to be set 
			   ! to what DSQUERY is set to in your path file.
DB_NAME    = OPUS_DB       ! database to use.  Set DB_NAME to OPUS_DB.  This 
                           ! will cause your database to be set 
			   ! to what OPUS_DB is set to in your path file.

!-------------------------
! Process Control Switches
!-------------------------
DROP_LAST_VALUE_BEFORE_GAP    = Y   ! Indicates if to drop the last value of
                                    ! telemetry parameters that occur just prior
				    ! to a gap. 
				    ! Set to "Y"es or "N"o

RETAIN_SUPERCOMMUTATED_DATA   = N   ! Indicates if supercommutated data is to be
                                    ! contained in the output product.  In FOF
				    ! data there is 1 packet per minor frame for
				    ! non-supercommutated data and 2 packets per
				    ! minor frame for supercommutated data with
				    ! the supercommutated data contained in the
				    ! second packet.  For typical FGS related
				    ! processing the supercommutated data is not
				    ! required so this switch should be set to
				    ! "N".

CHECK_FOF_TOLERANCES          = Y   ! Indicates if to see if any quality related
                                    ! tolerances were exceeded during fof
				    ! conversion.  If tolerances are not checked,
				    ! fof file is assumed to be of good quality
				    ! Set to "Y"es or "N"o

PRINT_FOF_CONVERSION_SUMMARY  = N   ! Indicates if to print out various counters
                                    ! that were maintained during fof conversion;
				    ! for example, number of good elements,
				    ! number of bad elements, number of discarded
				    ! elements ...  If a FOF Conversion Summary is 
				    ! selected to be printed, it will be printed 
				    ! to the fgseng process log file. 
				    ! Set to "Y"es or "N"o  

PRINT_FOF_QUALITY_SUMMARY     = Y   ! Indicates if to print out various quality
                                    ! metrics that were computed during fof 
				    ! conversion; for example, percentage of 
				    ! elements discarded, percentage of packets
				    ! discarded, ...
				    ! If a FOF Quality Summary is selected to be 
				    ! printed and the CHECK_FOF_TOLERANCES switch
				    ! is set to 'Y', the summary will be printed to
				    ! the fgseng process log file.  
				    ! Set to "Y"es or "N"o.

PRINT_FOF_GAP_SUMMARY         = Y   ! Indicates if to print out information
                                    ! relating to gaps found in the FOF data
				    ! during conversion; for example, the number  
				    ! of gaps, their start and end times, and their
				    ! length. If a FOF GAP Summary is selected to 
				    ! be printed, it will be printed to the fgseng
				    ! process log file. 
				    ! Set to "Y"es or "N"o 
!-------------------------------
! FOF quality related Tolerances
!-------------------------------
BAD_ELEMENT_TOLERANCE         = 10  ! Indicates the allowable percentage of 
                                    ! bad quality telemetry elements that can 
				    ! be discarded during fof conversion.  If
				    ! this percentage is exceeded, the OSF for
				    ! the FOF File will be set to 'f' (fail) in
				    ! the FE column and the file names of the FOF
				    ! file and any FGS Subset file produced will
				    ! be appended with the
				    ! QUESTIONABLE_DATA_DANGLE value specified
				    ! below in the Process Parameters section of
				    ! this resource file
 
DROPPED_ELEMENT_TOLERANCE     = 10  ! Indicates the allowable percentage of 
                                    ! telemetry elements that can be discarded 
				    ! during fof conversion because they contain
				    ! the last values of the parameters prior to
				    ! the start of a gap.  If this percentage is
				    ! exceeded, the OSF for the FOF File will be
				    ! set to 'f' (fail) in the FE column and the
				    ! file names of the FOF file and any FGS 
				    ! Subset file produced will be appended with 
				    ! the QUESTIONABLE_DATA_DANGLE value 
				    ! specified below in the Process Parameters 
				    ! section of this resource file

DISCARDED_ELEMENT_TOLERANCE   = 15  ! Indicates the total allowable percentage of
                                    ! telemetry elements that can be discarded 
				    ! for any reason during fof conversion.  If 
				    ! this percentage is exceeded, the OSF for 
				    ! the FOF File will be set to 'f' (fail) in 
				    ! the FE column and the file names of the FOF
				    ! file and any FGS Subset file produced will 
				    ! be appended with the 
				    ! QUESTIONABLE_DATA_DANGLE value specified 
				    ! below in the Process Parameters section of  
				    ! this resource file

BAD_PACKET_TOLERANCE          = 10  ! Indicates the allowable percentage of 
                                    ! bad quality telemetry packets that can 
				    ! be discarded during fof conversion.  If
				    ! this percentage is exceeded, the OSF for
				    ! the FOF File will be set to 'f' (fail) in
				    ! the FE column and the file names of the FOF
				    ! file and any FGS Subset file produced will
				    ! be appended with the
				    ! QUESTIONABLE_DATA_DANGLE value specified
				    ! below in the Process Parameters section of
				    ! this resource file

DUPLICATE_PACKET_TOLERANCE    =  5  ! Indicates the allowable percentage of 
                                    ! duplicate telemetry packets that can 
				    ! be discarded during fof conversion.  If
				    ! this percentage is exceeded, the OSF for
				    ! the FOF File will be set to 'f' (fail) in
				    ! the FE column and the file names of the FOF
				    ! file and any FGS Subset file produced will
				    ! be appended with the
				    ! QUESTIONABLE_DATA_DANGLE value specified
				    ! below in the Process Parameters section of
				    ! this resource file

GAP_PACKET_TOLERANCE          = 10  ! Indicates the allowable percentage of gap 
                                    ! packets that can be discarded during fof 
				    ! conversion. If this percentage is exceeded,
				    ! the OSF for the FOF File will be set to 'f'
				    ! (fail) in the FE column and the file names
				    ! of the FOF file and any FGS Subset file
				    ! produced will be appended with the
				    ! QUESTIONABLE_DATA_DANGLE value specified
				    ! below in the Process Parameters section of
				    ! this resource file

DISCARDED_PACKET_TOLERANCE    = 15  ! Indicates the total allowable percentage of
                                    ! telemetry packets that can be discarded 
				    ! for any reason during fof conversion.  If 
				    ! this percentage is exceeded, the OSF for 
				    ! the FOF File will be set to 'f' (fail) in 
				    ! the FE column and the file names of the FOF
				    ! file and any FGS Subset file produced will 
				    ! be appended with the 
				    ! QUESTIONABLE_DATA_DANGLE value specified 
				    ! below in the Process Parameters section of  
				    ! this resource file
!-------------------
! Process Parameters
!-------------------
TELEMETRY_TYPE                = FGS    ! Indicates that only FGS related
                                       ! telemetry parameters are of interest
				       ! during fof conversion           
				       
PROCESS_DATA_DANGLE           = _proc  ! appended to names of FGS Subset data
                                       ! files at start of processing. The value
				       ! will be replaced by GOOD_DATA_DANGLE or 
                                       ! QUESTIONABLE_DATA_DANGLE at end of
				       ! processing.

INDEX_DATA_DANGLE             = _index ! appended to names of FGS Subset index 
                                       ! files at start of processing. This
				       ! is not changed after processing.

GOOD_DATA_DANGLE              = _good  ! appended to names of FGS Subset files 
                                       ! when quality tolerances are checked and
				       ! found to be within limits

QUESTIONABLE_DATA_DANGLE      = _bad   ! appended to names of FOF and FGS Subset
                                       ! files when quality tolerances are
				       ! checked and found to be exceeded

MINBLOCKS                     = 50000  ! minimum disk space needed to run process

!--------------------
! Xpoll return states
!--------------------
XPOLL_STATE.00 = OSF_SUCCESS
XPOLL_STATE.01 = OSF_FAILURE
XPOLL_STATE.02 = OSF_HOLD
XPOLL_ERROR.FE = x           ! Some entirely unexpected failure

!-------------------------------------------------------------------------------
! causes environment variables to be set in the sub process spawned by XPOLL
! to execute the scipt specified by the "COMMAND" in the "General Process info"
! section at the beginning of this resource file
!-------------------------------------------------------------------------------
ENV.OPUS_DB = OPUS_DB
ENV.DSQUERY = DSQUERY
ENV.OK_TO_UPDATE_DATABASE = OK_TO_UPDATE_DATABASE
ENV.JCONN_JAR = JCONN_PATH
