root / examples / Test / Dep_tscan_m @ 12
Historique | Voir | Annoter | Télécharger (2,32 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}_m.gplot |
16 |
yr="[-0.50:-0.42]" |
17 |
|
18 |
if [ ! -s list ]; then |
19 |
echo "File list is missing" |
20 |
exit |
21 |
fi |
22 |
|
23 |
if [ -s ${Nom}_cart.0 ]; then |
24 |
Ext=_cart |
25 |
elif [ -s ${Nom}.0 ]; then |
26 |
Ext="" |
27 |
else |
28 |
echo "Cannot find ${Nom}.0 nor ${Nom}_cart.0 -- ERROR" |
29 |
exit |
30 |
fi |
31 |
|
32 |
awk -f $WDir/Dep_tgt.awk $Fout |
33 |
cat <<EOF > $NomGplot |
34 |
#!/usr/bin/gnuplot -persist |
35 |
set pointsize 2 |
36 |
unset key |
37 |
EOF |
38 |
|
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 |
|
45 |
if [ "$Ext" = "" ]; then |
46 |
# We are analysing a calculation done in cartesian. |
47 |
# We have to analyse the spline file and maybe also the tangent file. |
48 |
if [ -s ${Nom}_spline.${i} ]; then |
49 |
xyz2scan ${Nom}_spline.${i} > /dev/null |
50 |
mv Scan.dat ${Nom}_spline_${i}.dat |
51 |
fi |
52 |
if [ -s ${Nom}_dbgtgt.${i} ]; then |
53 |
xyz2scan ${Nom}_dbgtgt.${i} > /dev/null |
54 |
mv Scan.dat ${Nom}_dbgtgt_${i}.dat |
55 |
fi |
56 |
fi |
57 |
|
58 |
cat <<EOF >> $NomGplot |
59 |
set multiplot |
60 |
set origin 0.,0. |
61 |
set size 0.5,1. |
62 |
clear |
63 |
set xrange [1.:2.5] |
64 |
set yrange [-10:190] |
65 |
plot "HCN_irc.dat" u 1:3 w l ls 1 |
66 |
EOF |
67 |
if [ "$PES" != "" ]; then |
68 |
cat <<EOF >> $NomGplot |
69 |
replot "HCN_PES_2D.dat" u 1:2 t "" w l ls 2, \ |
70 |
"HCN_PES_2D.dat" u 1:(-\$2) t "" w l ls 2,\ |
71 |
"HCN_PES_2D.dat" u 1:(360-\$2) t "" w l ls 2 |
72 |
EOF |
73 |
fi |
74 |
if [ -s ${Nom}_spline.${i} ]; then |
75 |
echo "replot \"${Nom}_${i}.dat\" u 1:3 w p ls 5" >> $NomGplot |
76 |
echo "replot \"${Nom}_spline.${i}\" u 2:4 w l ls 5" >> $NomGplot |
77 |
elif [ -s ${Nom}_dbgtgt_${i}.dat ]; then |
78 |
echo "replot \"${Nom}_${i}.dat\" u 1:3 w lp 5" >> $NomGplot |
79 |
echo "replot \"${Nom}_dbgtgt_${i}.dat\" u 2:(\$4*180./pi) w l ls 4" >> $NomGplot |
80 |
else |
81 |
echo "replot \"${Nom}_${i}.dat\" u 1:3 w lp ls 5" >> $NomGplot |
82 |
fi |
83 |
if [ "$Tgt" != "" ]; then |
84 |
echo "replot \"${Nom}_tgt_${i}.dat\" u 1:3 w l ls 4" >> $NomGplot |
85 |
fi |
86 |
cat <<EOF >> $NomGplot |
87 |
set origin .505,0. |
88 |
# set size 0.5,1. |
89 |
clear |
90 |
set yrange $yr |
91 |
set xrange [-5:185] |
92 |
plot "HCN_irc.dat" u 3:4 t "IRC" w l ls 1 |
93 |
EOF |
94 |
echo "plot \"${Nom}_${i}.dat\" u 3:4 t \"E\" w lp ls 5" >> $NomGplot |
95 |
echo "unset multiplot" >> $NomGplot |
96 |
echo "pause -1" >> $NomGplot |
97 |
done |
98 |
|
99 |
chmod u+x ./$NomGplot |
100 |
echo "./$NomGplot to see the path" |
101 |
|
102 |
|