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