Test F3G Procedures Block-9 - CAPTURE SCOBJ

##########################################################################
##                                                                      ##
##                               BLOCK 9                                ##
##                            CAPTURE SCOBJ                             ##                        
##                                                                      ##
##########################################################################


## This block records the current S/C position (SCOBJ) for every Detailed 
## Survey PolyCam SUMFILE

## Assumptions:
## User has invoked a Bourne-Again Shell (bash) on ormacsrv1.lpl.arizona.edu
## User is a member of the group OREX\spc
## User has set up a skeleton directory in the following format:
## /SPC_Test/F3G-Nav/
##                   base/
##                            IMAGEFILES/
##                            SHAPEFILES/
##                   lsupport/
##                            PICTLIST.TXT
##                   orig/
##                   results/
##                   test/

## User inputs:
## testID: Name of the F3 test directory (for example, F3E-Limbs)
## subTestID: (if required) Identifier for sub-test work (for example, F3G1)
## dirID: Name of sub-directory in which to work (e.g. orig, or test)
## stateID: Current state of model, for SCOBJ tracking purposes 
##          (for example, 0_truth)
## blockID: User-specified identifier for typescript textfile name 
##          (for example, Block-9-CaptureSCOBJ-0_truth)

# User inputs:
export testID=F3G-Nav
#export subTestID=F3G1
export subTestID=F3G2
#export subTestID=F3G3
#export subTestID=F3G4
#export subTestID=F3G5
#export subTestID=F3G6
#export subTestID=F3G7
export dirID=test
#export stateID=0_truth
#export stateID=1_nominal
#export stateID=2_registered
export stateID=3_post5cmTile
#export stateID=4_post5cmIteration
#export stateID=5_final
export blockID=Block-9-CaptureSCOBJ-${subTestID}-${stateID}

# Set-Up
cd /SPC_Test/$testID/$dirID
script

# Display user inputs
echo $testID
echo $subTestID
echo $dirID
echo $stateID
echo $blockID

date
pwd
ls -l

ls -l SUMFILES/P60* | cut -d '.' -f 1 | rev | cut -d '/' -f 1 | rev > listSUM

# Capture SCOBJ
echo "`date`: `pwd` SCOBJ_${subTestID}_${stateID}" > scobj_${subTestID}_${stateID}
bash
while read line; do
  echo -n $line >> scobj_${subTestID}_${stateID}
  grep SCOBJ SUMFILES/${line}.SUM >> scobj_${subTestID}_${stateID}
done < listSUM
exit
cat scobj_${subTestID}_${stateID}

# Capture CZ
echo "`date`: `pwd` CZ_${subTestID}_${stateID}" > cz_${subTestID}_${stateID}
bash
while read line; do
  echo -n $line >> cz_${subTestID}_${stateID}
  grep CZ SUMFILES/${line}.SUM >> cz_${subTestID}_${stateID}
done < listSUM
exit
cat cz_${subTestID}_${stateID}


# Log SCOBJ and CZ
if [ ! -d /SPC_Test/$testID/log ]; then
  mkdir /SPC_Test/$testID/log
fi
mv scobj_${subTestID}_${stateID} /SPC_Test/$testID/log/
mv cz_${subTestID}_${stateID} /SPC_Test/$testID/log/

# Block Complete
date
exit

# Save block log

# OPTION 1: OVERWRITE TYPESCRIPT LOG
mv typescript /SPC_Test/$testID/log/log-typescript-${blockID}
# END OF OPTION 1

# OPTION 2: APPEND TYPESCRIPT LOG
cat typescript >> /SPC_Test/$testID/log/log-typescript-${blockID}
# END OF OPTION 2

Test F3G Procedures Block-9 - CAPTURE SCOBJ (last edited 2016-03-09 10:46:59 by DianeLambert)