Statistiques
| Révision :

root / examples / Test / Dep_tscan_movie

Historique | Voir | Annoter | Télécharger (2,63 ko)

1 1 pfleura2
#!/bin/bash
2 1 pfleura2
export LANG=C
3 1 pfleura2
if [ $# -lt 1 ]; then
4 1 pfleura2
 echo "Use: $0 File.out  [PES] [T]"
5 1 pfleura2
 exit
6 1 pfleura2
fi
7 1 pfleura2
8 1 pfleura2
WDir=`dirname $0`
9 1 pfleura2
10 1 pfleura2
Fout=$1
11 1 pfleura2
ItMax=`grep MAXCYC $Fout | tail -1 | awk '{print $3}'`
12 1 pfleura2
let ItMax=ItMax-1
13 1 pfleura2
Nom=`grep PATHNAME $Fout | tail -1 | awk '{print $3}'`
14 1 pfleura2
PES=$2
15 1 pfleura2
Tgt=$3
16 1 pfleura2
17 1 pfleura2
NGplot=${Nom}_movie.gplot
18 1 pfleura2
19 1 pfleura2
# For gif files (that may be joined into an mpeg)
20 1 pfleura2
Term=gif
21 1 pfleura2
Ext=gif
22 1 pfleura2
# For postscript eps files
23 1 pfleura2
#Term="postscript eps enhanced color solid"
24 1 pfleura2
#Ext=eps
25 1 pfleura2
# DefTerm is the default terminal (=screen)
26 1 pfleura2
# wxt is better for Linux, but x11 is more general
27 1 pfleura2
DefTerm=x11
28 1 pfleura2
if [ ! -s list ]; then
29 1 pfleura2
 echo "File list is missing"
30 1 pfleura2
 exit
31 1 pfleura2
fi
32 1 pfleura2
33 1 pfleura2
34 1 pfleura2
if [ -s ${Nom}_cart.0 ]; then
35 1 pfleura2
 ExtF=_cart
36 1 pfleura2
elif [ -s ${Nom}.0 ]; then
37 1 pfleura2
 ExtF=""
38 1 pfleura2
else
39 1 pfleura2
 echo "Cannot find ${Nom}.0 nor ${Nom}_cart.0 -- ERROR"
40 1 pfleura2
 exit
41 1 pfleura2
fi
42 1 pfleura2
43 1 pfleura2
44 1 pfleura2
awk -f $WDir/Dep_tgt.awk $Fout
45 1 pfleura2
cat <<EOF > $NGplot
46 1 pfleura2
#!/usr/bin/gnuplot
47 1 pfleura2
 set xrange [1.:2.25]
48 1 pfleura2
 set yrange [-10:190]
49 1 pfleura2
 set pointsize 2
50 1 pfleura2
 set style line 1 linetype 3 pointtype 3 linewidth 3
51 1 pfleura2
 unset key
52 1 pfleura2
 set term $DefTerm
53 1 pfleura2
EOF
54 11 pfleura2
let ItM=ItMax-2
55 1 pfleura2
for i in `seq 0 $ItM`
56 1 pfleura2
  do
57 1 pfleura2
 xyz2scan ${Nom}${ExtF}.${i} > /dev/null
58 1 pfleura2
 mv Scan.dat ${Nom}_${i}.dat
59 11 pfleura2
 echo "plot \"HCN_irc.dat\" u 1:3 w l ls 1" >> ${NGplot}
60 1 pfleura2
 if [ "$PES" != "" ]; then
61 11 pfleura2
  echo "replot \"HCN_PES_2D.dat\" u 1:2 w l ls 2, \"HCN_PES_2D.dat\" u 1:(-\$2) w l ls 2,\"HCN_PES_2D.dat\" u 1:(360-\$2) w l ls 2" >> ${NGplot}
62 1 pfleura2
 fi
63 1 pfleura2
 if [ -s ${Nom}_spline.${i} ]; then
64 11 pfleura2
 echo "replot \"${Nom}_${i}.dat\" u 1:3 w p ls 5" >> ${NGplot}
65 11 pfleura2
 echo "replot \"${Nom}_spline.${i}\" u 2:4 w l ls 5" >> ${NGplot}
66 1 pfleura2
 elif [  -s ${Nom}_dbgtgt_${i}.dat ]; then
67 11 pfleura2
 echo "replot \"${Nom}_${i}.dat\" u 1:3 w lp ls 5" >> ${NGplot}
68 11 pfleura2
 echo "replot \"${Nom}_dbgtgt_${i}.dat\" u 2:(\$4*180./pi) w l ls 4" >> ${NGplot}
69 1 pfleura2
 else
70 11 pfleura2
 echo "replot \"${Nom}_${i}.dat\" u 1:3 w lp ls 5" >> ${NGplot}
71 1 pfleura2
fi
72 1 pfleura2
 if [ "$Tgt" != "" ]; then
73 11 pfleura2
  echo "replot \"${Nom}_tgt_${i}.dat\" u 1:3 w l ls 4" >> ${NGplot}
74 1 pfleura2
 fi
75 1 pfleura2
 IMov=`echo $i | awk '{ It="000" $1; l=length(It); print substr(It,l-2,3)}' `
76 1 pfleura2
 cat <<EOF >> ${NGplot}
77 1 pfleura2
 pause 0.5
78 1 pfleura2
 set term $Term
79 1 pfleura2
 set output "${Nom}_${IMov}.$Ext"
80 1 pfleura2
 replot
81 1 pfleura2
 unset output
82 1 pfleura2
 set term $DefTerm
83 1 pfleura2
EOF
84 1 pfleura2
 done
85 11 pfleura2
let i=ItMax-1
86 1 pfleura2
 awk -f $WDir/Path2dat.awk  ${Nom}.${i} > ${Nom}_${i}.dat
87 11 pfleura2
 echo "plot \"HCN_irc.dat\" u 1:3 w l ls 1" >> ${NGplot}
88 1 pfleura2
 if [ "$PES" != "" ]; then
89 11 pfleura2
  echo "replot \"HCN_PES_2D.dat\" u 1:2 w l ls 2, \"HCN_PES_2D.dat\" u 1:(-\$2) w l ls 2,\"HCN_PES_2D.dat\" u 1:(360-\$2) w l ls 2" >> ${NGplot}
90 1 pfleura2
 fi
91 1 pfleura2
 echo "replot \"${Nom}_${i}.dat\" u 1:3 w lp ls 1" >> ${NGplot}
92 1 pfleura2
 IMov=`echo $i | awk '{ It="000" $1; l=length(It); print substr(It,l-2,3)}' `
93 1 pfleura2
 cat <<EOF >> ${NGplot}
94 1 pfleura2
 set term $Term
95 1 pfleura2
 set output "${Nom}_${IMov}.$Ext"
96 1 pfleura2
 replot
97 1 pfleura2
 unset output
98 1 pfleura2
 set term $DefTerm
99 1 pfleura2
EOF
100 1 pfleura2
101 1 pfleura2
echo "./${NGplot}      to see the path"
102 1 pfleura2
chmod u+x ./${NGplot}