source: util/gather_averaged_results.sh@ 725869

Last change on this file since 725869 was a0bcf1, checked in by Frederik Heber <heber@…>, 17 years ago

-initial commit
-Minimum set of files needed from ESPACK SVN repository
-Switch to three tantamount package parts instead of all relating to pcp (as at some time Ralf's might find inclusion as well)

  • Property mode set to 100755
File size: 3.5 KB
Line 
1#!/bin/sh
2#
3# uses gather_results with known files
4
5. suffix
6
7if [ -z "$1" ];then
8 echo "Usage: $0 <mol>"
9 echo "where <mol> is one directory in the defaults-dir, containing pcp.*${suf} files."
10 exit 1
11fi
12
13for mol in $@; do
14DDir="${configdir}/$mol"
15SDir=$PWD
16TEX="$mol.tex"
17DVI="$mol.dvi"
18PS="$mol.ps"
19. suffix
20
21# start TeX-File
22echo "\documentclass[11pt, a4paper]{article}" >${DDir}/$TEX
23echo "\usepackage{rotating}" >>${DDir}/$TEX
24echo "\usepackage{graphicx}" >>${DDir}/$TEX
25echo "\usepackage{latexsym}" >>${DDir}/$TEX
26echo "\usepackage{amsfonts}" >>${DDir}/$TEX
27echo "\usepackage{amssymb}" >>${DDir}/$TEX
28echo "\begin{document}" >>${DDir}/$TEX
29
30# gather susceptibility, copy plot file, call gnuplot
31echo "Gathering susceptibility ..."
32./gather_result ${DDir}/ chi
33./average_result ${DDir}/ chi 9 "${DDir}/results-chi_avg${suf}"
34./average_result ${DDir}/ chi 1 "${DDir}/results-chi_iso_avg${suf}" _iso
35echo "\include{results-chi}" >>${DDir}/$TEX
36echo "\include{results-chi_iso}" >>${DDir}/$TEX
37sed -e "s#results#results-chi#g" ${pcpdir}/util/plot-chi.plt >${DDir}/plot-chi.plt
38cd ${DDir}
39gnuplot plot-chi.plt
40sed -i -e "s#figure#sidewayfigure#g" results-chi.tex
41cd ${SDir}
42
43# go through all different sigmas
44elementliste="H C O Si"
45
46for type in $elementliste; do
47 ion=0
48 while [ -e "$DDir/2Ht/pcp.sigma_i${ion}_${type}${suf}" ]; do
49 echo "Gathering shielding tensor for ion ${ion} of type ${type} ..."
50 ./gather_result ${DDir}/ "sigma_i${ion}_${type}"
51 sed -e "s#sigma#sigma-i${ion}-${type}#g" -e "s#results#results-sigma_i${ion}_${type}#" ${pcpdir}/util/plot-sigma.plt >${DDir}/plot-sigma_i${ion}_${type}.plt
52 cd ${DDir}
53 gnuplot "plot-sigma_i${ion}_${type}.plt"
54 sed -i -e "s#figure#sidewayfigure#g" results-sigma_i${ion}_${type}.tex
55 cd ${SDir}
56 echo "\include{results-sigma_i${ion}_${type}}" >>${DDir}/$TEX
57 echo "\include{results-sigma_i${ion}_${type}_iso}" >>${DDir}/$TEX
58 # step on to next ion, if exists. If not, go to next type and zeroth ion
59 let ion=$ion+1
60 done
61 if [ -e "$DDir/2Ht/pcp.sigma_i0_${type}${suf}" ]; then
62 echo "Collecting shielding tensor, averaging and error estimation ..."
63 ./average_result ${DDir}/ "sigma" ${type} 9 "${DDir}/results-sigma_${type}_avg${suf}"
64 ./average_result ${DDir}/ "sigma" ${type} 1 "${DDir}/results-sigma_${type}_iso_avg${suf}" _iso
65 fi
66
67 ion=0
68 while [ -e "$DDir/2Ht/pcp.sigma_i${ion}_${type}_rezi${suf}" ]; do
69 echo "Gathering reciprocal shielding tensor for ion ${ion} of type ${type} ..."
70 ./gather_result ${DDir}/ "sigma_i${ion}_${type}_rezi"
71 sed -e "s#sigma#sigma-i${ion}-${type}_rezi#g" -e "s#results#results-sigma_i${ion}_${type}_rezi#" ${pcpdir}/util/plot-sigma.plt >${DDir}/plot-sigma_i${ion}_${type}_rezi.plt
72 cd ${DDir}
73 gnuplot "plot-sigma_i${ion}_${type}_rezi.plt"
74 sed -i -e "s#figure#sidewayfigure#g" results-sigma_i${ion}_${type}_rezi.tex
75 cd ${SDir}
76 echo "\include{results-sigma_i${ion}_${type}_rezi}" >>${DDir}/$TEX
77 echo "\include{results-sigma_i${ion}_${type}_rezi_iso}" >>${DDir}/$TEX
78 # step on to next ion, if exists. If not, go to next type and zeroth ion
79 let ion=$ion+1
80 done
81 if [ -e "$DDir/2Ht/pcp.sigma_i0_${type}_rezi${suf}" ]; then
82 echo "Collecting reciprocal shielding tensor, averaging and error estimation ..."
83 ./average_result ${DDir}/ "sigma" ${type} 9 "${DDir}/results-sigma_${type}_rezi_avg${suf}" "_rezi"
84 ./average_result ${DDir}/ "sigma" ${type} 1 "${DDir}/results-sigma_${type}_rezi_iso_avg${suf}" "_rezi_iso"
85 fi
86
87done
88
89# End TeX-File and call with latex
90echo "\end{document}" >>${DDir}/$TEX
91cd ${DDir}
92latex $TEX
93dvips -o $PS $DVI
94cd ${SDir}
95done
96
97echo "all done."
98
99exit 0
Note: See TracBrowser for help on using the repository browser.