1 #!/bin/bash
  2 # --verbose  print as lines are read
  3 
  4 # $Revision: 1.13 $  $Author: schwehr $  $Date: 2004/11/03 00:28:10 $
  5 
  6 ##############################################################################
  7 #     Copyright (C) 2004  Kurt Schwehr
  8 #
  9 #      This program is free software; you can redistribute it and/or modify
 10 #      it under the terms of the GNU General Public License as published by
 11 #      the Free Software Foundation; either version 2 of the License, or
 12 #      (at your option) any later version.
 13 #
 14 #      This program is distributed in the hope that it will be useful,
 15 #      but WITHOUT ANY WARRANTY; without even the implied warranty of
 16 #      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 17 #      GNU General Public License for more details.
 18 #
 19 #      You should have received a copy of the GNU General Public License
 20 #      along with this program; if not, write to the Free Software
 21 #      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 22 ###############################################################################
 23 
 24 # Test out all the functionality with just one point to make sure
 25 # everything lines up.
 26 
 27 ######################################################################
 28 # Debugging
 29 ######################################################################
 30 
 31 . debug.bash
 32 
 33 ######################################################################
 34 # Local tuning
 35 ######################################################################
 36 
 37 export PATH=${PATH}:.
 38 cells=50
 39 if [ -z "$DENSITY_DRAW" ]; then
 40     # Keep a low number so debugging goes quickly
 41     declare -ir draw=25000
 42 else
 43     declare -ir draw=$DENSITY_DRAW
 44 fi
 45 DebugEcho $TRACE $LINENO "draw = $draw"
 46 declare -r w=0.5
 47 declare -r boundaries="-x -${w} -X ${w} -y -${w} -Y ${w} -z -${w} -Z ${w}"
 48 #declare -r debugLevel=2
 49 
 50 if [ -e Makefile ]; then
 51     make targets-no-test
 52 fi
 53 
 54 if [ ! -e one.s ]; then
 55     if [ ! -e as2-slump.s ]; then 
 56 	echo "ERROR: as2-slump.s does not exist"
 57 	exit $EXIT_FAILURE
 58     fi
 59     head -1 as2-slump.s > one.s
 60 fi
 61 
 62 echo Processing one.s
 63 #if [ ! -e one-boot.xyz ]; then 
 64     # SITE parametric just for demo purposes
 65     s_bootstrap one.s -f xyz  -n 1 --out one-boot.xyz -p --draw ${draw}
 66     s_bootstrap one.s -f xyz  -n 3 --out one.xyz. -p --draw ${draw}
 67     mv one.xyz.1.vmax one-boot.xyz.vmax
 68     mv one.xyz.2.vint one-boot.xyz.vint
 69     mv one.xyz.3.vmin one-boot.xyz.vmin
 70 #fi
 71 
 72 echo Densifying
 73 args=" --bpv=16 -w ${cells} -t ${cells} -d ${cells} --verbosity=$debugLevel"
 74 
 75 #if [ ! -e one-all.vol ]; then
 76     xyzdensity one-boot.xyz.vmax --out=one-vmax.vol -p 1 $args $boundaries
 77     xyzdensity one-boot.xyz.vint --out=one-vint.vol -p 1 $args $boundaries
 78     xyzdensity one-boot.xyz.vmin --out=one-vmin.vol -p 1 $args $boundaries
 79 
 80     xyzdensity --out=one-all.vol -p 1 -b 8 -w ${cells} -t ${cells} -d ${cells} $boundaries \
 81 	one-boot.xyz.vmax \
 82 	one-boot.xyz.vint \
 83 	one-boot.xyz.vmin 
 84 #fi
 85 
 86 #if [ ! -e one.cmap ]; then
 87     volmakecmap --cpt=rgba.cpt -o one.cmap --zero=0 -v $debugLevel
 88 #fi
 89 
 90 # Make the bounding box at 1.05 to be just outside of the volume
 91 # --box=1.05
 92 vol_iv -c ALPHA_BLENDING --numslicescontrol=ALL -p NONE -C one.cmap -o one-all.iv one-all.vol
 93 
 94 scale="--xscale=0.5 --yscale=0.5 --zscale=0.5"
 95 volhdr_edit one-vmax.vol --out=tmp.vol $scale && /bin/mv tmp.vol one-vmax.vol
 96 volhdr_edit one-vint.vol --out=tmp.vol $scale && /bin/mv tmp.vol one-vint.vol
 97 volhdr_edit one-vmin.vol --out=tmp.vol $scale && /bin/mv tmp.vol one-vmin.vol
 98 volhdr_edit one-all.vol  --out=tmp.vol $scale && /bin/mv tmp.vol one-all.vol
 99 
100 
101 s_eigs < one.s > one.eigs
102 eigs2xyz.py one.eigs > one.xyz
103 awk '{print $1,$2,$3}' one.xyz > one.xyz.vmin
104 awk '{print $4,$5,$6}' one.xyz > one.xyz.vint
105 awk '{print $7,$8,$9}' one.xyz > one.xyz.vmax
106 
107 #box="--box=0.005"
108 box="--box=0.015"
109 xyz_iv $box -p --color="1 0 0" --out=one.xyz.vmin.iv -v 3 one.xyz.vmin
110 xyz_iv $box -p --color="1 1 0" --out=one.xyz.vint.iv -v 3 one.xyz.vint
111 xyz_iv $box -p --color="0 0 1" --out=one.xyz.vmax.iv -v 3 one.xyz.vmax
112 
113 #debugLevel=1
114 echo "TYPE  VOL_FILE     XYZ_FILE     x         y           z     counts FracTotal FracCDF"
115 echo "------------------------------------------------------------------------------------"
116 echo -n "VMIN: " && xyzvol_cmp -v $debugLevel -d one-vmin.vol one.xyz.vmin --out=-
117 echo -n "VINT: " && xyzvol_cmp -v $debugLevel -d one-vint.vol one.xyz.vint --out=-
118 echo -n "VMAX: " && xyzvol_cmp -v $debugLevel -d one-vmax.vol one.xyz.vmax --out=-


syntax highlighted by Code2HTML, v. 0.9.1