!--------------------------------------------------------------------
!
! Name: pcalcoa.resource
!
! Description: A special pre-archive version of the CALCOS association
!              resource file that calls a special version of the CALCOS wrapper
!              script. This version seeds the RANDSEED keyword in the input 
!              RAW FITS files with value = 1, which allows reproducing of 
!              matching calibrated output products.  
!
!              Was originally put in as an override for Linux/Solaris
!              parallel test comparisons, but it was decided that it would
!              benefit pre-archive pipeline processing as well, when we
!              need to try and duplicate results found there, and has no
!              detrimental effect on archive catalog content.
!
!              OTFR still uses the "calcoa.resource" and original CALCOS
!              wrapper script that leave RANDSEED = -1, generating more
!              random (and not reproducible) calibration results.
!
!--------------------------------------------------------------------
!                          REVISION HISTORY
!--------------------------------------------------------------------
!            PR
! mm/dd/yy NUMBER  User       Description
! -------- ------  ---------- -------------------------------------
! 05/23/11 68171   MSwam      calls randseed version of calcos script
! 
!--------------------------------------------------------------------
PROCESS_NAME = pcalcoa           ! Short name for process id
TASK = <xpoll -p $PATH_FILE -r pcalcoa>
COMMAND = calcos_randseed.csh            ! Name of the command procedure
DESCRIPTION = 'COS Calibration'
SYSTEM = OPUS
CLASS = COS

OSF_RANK = 1                    ! First Trigger
OSF_TRIGGER1.CA = w             ! pick up associations
OSF_TRIGGER1.DATA_ID = coa      ! 

OSF_TRIGGER2.CA = w             ! pick up singletons
OSF_TRIGGER2.DATA_ID = cos      ! 

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

XPOLL_STATE.00 = OSF_NORMAL     ! Normal: Completed calibration successfully
OSF_NORMAL.CA      = c          ! 
OSF_NORMAL.OM      = w          ! Wait for next stage

XPOLL_STATE.05 = OSF_NOCAL      ! Normal: no calibration required (eg ACQs)
OSF_NOCAL.CA       = n          ! 
OSF_NOCAL.OM       = w          ! Wait for next stage

XPOLL_STATE.01 = OSF_ERROR      ! Error during calibration
OSF_ERROR.CA       = e          ! 

XPOLL_ERROR.CA = 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.INPATH         = COS_SIS_DIR  ! Where the .trx file is found
ENV.OUTPATH        = COS_CAL_DIR  ! Directory where output files are written
ENV.USE_CSUM       = use_cos_csum ! set FALSE in path to suppress csum files
ENV.CSUM_DIR       = COS_SUM_DIR  ! Directory in which to move the csum files 
