Statistics
| Revision:

root / examples / Test / Dep_tscan_movie @ 11

History | View | Annotate | Download (2.6 kB)

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

    
8
WDir=`dirname $0`
9

    
10
Fout=$1
11
ItMax=`grep MAXCYC $Fout | tail -1 | awk '{print $3}'`
12
let ItMax=ItMax-1
13
Nom=`grep PATHNAME $Fout | tail -1 | awk '{print $3}'`
14
PES=$2
15
Tgt=$3
16

    
17
NGplot=${Nom}_movie.gplot
18

    
19
# For gif files (that may be joined into an mpeg)
20
Term=gif
21
Ext=gif
22
# For postscript eps files
23
#Term="postscript eps enhanced color solid"
24
#Ext=eps
25
# DefTerm is the default terminal (=screen)
26
# wxt is better for Linux, but x11 is more general
27
DefTerm=x11
28
if [ ! -s list ]; then
29
 echo "File list is missing"
30
 exit
31
fi
32

    
33

    
34
if [ -s ${Nom}_cart.0 ]; then
35
 ExtF=_cart
36
elif [ -s ${Nom}.0 ]; then
37
 ExtF=""
38
else
39
 echo "Cannot find ${Nom}.0 nor ${Nom}_cart.0 -- ERROR"
40
 exit
41
fi
42

    
43

    
44
awk -f $WDir/Dep_tgt.awk $Fout 
45
cat <<EOF > $NGplot
46
#!/usr/bin/gnuplot 
47
 set xrange [1.:2.25]
48
 set yrange [-10:190]
49
 set pointsize 2
50
 set style line 1 linetype 3 pointtype 3 linewidth 3
51
 unset key
52
 set term $DefTerm
53
EOF
54
let ItM=ItMax-2
55
for i in `seq 0 $ItM`
56
  do
57
 xyz2scan ${Nom}${ExtF}.${i} > /dev/null
58
 mv Scan.dat ${Nom}_${i}.dat
59
 echo "plot \"HCN_irc.dat\" u 1:3 w l ls 1" >> ${NGplot}
60
 if [ "$PES" != "" ]; then
61
  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
 fi
63
 if [ -s ${Nom}_spline.${i} ]; then
64
 echo "replot \"${Nom}_${i}.dat\" u 1:3 w p ls 5" >> ${NGplot}
65
 echo "replot \"${Nom}_spline.${i}\" u 2:4 w l ls 5" >> ${NGplot}
66
 elif [  -s ${Nom}_dbgtgt_${i}.dat ]; then
67
 echo "replot \"${Nom}_${i}.dat\" u 1:3 w lp ls 5" >> ${NGplot}
68
 echo "replot \"${Nom}_dbgtgt_${i}.dat\" u 2:(\$4*180./pi) w l ls 4" >> ${NGplot}
69
 else
70
 echo "replot \"${Nom}_${i}.dat\" u 1:3 w lp ls 5" >> ${NGplot}
71
fi
72
 if [ "$Tgt" != "" ]; then
73
  echo "replot \"${Nom}_tgt_${i}.dat\" u 1:3 w l ls 4" >> ${NGplot}
74
 fi
75
 IMov=`echo $i | awk '{ It="000" $1; l=length(It); print substr(It,l-2,3)}' `
76
 cat <<EOF >> ${NGplot}
77
 pause 0.5
78
 set term $Term
79
 set output "${Nom}_${IMov}.$Ext"
80
 replot
81
 unset output
82
 set term $DefTerm
83
EOF
84
 done
85
let i=ItMax-1
86
 awk -f $WDir/Path2dat.awk  ${Nom}.${i} > ${Nom}_${i}.dat
87
 echo "plot \"HCN_irc.dat\" u 1:3 w l ls 1" >> ${NGplot}
88
 if [ "$PES" != "" ]; then
89
  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
 fi
91
 echo "replot \"${Nom}_${i}.dat\" u 1:3 w lp ls 1" >> ${NGplot}
92
 IMov=`echo $i | awk '{ It="000" $1; l=length(It); print substr(It,l-2,3)}' `
93
 cat <<EOF >> ${NGplot}
94
 set term $Term
95
 set output "${Nom}_${IMov}.$Ext"
96
 replot
97
 unset output
98
 set term $DefTerm
99
EOF
100

    
101
echo "./${NGplot}      to see the path"
102
chmod u+x ./${NGplot}