#!/bin/sh # # run all tetracorder modes for standard mapping run, and compress the results, # or single spectrum mode # Roger N. Clark, December 21, 1994 - 2020 # usage: # cmd.runtet cube|single [cubefilename] [band #] [gif|png] # # band number for gray-scale images is put in the file: # band.number.grayscale # if band is not on the command line, and the # file band.number.grayscale is not found, default = channel 20 # command line band number overrides band.number.grayscale # #################################################################### # ##### TO BE CHANGED WHEN CHANGING TETRACORDER VERSION: # production version for cubes: ptc="/usr/local/bin/tetracorder6.00" # production version for large single spectra: pts="/usr/local/bin/tetracorder6.00single" #################################################################### ########################################## # Tetracorder reads from the command file using the < directive. # when installed, the install script modifies the # cmds.start.t6.00a string to the cmds.start.tX.Xn file name # where the tetracorder setup commands are located. # for example, the commands might be in cmds.start.t4.4a # so cmds.start.t6.00a should be changed to cmds.start.t4.4a tetcmdsstart=cmds.start.t6.00a if [ "$1" = "single" ] then tetmode="singlespectrum" tetcmdsstart=${tetcmdsstart}.single elif [ "$1" = "follow" ] # single sp3ectrum mode, follow growing v file then tetmode="singlespectrumfollow" tetcmdsstart=${tetcmdsstart}.single.follow elif [ "$1" = "cube" ] then tetmode="cube" else echo "Error: no cube|single" echo "usage:" echo " cmd.runtet cube" echo " or" echo " cmd.runtet single" echo "exit 1" exit 1 fi imageout="gif" if [ "$5" = "png" ] then imageout="png" fi if [ "$5" = "none" ] then imageout="none" fi # Note: either include the full path to the image cube, or edit the following # line to be the full path # the /data/emit20240626t165035_rfl will get changed to the cube file by the cmd-install # script (lunix/unix). If not, then it can be passed on # the command line, or simply hard coded by hand here. # The cube can be a relative or absolute path # for example, a full lunix/unix path is: # cube=/data/mountains/2006.aviris/cubes/f060506t01p00r09.rtgc # If a relative path, like: # ../cubes/f060506t01p00r09.rtgc # the scripts which change directories will attempt to add a # relative path, but for non standard implimentations, the path # might not be found. If that problem occurs, it should be detected # and the script will stop. #################################################################### if [ "$tetmode" = "cube" ] then cube=/data/emit20240626t165035_rfl if [ -n "$2" ] then cube=$2 fi if [ ! -f "$cube" ] then echo "ERROR: cube not found" echo " cube= $cube" echo " ls -ld $cube" ls -ld $cube echo "exit 1" exit 1 fi # set band number. This is used as the base image for the jpeg results generation. aband=20 if [ "$3" = "band" ] then aband=$4 # band number to extract if [ "$aband" -lt 1 ] then aband=3 fi fi fi echo "cmd.runtet start: " `date` echo " " echo "cmd.runtet $*" echo " " if [ ! -d "AAA.info" ] then mkdir AAA.info # info directory fi if [ -d "AAA.info" ] then if [ -f "AAA.info/CMDS-executed" ] then echo "cmd.runtet started" `date` >> AAA.info/CMDS-executed else echo "cmd.runtet started" `date` > AAA.info/CMDS-executed fi if [ ! -f "AAA.info/CMDS-flags" ] then cp /dev/null AAA.info/CMDS-flags fi fi ##### now run tetracorder ################ # Normally, tetracorder is the production version in # /usr/local/bin or the developmental version /src/local. # select one of the following # cube vs single: # sizes defined in multmap.h in the source code. # cube width typically around 32000+ pixels, <1000 spectral channels # singlespectrum compile: 1 pixel wide, many thousands of spectral channels if [ "$tetmode" = "cube" ] then # production version for cubes: pt=$ptc elif [ "$tetmode" = "singlespectrum" ] then # production version for large single spectra: pt=$pts elif [ "$tetmode" = "singlespectrumfollow" ] then # production version for large single spectra: pt=$pts else echo "ERROR unknown mode: $tetmode" echo "exit 1" exit 1 fi # developmental version (set by editing this script): # pt=/src/local/tetracorder6.00/tetracorder6.00 if [ "$tetmode" = "cube" ] then makdual=1 # default is to make dual result+grayscale image output echo "$pt r1" '< tetracorder.out' >> AAA.info/CMDS-executed echo " <$tetcmdsstart " >> AAA.info/CMDS-executed echo " e " >> AAA.info/CMDS-executed echo "EOI " >> AAA.info/CMDS-executed echo " " >> AAA.info/CMDS-executed echo " " >> AAA.info/CMDS-executed echo "$pt r1" '< tetracorder.out' $pt r1 < tetracorder.out 2>&1 <$tetcmdsstart e EOI echo "tetracorder complete" `date` echo "Begin post tetracorder work on cube mapping results" if [ ! -d "AAA.info" ] then mkdir AAA.info # info directory fi grep -a DISABLED tetracorder.out > AAA.info/disabled-materials.txt grep -a EDinfo history > AAA.info/enable-disable-all.txt grep -a EDinfo1 history > AAA.info/enable-disable-groups.txt grep -a EDinfo2 history > AAA.info/enable-disable-materials.txt grep -a EDinfo3 history > AAA.info/enable-disable-features.txt echo "getting output image size" imsize3=`cmds.all.support/davinci.get.image.fd.size 2>&1 | tail -1` xpixels=`echo $imsize3 | awk '{ print $1 }'` ypixels=`echo $imsize3 | awk '{ print $2 }'` echo "output image size: xpixels= $xpixels ypixels= $ypixels" echo "$xpixels" > AAA.info/image-xpixels.txt echo "$ypixels" > AAA.info/image-ypixels.txt grep '^cube:' history | sed -e 's/^cube://' | awk '{ print $1 }' > AAA.info/cubefilename.txt grep '3D data set: Lines:' history | sed -e 's/^.*Bands://' | awk '{ print $1 }' > AAA.info/cube-bands.txt if [ "$xpixels" -gt 2000 ] then makdual=0 echo "Image width is > 2000 pixels: $xpixels" echo " so not making dual images" fi #Possible header ascii data in first line: # LBLSIZE= # vicar header # description # envi header generated by davinci script # ENVI # envi # envi # envi # Note: tetracorder (12/2019) wants an envi cube file name without the .hdr envi # extension, but davinci scripts want the .hdr extension to read # envi files and cubes. So for the scripts here, check that the file # has the .hdr extension when needed. - RNC 12/03/2019 # However, davinci does not read an envi cube correctly (10/2020) when # the cube also has a header (like a vicar header). If a header, then # read that file format. cubedatafile=$cube cubedir=`dirname $cube` cubeheaderfile=0 # this file is a separate cube header file cubedatafile=0 # this file is the cube binary data vicarheader=0 # no vicar header on binary data file ahdrflag=`echo "$cube" | grep '.hdr$'` if [ -z "$ahdrflag" ] # not a header file then cubedatafile=$cube testhdr=${cube}.hdr if [ -f "$testhdr" ] then cubeheaderfile=$testhdr ahdrflag=$testhdr fi fi if [ -n "$ahdrflag" ] then if [ "$cubeheaderfile" = 0 ] # if not set above, then set it. then cubeheaderfile=$cube fi echo "this is a header file = $cubeheaderfile" # now get the mapinfo line from the .hdr file if it exists mapinfosize=`grep '^map info =' cubeheaderfile | wc | awk '{ print $1 }'` if [ "$mapinfosize" -eq '0' ] then echo "WARNING: no mapinfo found in $cubeheaderfile" fi projinfosize=`grep '^map info =' cubeheaderfile | wc | awk '{ print $1 }'` if [ "$projinfosize" -eq '0' ] then echo "WARNING: no projection info found in $cubeheaderfile" fi coordinfosize=`grep '^map info =' cubeheaderfile | wc | awk '{ print $1 }'` if [ "$coordinfosize" -eq '0' ] then echo "WARNING: no coordinate system found in $cubeheaderfile" fi grep '^map info =' $cubeheaderfile > AAA.info/mapinfo.txt grep 'projection info =' $cubeheaderfile >> AAA.info/mapinfo.txt grep 'coordinate system string =' $cubeheaderfile >> AAA.info/mapinfo.txt cubedatafile=`basename $cube .hdr` cubedatafile=${cubedir}/$cubedatafile if [ -f "$cubedatafile" ] then echo "cube data file = $cubedatafile" else echo "ERROR: cannot find cube data file: $cubedatafile" echo "exit 1" exit 1 fi fi # geology: make envi header for the geologic origins cube and make gif fie results if [ -f "geologic-origins/geologic_origins_cube.v" ] then echo "cd geologic-origins " >> AAA.info/CMDS-executed cd geologic-origins echo "davinci.make.envi.header.from.vicar geologic_origins_cube.v > geologic_origins_cube.v.hdr" >> AAA.info/CMDS-executed echo "davinci.make.envi.header.from.vicar geologic_origins_cube.v > geologic_origins_cube.v.hdr" davinci.make.envi.header.from.vicar geologic_origins_cube.v > geologic_origins_cube.v.hdr echo " " echo "./cmd.make.gifs.from.geocube" >> AAA.info/CMDS-executed echo "./cmd.make.gifs.from.geocube" ./cmd.make.gifs.from.geocube echo "cd .." >> AAA.info/CMDS-executed cd .. echo " " >> AAA.info/CMDS-executed fi # make a generic envi header for the tetracorder results files, 1 band bsq image1=`ls group.1um/*.fd* group.2um/*.fd* | head -1` echo "$image1" ls -l $image1 head -1 $image1 echo "davinci.make.envi.header.from.vicar $image1 > AAA.info/image-envi-header-1band-bsq.hdr" echo "davinci.make.envi.header.from.vicar $image1 > AAA.info/image-envi-header-1band-bsq.hdr" >> AAA.info/CMDS-executed davinci.make.envi.header.from.vicar $image1 > AAA.info/image-envi-header-1band-bsq.hdr cat AAA.info/mapinfo.txt >> AAA.info/image-envi-header-1band-bsq.hdr for i in `ls -d group.* case*` do echo "compressing files in $i" cd $i a=`ls *.fit` if [ ! -z "$a" ] then gzip $a fi a=`ls *.depth` if [ ! -z "$a" ] then gzip $a fi a=`ls *.fd` if [ ! -z "$a" ] then gzip $a fi cd .. done echo " " echo "##############################################" echo "############ compression complete" `date` echo " " echo " " echo "#############################################" echo "### Checking DISABLED groups ##############" echo " " # NOTE: some directories have more than one entry, e.g. group.veg # so one entry might be disabled, but others are not, so need # to check consistency enabledisablegrp='AAA.info/enable-disable-groups.txt' if [ -f "$enabledisablegrp" ] then echo " removing DISABLED directories" disableddirs=`grep DISABLED $enabledisablegrp | sed -e 's/^.*dir= //' | sed -e 's,/,,' | awk '{ print $1 }' | sort -u` if [ -n "$disableddirs" ] then for idir in $disableddirs do isisenabled=`grep ENABLED $idir` if [ -z "$isisenabled" ] # ne enabled found, so delete then echo " remove $idir" rm -rf $idir fi done else echo " no DISABLED directories found" fi fi echo " " echo "#############################################" echo " " cd Band.images # note: aviris.true.color and aviris.to.TM valid only with AVIRIS Data # check that we can find the cube bcube=$cube if [ ! -f "$cube" ] then a=$cube bcube=../$a if [ ! -f "$bcube" ] then echo "ERROR: $a not found from sub-directory Band.images" echo " we tried adding .. but that didn't work either: $bcube" echo "try using full path to cube" echo "skipping aviris.true.color and aviris.to.TM" fi fi if [ -f "$bcube" ] then echo "NOTE: aviris.true.color and aviris.to.TM valid only with AVIRIS Data" `date` aviris.true.color $bcube band > makem.out 2>&1 aviris.to.TM $bcube band > makem.out 2>&1 # now add envi headers for bb in band* do if [ -f "$bb" ] then if [ -f "AAA.info/image-envi-header-1band-bsq.hdr" ] then cp AAA.info/image-envi-header-1band-bsq.hdr ${bb}.hdr else davinci.make.envi.header.from.vicar $bb > ${bb}.hdr fi # now make jpg images for easy viewing echo "davinci.image.to.jpeg $bb 0 ${bb}.jpg -gamma 500" davinci.image.to.jpeg $bb 0 ${bb}.jpg -gamma 500 fi done fi cd .. # add some images together into more general groups echo " " echo "##############################################" echo " " echo "./cmds.all.support/davinci.add.iron.oxides started" `date` echo "./cmds.all.support/davinci.add.iron.oxides started" `date` >> AAA.info/CMDS-executed ./cmds.all.support/davinci.add.iron.oxides echo "./cmds.all.support/davinci.add.kaol+smect started" `date` echo "./cmds.all.support/davinci.add.kaol+smect started" `date` >> AAA.info/CMDS-executed ./cmds.all.support/davinci.add.kaol+smect echo "./cmds.all.support/davinci.alunite+kaolinite.muscovite started" `date` echo "./cmds.all.support/davinci.alunite+kaolinite.muscovite started" `date` >> AAA.info/CMDS-executed ./cmds.all.support/davinci.alunite+kaolinite.muscovite echo "./cmds.all.support/davinci.add.ALUNITE_COMP started" `date` echo "./cmds.all.support/davinci.add.ALUNITE_COMP started" `date` >> AAA.info/CMDS-executed ./cmds.all.support/davinci.add.ALUNITE_COMP echo "./cmds.all.support/davinci.add.ALUN+PYROPH started" `date` echo "./cmds.all.support/davinci.add.ALUN+PYROPH started" `date` >> AAA.info/CMDS-executed ./cmds.all.support/davinci.add.ALUN+PYROPH echo "./cmds.all.support/davinci.add.KAOL+MUSC started" `date` echo "./cmds.all.support/davinci.add.KAOL+MUSC started" `date`>> AAA.info/CMDS-executed ./cmds.all.support/davinci.add.KAOL+MUSC echo "./cmds.all.support/davinci.add.PYROPH+MUSC started" `date` echo "./cmds.all.support/davinci.add.PYROPH+MUSC started" `date` >> AAA.info/CMDS-executed ./cmds.all.support/davinci.add.PYROPH+MUSC echo "./cmds.all.support/davinci.add.TALCS started" `date` echo "./cmds.all.support/davinci.add.TALCS started" `date` >> AAA.info/CMDS-executed ./cmds.all.support/davinci.add.TALCS echo "./cmds.all.support/davinci.add.generic_Fe2+ started" `date` echo "./cmds.all.support/davinci.add.generic_Fe2+ started" `date` >> AAA.info/CMDS-executed ./cmds.all.support/davinci.add.generic_Fe2+ echo " " >> AAA.info/CMDS-executed ############### make sure all newly generated images are compressed echo "compressing all image files (gzip)" >> AAA.info/CMDS-executed echo " " >> AAA.info/CMDS-executed for i in `ls -d group.* case*` do echo "compressing files in $i " cd $i a=`ls *.fit` if [ ! -z "$a" ] then gzip $a fi a=`ls *.depth` if [ ! -z "$a" ] then gzip $a fi a=`ls *.fd` if [ ! -z "$a" ] then gzip $a fi cd .. done for i in `ls -d group.* case*` do echo "checking that all compressed image files in $i have envi headers" cd $i a=`ls *.fit.gz` if [ ! -z "$a" ] then for jj in $a do if [ -f "${jj}" -a ! -f "${jj}.hdr" ] then echo "making envi header:" if [ -f "../AAA.info/image-envi-header-1band-bsq.hdr" ] then echo " cp ../AAA.info/image-envi-header-1band-bsq.hdr ${jj}.hdr" cp ../AAA.info/image-envi-header-1band-bsq.hdr ${jj}.hdr else echo " davinci.make.envi.header.from.vicar $jj > ${jj}.hdr" davinci.make.envi.header.from.vicar $jj > ${jj}.hdr fi fi done fi a=`ls *.depth.gz` if [ ! -z "$a" ] then for jj in $a do if [ -f "${jj}" -a ! -f "${jj}.hdr" ] then echo "making envi header:" if [ -f "../AAA.info/image-envi-header-1band-bsq.hdr" ] then echo " cp ../AAA.info/image-envi-header-1band-bsq.hdr ${jj}.hdr" cp ../AAA.info/image-envi-header-1band-bsq.hdr ${jj}.hdr else echo " davinci.make.envi.header.from.vicar $jj > ${jj}.hdr" davinci.make.envi.header.from.vicar $jj > ${jj}.hdr fi fi done fi a=`ls *.fd.gz` if [ ! -z "$a" ] then for jj in $a do if [ -f "${jj}" -a ! -f "${jj}.hdr" ] then echo "making envi header:" if [ -f "../AAA.info/image-envi-header-1band-bsq.hdr" ] then echo " cp ../AAA.info/image-envi-header-1band-bsq.hdr ${jj}.hdr" cp ../AAA.info/image-envi-header-1band-bsq.hdr ${jj}.hdr else echo " davinci.make.envi.header.from.vicar $jj > ${jj}.hdr" davinci.make.envi.header.from.vicar $jj > ${jj}.hdr fi fi done fi cd .. done ############### echo " " echo "##############################################" echo " " echo "add geometry info to all created image files with envi headers " `date` echo "./cmds.all.support/cmd.add.geometry.info.to.envi.headers $cube" echo " " echo "./cmds.all.support/cmd.add.geometry.info.to.envi.headers $cube" >> AAA.info/CMDS-executed ./cmds.all.support/cmd.add.geometry.info.to.envi.headers $cube echo " " >> AAA.info/CMDS-executed ############### echo "date" >> AAA.info/CMDS-executed date echo " " echo "##############################################" echo " " echo "Begin cluster analysis" `date` echo "./cmds.all.support/cluster.analysis" echo " " echo "./cmds.all.support/cluster.analysis" >> AAA.info/CMDS-executed ./cmds.all.support/cluster.analysis echo " " echo "##############################################" echo " " echo "Generating pw commands of top materials" `date` echo "./cmds.all.support/gen.pw.clustered25.cmds" echo " " echo "./cmds.all.support/gen.pw.clustered25.cmds" >> AAA.info/CMDS-executed ./cmds.all.support/gen.pw.clustered25.cmds echo " " echo "##############################################" echo " " echo "Generating gamma stretched gif images" `date` echo "./cmds.all.support/gen.fd.gif.images" echo " " echo "./cmds.all.support/gen.fd.gif.images" >> AAA.info/CMDS-executed ./cmds.all.support/gen.fd.gif.images echo " " >> AAA.info/CMDS-executed if [ -f "$cube" ] then datahdr=`dd if=$cubedatafile ibs=8 count=1` if [ "$datahdr" = "LBLSIZE=" ] then vicarheader='vicar' cube=$cubedatafile echo "cube data file has a vicar header" echo "using this cube data file for post tetracorder analysis" else echo "there is no vicar header on the data file" if [ "$cubeheaderfile" != 0 ] then cube=$cubeheaderfile fi fi echo "using cube = $cube" ############################ #### make base gray image and color images, put in the base-image/ directory if [ -f "AAA.info/cube-scale-factor" ] then scalefactor=`cat AAA.info/cube-scale-factor | head -1 | awk '{ print $1 }'` else scalefactor="1.0" fi echo " " echo "###########################################################" echo "Making base images from cube $cube" `date` echo " Cube scale factor = $scalefactor" scalefactor2=$scalefactor # The base images are defined in AAA.info/color-{dataset} # e.g. AAA.info/color-emit_c: # BASE 23 23 23 base-image.jpg # base grayscale image # COLOR1 38 23 11 color-visRGB.jpg # visible color channels # COLOR2 246 85 18 color-vir.jpg # false color vis-IR # MAXREFL 0.02 # scale 255 DN to this reflectance level if [ ! -d "base-image" ] then echo "mkdir base-image" mkdir base-image fi if [ ! -d "color.results-envi" ] then echo "mkdir color.results-envi" mkdir color.results-envi fi if [ -f "AAA.info/dataset" ] then dataset=`cat AAA.info/dataset | head -1 | awk '{ print $1 }'` basefile="COLOR.channels/color-$dataset" fi shortcubeid='tet' if [ -f "AAA.info/shortcubeid.txt" ] then shortcubeid=`head -1 AAA.info/shortcubeid.txt | awk '{ print $1 }'` fi longcubeid='tet' if [ -f "AAA.info/longcubeid.txt" ] then longcubeid=`head -1 AAA.info/longcubeid.txt | awk '{ print $1 }'` fi if [ "$longcubeid" = "tet" -a "$shortcubeid" != "tet" ] then longcubeid=$shortcubeid # longcubeid was not defined but short was fi if [ -f "$basefile" ] then echo " " MAXREFL="1.0" maxr=`grep MAXREFL $basefile` if [ -n "$maxr" ] then maxref=`echo $maxr | awk '{ print $2 }'` if [ -n "$maxref" ] then MAXREFL=$maxref else MAXREFL="1.0" fi else MAXREFL="1.0" fi # modified scale factor if we want darker surfaces shown lighter scalefactor2=`echo "$scalefactor $MAXREFL" | awk '{ print $1 / $2 }'` echo "Maximum reflectance for bas and color images = $MAXREFL" echo "cube scale factor to reflectance = $scalefactor" echo "scale factor from cube to output image with amx reflectance = $MAXREFL is now: $scalefactor2" echo " " BASE=`grep BASE $basefile` if [ -n "$BASE" ] then echo "making BASE: $BASE" ch1=`echo $BASE | awk '{ print $2 }'` ch2=`echo $BASE | awk '{ print $3 }'` ch3=`echo $BASE | awk '{ print $4 }'` grayofile=`echo $BASE | awk '{ print $5 }'` graypngfile=`basename $grayofile .jpg`.png echo "davinci.make.rgb.image.from.cube $cube $scalefactor2 $ch1 $ch2 $ch3 base-image/$grayofile base-image/$graypngfile" echo "davinci.make.rgb.image.from.cube $cube $scalefactor2 $ch1 $ch2 $ch3 base-image/$grayofile base-image/$graypngfile" >> AAA.info/CMDS-executed davinci.make.rgb.image.from.cube $cube $scalefactor2 $ch1 $ch2 $ch3 base-image/$grayofile base-image/$graypngfile ls -l base-image/$grayofile else echo "NOT FOUND: BASE: $BASE" fi echo " " COLOR1=`grep COLOR1 $basefile` if [ -n "$COLOR1" ] then echo "making COLOR1: $COLOR1" ch1=`echo $COLOR1 | awk '{ print $2 }'` ch2=`echo $COLOR1 | awk '{ print $3 }'` ch3=`echo $COLOR1 | awk '{ print $4 }'` color1ofile=`echo $COLOR1 | awk '{ print $5 }'` color1pngfile=`basename $color1ofile .jpg`.png color1vfile=" " if [ -d "color.results-envi" ] # make vis RGB envi file then color1vfile=`basename $color1ofile .jpg` color1vfile="color.results-envi/${longcubeid}_$color1vfile" fi echo "davinci.make.rgb.image.from.cube $cube $scalefactor2 $ch1 $ch2 $ch3 base-image/$color1ofile base-image/$color1pngfile $color1vfile" echo "davinci.make.rgb.image.from.cube $cube $scalefactor2 $ch1 $ch2 $ch3 base-image/$color1ofile base-image/$color1pngfile $color1vfile" >> AAA.info/CMDS-executed davinci.make.rgb.image.from.cube $cube $scalefactor2 $ch1 $ch2 $ch3 base-image/$color1ofile base-image/$color1pngfile $color1vfile ls -l base-image/$color1ofile else echo "NOT FOUND: COLOR1: $COLOR1" fi echo " " COLOR2=`grep COLOR2 $basefile` if [ -n "$COLOR2" ] then echo "making COLOR2: $COLOR2" ch1=`echo $COLOR2 | awk '{ print $2 }'` ch2=`echo $COLOR2 | awk '{ print $3 }'` ch3=`echo $COLOR2 | awk '{ print $4 }'` color2ofile=`echo $COLOR2 | awk '{ print $5 }'` color2pngfile=`basename $color2ofile .jpg`.png echo "davinci.make.rgb.image.from.cube $cube $scalefactor2 $ch1 $ch2 $ch3 base-image/$color2ofile base-image/$color2pngfile" echo "davinci.make.rgb.image.from.cube $cube $scalefactor2 $ch1 $ch2 $ch3 base-image/$color2ofile base-image/$color2pngfile" >> AAA.info/CMDS-executed davinci.make.rgb.image.from.cube $cube $scalefactor2 $ch1 $ch2 $ch3 base-image/$color2ofile base-image/$color2pngfile ls -l base-image/$color2ofile else echo "NOT FOUND: COLOR2: $COLOR2" fi fi echo " " >> AAA.info/CMDS-executed echo " " echo "##############################################" `date` echo " " echo " " echo "#############################################" echo " " echo "making color results" `date` echo " " echo "./cmds.color.support/make.color.results.all $longcubeid" echo "./cmds.color.support/make.color.results.all $longcubeid" >> AAA.info/CMDS-executed ./cmds.color.support/make.color.results.all $longcubeid echo " " echo "#############################################" echo " " echo "making color results overlayed on grey scale image" `date` echo " " echo "./cmds.color.support/cmd.make.colormap-overlay-on-bw-all" `date` echo "./cmds.color.support/cmd.make.colormap-overlay-on-bw-all" `date` >> AAA.info/CMDS-executed ./cmds.color.support/cmd.make.colormap-overlay-on-bw-all if [ -f "base-image/color-visRGB.jpg" ] then cp -a base-image/color-visRGB.jpg color.results+labels-jpegs/${longcubeid}_color-visRGB.jpg fi if [ -f "base-image/color-visRGB.png" ] then cp -a base-image/color-visRGB.png color.results+labels/${longcubeid}_color-visRGB.png fi ############################################### # geology: make geologic classification images echo " " >> AAA.info/CMDS-executed if [ -f "geologic-origins/geologic_origins_cube.v" ] then echo " " echo "geologic-origins/geologic_origins_cube.v cube found" if [ -f "cmds.geology/cmd.make-all.geologic.classification.images" ] then echo " " echo "./cmds.geology/cmd.make-all.geologic.classification.images $longcubeid" echo "./cmds.geology/cmd.make-all.geologic.classification.images $longcubeid" >> AAA.info/CMDS-executed ./cmds.geology/cmd.make-all.geologic.classification.images $longcubeid fi if [ -f "cmds.geology/cmd.make-all.geologic.mineral.group.images" ] then echo " " echo "./cmds.geology/cmd.make-all.geologic.mineral.group.images $longcubeid" echo "./cmds.geology/cmd.make-all.geologic.mineral.group.images $longcubeid" >> AAA.info/CMDS-executed ./cmds.geology/cmd.make-all.geologic.mineral.group.images $longcubeid fi else echo " " echo "geologic-origins/geologic_origins_cube.v cube NOT FOUND, skipping deologic origins calculations" fi ############################ echo " " >> AAA.info/CMDS-executed echo " " echo "##############################################" `date` echo " " echo "##############################################" `date` >> AAA.info/CMDS-executed echo " " >> AAA.info/CMDS-executed noredoverlayimages=`grep noredoverlayimages AAA.info/CMDS-flags` if [ -z "$noredoverlayimages" ] then echo "Generating gamma stretched jpeg results on gray background images" `date` echo "./cmds.all.support/gen.fd.jpg.overlay+base.images $cube $aband $imageout" echo " " echo "./cmds.all.support/gen.fd.jpg.overlay+base.images $cube $aband $imageout" >> AAA.info/CMDS-executed ./cmds.all.support/gen.fd.jpg.overlay+base.images $cube $aband $imageout fi if [ "$makdual" = 1 ] then nodualimages=`grep nodualimages AAA.info/CMDS-flags` if [ -z "$nodualimages" ] then echo " " echo "##############################################" echo " " echo "Generating gamma stretched dual jpeg results on gray background + results on black images" `date` echo "./cmds.all.support/gen.fd.jpg.overlay+base-dual.images $cube $aband $imageout" echo "./cmds.all.support/gen.fd.jpg.overlay+base-dual.images $cube $aband $imageout" >> AAA.info/CMDS-executed ./cmds.all.support/gen.fd.jpg.overlay+base-dual.images $cube $aband $imageout fi fi else echo "ERROR: cannot find image cube: $cube" echo " skipping jpeg results generation" echo " exit 1" exit 1 fi if [ "$makdual" = 1 ] then echo "making notzero directories and copy notzero jpeg results there" `date` echo "./cmds.all.support/gen.fd.jpg.overlay+base-dual.images-notzero $imageout" echo "./cmds.all.support/gen.fd.jpg.overlay+base-dual.images-notzero $imageout" >> AAA.info/CMDS-executed echo " " ./cmds.all.support/gen.fd.jpg.overlay+base-dual.images-notzero $imageout fi echo " " echo "#############################################" `date` echo " " echo "computing masses " `date` echo "./cmds.abundances/cmd.compute.abundances" echo "./cmds.abundances/cmd.compute.abundances" >> AAA.info/CMDS-executed ./cmds.abundances/cmd.compute.abundances echo " " echo "#############################################" echo " " echo "cmd.runtet complete: " `date` elif [ "$tetmode" = "singlespectrum" ] then echo "starting tetracorder in singlespectrum mode" echo "$pt r1" $pt r1 <