!--------------------------------------------------------------------
!
!      CSUM_COS RESOURCE FILE
!
!
!      This file is used to construct the trigger, error, and success status
!      fields in the observation status file.
!
!
!--------------------------------------------------------------------
!                          REVISION HISTORY
!--------------------------------------------------------------------
!            PR
! mm/dd/yy NUMBER  User       Description
! -------- ------  ---------- -------------------------------------
! 09/10/10 61157   MSwam      first version
! 10/14/10 61157   Mary       added COS_CAL_DIR and fixed COS_SUM_DIR
! 02/21/13 73570   MSwam      add STEP(s) trigger mode that stops after CCI
!--------------------------------------------------------------------
PROCESS_NAME = csum_cos ! Short name for process id
TASK = <xpoll -p $PATH_FILE -r csum_cos>
COMMAND = csum_cos.csh            ! Name of the command procedure
DESCRIPTION = 'COS cumulative image generation'
SYSTEM = OPUS
CLASS = COS

OSF_RANK = 1                    ! First Trigger
OSF_TRIGGER1.OM = w             ! normal pick up of singletons
OSF_TRIGGER1.DATA_ID = cos      ! 

OSF_TRIGGER2.OM = w             ! normal pick up of associations
OSF_TRIGGER2.DATA_ID = coa      ! 

OSF_TRIGGER3.OM = s             ! pick up singletons but ONLY DO THIS STEP
OSF_TRIGGER3.DATA_ID = cos      ! 

OSF_TRIGGER4.OM = s             ! pick up associations but ONLY DO THIS STEP
OSF_TRIGGER4.DATA_ID = coa      ! 

OSF_PROCESSING.OM  = p          ! Set flag while 'Processing'

XPOLL_STATE.00 = OSF_NORMAL     ! Normal: Completed CSUM generation
OSF_NORMAL.OM      = c          ! 
OSF_NORMAL.AC      = w          ! Wait for next stage

XPOLL_STATE.01 = OSF_ERROR      ! Error during CSUM generation
OSF_ERROR.OM       = e          ! 

XPOLL_STATE.02 = OSF_NO_CSUM    ! No CSUM files found for this exposure
OSF_NO_CSUM.OM     = n          ! 
OSF_NO_CSUM.AC     = w          ! Wait for next stage

XPOLL_STATE.16 = OSF_CCI_ONLY   ! processing should STOP after CCI is run
OSF_CCI_ONLY.OM    = b          ! COS blue mode, so STOP here

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

POLLING_TIME       = 10         ! Wait (seconds) before polling for next 
MINBLOCKS            = 1000000  ! blocks required on output disk

ENV.COS_CAL_DIR    = COS_CAL_DIR  ! Dir where exposure .tra files are
ENV.OUTPATH        = COS_CCI_DIR  ! Directory where output files are written
ENV.COS_CCI_DIR    = COS_CCI_DIR  ! Directory where output files are written
                                  ! repeated for use by cci programs.
ENV.COS_SUM_DIR    = COS_SUM_DIR  ! where input CSUM files are found
! the current code REQUIRES that STI_SCI_DIR and MAMA_DIR reside on the same
! disk partition, since a hard-link is used to reference both areas to the
! same physical files
ENV.CCI_ARCHIVE_DIR = MAMA_DIR    ! where CCI files move for archiving

ENV.CCI_NO_FILES   = 3   ! cci_cos_check_change exit code for no CCI files
ENV.CCI_DIFFERENT  = 5   ! cci_cos_check_change exit code for closing CCI set
ENV.CCI_FILE_COUNT = 8   ! number of CCI files for COS
ENV.CCI_DATA_ID    = csi ! data id for Cumulative Count Image archiving OSFs
ENV.CCI_ARCHIVE_TRIGGER = " -c RQ -s w "  ! OSF status to trigger CCI archiving
