root / examples / Test / Dep_tscan_p
Historique | Voir | Annoter | Télécharger (3,4 ko)
| 1 |
#!/bin/bash |
|---|---|
| 2 |
export LANG=C |
| 3 |
if [ $# -lt 1 ]; then |
| 4 |
echo "Use: $0 File.out [PES] [T]" |
| 5 |
exit |
| 6 |
fi |
| 7 |
Fout=$1 |
| 8 |
ItMax=`grep MAXCYC $Fout | tail -1 | awk '{print $3}'`
|
| 9 |
Nom=`grep PATHNAME $Fout | tail -1 | awk '{print $3}'`
|
| 10 |
PES=$2 |
| 11 |
Tgt=$3 |
| 12 |
|
| 13 |
WDir=`dirname $0` |
| 14 |
|
| 15 |
NomGplot=${Nom}_p.gplot
|
| 16 |
|
| 17 |
if [ ! -s list ]; then |
| 18 |
echo "File list is missing" |
| 19 |
exit |
| 20 |
fi |
| 21 |
|
| 22 |
if [ -s ${Nom}_cart.0 ]; then
|
| 23 |
Ext=_cart |
| 24 |
elif [ -s ${Nom}.0 ]; then
|
| 25 |
Ext="" |
| 26 |
else |
| 27 |
echo "Cannot find ${Nom}.0 nor ${Nom}_cart.0 -- ERROR"
|
| 28 |
exit |
| 29 |
fi |
| 30 |
|
| 31 |
awk -f $WDir/Dep_tgt.awk $Fout |
| 32 |
cat <<EOF > $NomGplot |
| 33 |
#!/usr/bin/gnuplot -persist |
| 34 |
set pointsize 2 |
| 35 |
set origin 0.,0. |
| 36 |
set size square 1 |
| 37 |
EOF |
| 38 |
let ItM=ItMax-2 |
| 39 |
for i in `seq 0 $ItM` |
| 40 |
do |
| 41 |
xyz2scan ${Nom}${Ext}.${i} > /dev/null
|
| 42 |
mv Scan.dat ${Nom}_${i}.dat
|
| 43 |
if [ "$Ext" = "" ]; then |
| 44 |
# We are analysing a calculation done in cartesian. |
| 45 |
# We have to analyse the spline file and maybe also the tangent file. |
| 46 |
if [ -s ${Nom}_spline.${i} ]; then
|
| 47 |
xyz2scan ${Nom}_spline.${i} > /dev/null
|
| 48 |
mv Scan.dat ${Nom}_spline_${i}.dat
|
| 49 |
fi |
| 50 |
if [ -s ${Nom}_dbgtgt.${i} ]; then
|
| 51 |
xyz2scan ${Nom}_dbgtgt.${i} > /dev/null
|
| 52 |
mv Scan.dat ${Nom}_dbgtgt_${i}.dat
|
| 53 |
fi |
| 54 |
fi |
| 55 |
|
| 56 |
cat <<EOF >> $NomGplot |
| 57 |
clear |
| 58 |
set xrange [1.:2.5] |
| 59 |
set yrange [-10:190] |
| 60 |
plot "HCN_irc.dat" u 1:3 t "IRC" w l ls 1 |
| 61 |
EOF |
| 62 |
if [ "$PES" != "" ]; then |
| 63 |
echo "replot \"HCN_PES_2D.dat\" u 1:2 t \"\" w l ls 2, \"HCN_PES_2D.dat\" u 1:(-\$2) t \"\" w l ls 2,\"HCN_PES_2D.dat\" u 1:(360-\$2) t \"\" w l ls 2" >> $NomGplot |
| 64 |
fi |
| 65 |
if [ "$Ext" = "_cart" ]; then |
| 66 |
if [ -s ${Nom}_spline.${i} ]; then
|
| 67 |
echo "replot \"${Nom}_${i}.dat\" u 1:3 w p ls 5" >> $NomGplot
|
| 68 |
echo "replot \"${Nom}_spline.${i}\" u 2:4 t \"Spline\" w l ls 5" >> $NomGplot
|
| 69 |
elif [ -s ${Nom}_dbgtgt.${i} ]; then
|
| 70 |
echo "replot \"${Nom}_${i}.dat\" u 1:3 w lp ls 5" >> $NomGplot
|
| 71 |
echo "replot \"${Nom}_dbgtgt.${i}\" u 2:(\$4*180./pi) t \"Tangents\" w l ls 4" >> $NomGplot
|
| 72 |
else |
| 73 |
echo "replot \"${Nom}_${i}.dat\" u 1:3 w lp ls 5" >> $NomGplot
|
| 74 |
fi |
| 75 |
else |
| 76 |
if [ -s ${Nom}_spline_${i}.dat ]; then
|
| 77 |
echo "replot \"${Nom}_${i}.dat\" u 1:3 w p ls 5" >> $NomGplot
|
| 78 |
echo "replot \"${Nom}_spline_${i}.dat\" u 1:3 w lp ls 5" >> $NomGplot
|
| 79 |
elif [ -s ${Nom}_dbgtgt_${i}.dat ]; then
|
| 80 |
echo "replot \"${Nom}_${i}.dat\" u 1:3 w lp ls 5" >> $NomGplot
|
| 81 |
echo "replot \"${Nom}_dbgtgt_${i}.dat\" u 1:3 w l ls 4" >> $NomGplot
|
| 82 |
else |
| 83 |
echo "replot \"${Nom}_${i}.dat\" u 1:3 w lp ls 5" >> $NomGplot
|
| 84 |
fi |
| 85 |
fi |
| 86 |
if [ "$Tgt" != "" ]; then |
| 87 |
echo "replot \"${Nom}_tgt_${i}.dat\" u 1:3 w l ls 1" >> $NomGplot
|
| 88 |
fi |
| 89 |
echo "pause -1" >> $NomGplot |
| 90 |
done |
| 91 |
let i=ItMax-1 |
| 92 |
xyz2scan ${Nom}${Ext}.${i} > /dev/null
|
| 93 |
mv Scan.dat ${Nom}_${i}.dat
|
| 94 |
cat <<EOF >> $NomGplot |
| 95 |
clear |
| 96 |
set xrange [1.:2.5] |
| 97 |
set yrange [-10:190] |
| 98 |
plot "HCN_irc.dat" u 1:3 t " IRC" w l ls 1 |
| 99 |
EOF |
| 100 |
if [ "$PES" != "" ]; then |
| 101 |
echo "replot \"HCN_PES_2D.dat\" u 1:2 t \"\" w l ls 2, \"HCN_PES_2D.dat\" u 1:(-\$2) t \"\" w l ls 2,\"HCN_PES_2D.dat\" u 1:(360-\$2) t \"\" w l ls 2" >> $NomGplot |
| 102 |
fi |
| 103 |
if [ -s ${Nom}_spline.${i} ]; then
|
| 104 |
echo "replot \"${Nom}_${i}.dat\" u 1:3 w p ls 5" >> $NomGplot
|
| 105 |
echo "replot \"${Nom}_spline.${i}\" u 2:4 w l ls 5" >> $NomGplot
|
| 106 |
elif [ -s ${Nom}_dbgtgt_${i}.dat ]; then
|
| 107 |
echo "replot \"${Nom}_${i}.dat\" u 1:3 w lp ls 5" >> $NomGplot
|
| 108 |
echo "replot \"${Nom}_dbgtgt_${i}.dat\" u 2:(\$4*180./pi) w l ls 4" >> $NomGplot
|
| 109 |
else |
| 110 |
echo "replot \"${Nom}_${i}.dat\" u 1:3 w lp ls 5" >> $NomGplot
|
| 111 |
fi |
| 112 |
echo "pause -1" >> $NomGplot |
| 113 |
chmod u+x $NomGplot |
| 114 |
|
| 115 |
echo "./$NomGplot to see the path" |