root / examples / Test / Dep_tscan_p @ 1
Historique | Voir | Annoter | Télécharger (3,23 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 |
|
16 |
NomGplot=${Nom}_p.gplot |
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 term x11 |
35 |
set pointsize 2 |
36 |
set origin 0.,0. |
37 |
set size square 1 |
38 |
EOF |
39 |
let ItM=ItMax-1 |
40 |
for i in `seq 0 $ItM` |
41 |
do |
42 |
xyz2scan ${Nom}${Ext}.${i} > /dev/null |
43 |
mv Scan.dat ${Nom}_${i}.dat |
44 |
if [ "$Ext" = "" ]; then |
45 |
# We are analysing a calculation done in cartesian. |
46 |
# We have to analyse the spline file and maybe also the tangent file. |
47 |
if [ -s ${Nom}_spline.${i} ]; then |
48 |
xyz2scan ${Nom}_spline.${i} > /dev/null |
49 |
mv Scan.dat ${Nom}_spline_${i}.dat |
50 |
fi |
51 |
if [ -s ${Nom}_dbgtgt.${i} ]; then |
52 |
xyz2scan ${Nom}_dbgtgt.${i} > /dev/null |
53 |
mv Scan.dat ${Nom}_dbgtgt_${i}.dat |
54 |
fi |
55 |
fi |
56 |
|
57 |
cat <<EOF >> $NomGplot |
58 |
clear |
59 |
set xrange [1.:2.5] |
60 |
set yrange [-10:190] |
61 |
plot "HCN_irc.dat" u 1:3 w l |
62 |
EOF |
63 |
if [ "$PES" != "" ]; then |
64 |
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 |
65 |
fi |
66 |
if [ "$Ext" = "_cart" ]; then |
67 |
if [ -s ${Nom}_spline.${i} ]; then |
68 |
echo "replot \"${Nom}_${i}.dat\" u 1:3 w p 5" >> $NomGplot |
69 |
echo "replot \"${Nom}_spline.${i}\" u 2:4 w l" >> $NomGplot |
70 |
elif [ -s ${Nom}_dbgtgt.${i} ]; then |
71 |
echo "replot \"${Nom}_${i}.dat\" u 1:3 w p 5" >> $NomGplot |
72 |
echo "replot \"${Nom}_dbgtgt.${i}\" u 2:(\$4*180./pi) w l" >> $NomGplot |
73 |
else |
74 |
echo "replot \"${Nom}_${i}.dat\" u 1:3 w lp 5" >> $NomGplot |
75 |
fi |
76 |
else |
77 |
if [ -s ${Nom}_spline_${i}.dat ]; then |
78 |
echo "replot \"${Nom}_${i}.dat\" u 1:3 w p 5" >> $NomGplot |
79 |
echo "replot \"${Nom}_spline_${i}.dat\" u 1:3 w lp" >> $NomGplot |
80 |
elif [ -s ${Nom}_dbgtgt_${i}.dat ]; then |
81 |
echo "replot \"${Nom}_${i}.dat\" u 1:3 w p 5" >> $NomGplot |
82 |
echo "replot \"${Nom}_dbgtgt_${i}.dat\" u 1:3 w l" >> $NomGplot |
83 |
else |
84 |
echo "replot \"${Nom}_${i}.dat\" u 1:3 w lp 5" >> $NomGplot |
85 |
fi |
86 |
fi |
87 |
if [ "$Tgt" != "" ]; then |
88 |
echo "replot \"${Nom}_tgt_${i}.dat\" u 1:3 w l" >> $NomGplot |
89 |
fi |
90 |
echo "pause -1" >> $NomGplot |
91 |
done |
92 |
let i=ItMax |
93 |
xyz2scan ${Nom}${Ext}.${i} > /dev/null |
94 |
mv Scan.dat ${Nom}_${i}.dat |
95 |
cat <<EOF >> $NomGplot |
96 |
clear |
97 |
set xrange [1.:2.5] |
98 |
set yrange [-10:190] |
99 |
plot "HCN_irc.dat" u 1:3 w l |
100 |
EOF |
101 |
if [ "$PES" != "" ]; then |
102 |
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 |
103 |
fi |
104 |
if [ -s ${Nom}_spline.${i} ]; then |
105 |
echo "replot \"${Nom}_${i}.dat\" u 1:3 w p 5" >> $NomGplot |
106 |
echo "replot \"${Nom}_spline.${i}\" u 2:4 w l" >> $NomGplot |
107 |
elif [ -s ${Nom}_dbgtgt_${i}.dat ]; then |
108 |
echo "replot \"${Nom}_${i}.dat\" u 1:3 w p 5" >> $NomGplot |
109 |
echo "replot \"${Nom}_dbgtgt_${i}.dat\" u 2:(\$4*180./pi) w l" >> $NomGplot |
110 |
else |
111 |
echo "replot \"${Nom}_${i}.dat\" u 1:3 w lp 5" >> $NomGplot |
112 |
fi |
113 |
echo "pause -1" >> $NomGplot |
114 |
chmod u+x $NomGplot |
115 |
|
116 |
echo "./$NomGplot to see the path" |