Test F3G Procedures Block 8A - GEOMETRY/RESIDUALS

##########################################################################
##                                                                      ##
##                               BLOCK 8A                               ##
##                    RESIUALS AND GEOMETRY - GLOBAL                    ##                        
##                                                                      ##
##########################################################################


## This block contains all the commands required to achieve a safe state
## from which to run geometry, and the commands required to create a back-up
## of the model and run geometry. This is NOT a linear set of commands, it
## is intended only to provide the commands and guidance required for the 
## user to progress the model through the required processing states, many
## sets of commands may need to be iterated.

## 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 has completed the processing steps comprising Block 1A - TEST DIRECTORY
## SET-UP - ORIG
## If working in the test/ sub-directory, user has set up the test sub-directory, as per
## Block 1B - TEST DIRECTORY SET-UP - 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)
## blockID: User-specified identifier for typescript textfile name 
##          (for example, Block-1A-TestDirSetUp-Orig)

# User inputs:
export testID=F3G-Nav
export subTestID=NONE
#export subTestID=F3G1
#export subTestID=F3G2
#export subTestID=F3G3
#export subTestID=F3G4
#export subTestID=F3G5
#export subTestID=F3G6
#export subTestID=F3G7
export dirID=orig
#export dirID=test
export blockID=Block-8A-ResidualsGeometry-${subTestID}-post10cmTile
#export blockID=Block-8A-ResidualsGeometry-${subTestID}-post5cmTile

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

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

date
pwd
ls -l

## Pre-geometry work

# Check correlation
cp USED_MAPS.TXT LIST.TXT
duplicates
mv make_script.in listLMRKS
nohup sh support/batchCheck.sh listLMRKS &
# Inspect tmpResults looking for all minimum correlations > 0.5
cat tmpResults.txt

## PROCESSING STATE: CORRELATED

# Run residuals
echo 5 .005 .0002 | residuals

# Inspect lmrks
grep ">>" RESIDUALS.TXT
# Inspect and fix LMRKS via lithos

# Inspect MAPINFO.TXT
# Minimum of 5 images per lmrk
cat MAPINFO.TXT
sort -k7 MAPINFO.TXT
# Add images as required via lithos

## PROCESSING STATE: IMAGED

# Inspect PICINFO.TXT
# Minimum of 3 lmrks per DS image or any image with limbs
cat PICINFO.TXT
awk '/\*/ { print $1,$8,$9 }' PICINFO.TXT | grep -v " 0 "
# Fix pictures via autoregister

# re-run resduals and check/fix as necessary

# Back-up!!
if [ ! -d /SPC_Test/$testID/back/back_${blockID} ]; then
  mkdir -p /SPC_Test/$testID/back/back_${blockID}
  mkdir -p /SPC_Test/$testID/back/back_${blockID}_DS_POLYCAM_NOMINALS
  mkdir -p /SPC_Test/$testID/back/back_${blockID}_DS_POLYCAM_SUMFILES 
fi
rsync --exclude=*.DAT --exclude=*.pgm -ha /SPC_Test/$testID/$dirID/ /SPC_Test/$testID/back/back_${blockID}/
rsync -ha /SPC_Test/$testID/base/$subTestID/NOMINALS/ /SPC_Test/$testID/back/back_${blockID}_DS_POLYCAM_NOMINALS/
rsync -ha /SPC_Test/$testID/base/$subTestID/SUMFILES/ /SPC_Test/$testID/back/back_${blockID}_DS_POLYCAM_SUMFILES/

# Run geometry
echo "120" > geometry.in
echo "15" >> geometry.in
echo "y" >> geometry.in
echo "n" >> geometry.in
geometry < geometry.in

# Review results
echo 5 .005 .0002 | residuals
# Inspect lmrks
grep ">>" RESIDUALS.TXT
# Inspect MAPINFO.TXT
sort -k7 MAPINFO.TXT
# Inspect PICINFO.TXT
cat PICINFO.TXT
awk '/\*/ { print $1,$8,$9 }' PICINFO.TXT | grep -v " 0 "

# Log output files
mkdir -p log/log-${blockID}
cp tmpResults.txt log/log-${blockID}
mkdir -p log/log-residuals-${blockID}
cp RESIDUALS.TXT MAPINFO.TXT PICINFO.TXT RANGES_SOLVED.TXT LMKVECS.TXT log/log-residuals-${blockID}/

# Block Complete
date
exit

# Save block log
if [ ! -d /SPC_Test/$testID/log ]; then
  mkdir /SPC_Test/$testID/log
fi

# 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 8A - GEOMETRY/RESIDUALS (last edited 2016-03-08 15:04:13 by DianeLambert)