Statistics
| Revision:

root / utils / AnaPathrel @ 3

History | View | Annotate | Download (1.7 kB)

1
#!/bin/bash
2
if [ $# -lt 4 ]; then
3
 echo "Use: $0 File.out MaxCyc PathName NGeomF"
4
 exit
5
fi
6

    
7
Fout=$1
8
ItMax=$2
9
Nom=$3
10
NGeomF=$4
11

    
12
export LANG=C
13

    
14
echo "#ItMax=$ItMax"
15
echo "#Nom=$Nom"
16
echo "#NGeomF"=$NGeomF
17

    
18
if [ -s ${Nom}_cart.0 ]; then
19
 Ext=_cart
20
elif [ -s ${Nom}.0 ]; then
21
 Ext=""
22
else
23
 echo "Cannot find ${Nom}.0 nor ${Nom}_cart.0: ERROR"
24
 exit
25
fi
26
 echo "Using files ${Nom}${Ext}.XX"
27

    
28
if [ -s $Nom.datl ]; then
29
 it=1
30
 while [ -s $Nom.datl_${it} ]
31
  do
32
 let it=it+1
33
 done
34
 echo "Moving $Nom.datl into $Nom.datl_${it}"
35
 mv $Nom.datl $Nom.datl_${it}
36
fi
37
echo "Creating $Nom.datl"
38

    
39
for i in `seq 0 $ItMax`
40
 do
41
  xyz2path  ${Nom}${Ext}.$i 
42
 cat Scan.dat >> $Nom.datl
43
 echo " " >> $Nom.datl
44
 echo " " >> $Nom.datl
45
done 
46

    
47
E0=`head -1 Scan.dat | awk '{print $NF}' `
48

    
49
cat << EOF > ${Nom}_l.gplot
50
#!/usr/bin/gnuplot -persist
51
 set pointsize 2
52
 Eref=$E0
53
 Conv=627.51
54
EOF
55

    
56
for i in `seq 1 $ItMax`
57
do
58
 echo "plot \"$Nom.datl\" i 0 u 1:(\$2-Eref)*Conv w lp " >> ${Nom}_l.gplot
59
 echo "replot \"$Nom.datl\" i $i u 1:(\$2-Eref)*Conv w lp " >> ${Nom}_l.gplot
60
 echo "pause -1" >> ${Nom}_l.gplot
61
done
62
 echo "pause -1" >> ${Nom}_l.gplot
63

    
64
cat << EOF > ${Nom}_l2.gplot
65
#!/usr/bin/gnuplot -persist
66
 set pointsize 2
67
 Eref=$E0
68
 Conv=627.51
69
EOF
70

    
71
 echo "plot \"$Nom.datl\" i 0 u 1:(\$2-Eref)*Conv w lp " >>  ${Nom}_l2.gplot
72
for i in `seq 1 $ItMax`
73
do
74
 echo "replot \"$Nom.datl\" i $i u 1:(\$2-Eref)*Conv w lp " >>  ${Nom}_l2.gplot
75
done
76

    
77
cat << EOF > ${Nom}_l3.gplot
78
#!/usr/bin/gnuplot -persist
79
 set pointsize 2
80
 Eref=$E0
81
 Conv=627.51
82
EOF
83

    
84
 echo "plot \"$Nom.datl\" i 0 u 0:(\$2-Eref)*Conv w lp " >>  ${Nom}_l3.gplot
85
for i in `seq 1 $ItMax`
86
do
87
 echo "replot \"$Nom.datl\" i $i u 0:(\$2-Eref)*Conv w lp " >>  ${Nom}_l3.gplot
88
done
89

    
90
chmod u+x ${Nom}_l.gplot ${Nom}_l2.gplot ${Nom}_l3.gplot