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