Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Brute forcing fit of the diffraction pattern with fullprof and shell. Brute force attack on orthorhombic structure with mmm point symmetry. See details in: http://istitov.wordpress.com/2013/04/09/bruteforcing-spectra-with-fullprof/
#!/bin/bash
#remove fullprof output files
rm -v *pcr *hkl *out *sum
#looping around orthorhombic crystal system with mmm point group
for i in 'Pmmm' 'Pnnn' 'Pccm' 'Pban' 'Pmma' 'Pnna' 'Pmna' 'Pcca' 'Pbam' 'Pccn' 'Pbcm' 'Pnnm' 'Pmmn' 'Pbcn' 'Pbca' 'Pnma' 'Cmcm' 'Cmce' 'Cmmm' 'Cccm' 'Cmme' 'Ccce' 'Fmmm' 'Fddd' 'Immm' 'Ibam' 'Ibca' 'Imma'
do
#remove output in the loop
rm -v *out *sum
#put spaces between the characters
j=$(echo $i | sed 's/./& /g')
#change mygroup in template file to real group name,
sed "s/mygroup/$j/" my_spectrum.template > my_spectrum.pcr
#run fullprof
~/FullProf_Suite/fp2k my_spectrum.pcr
#create dir named after the crystallographic group
mkdir -v $i
#move relevant fullprof output there
mv -v *pcr *hkl *prf $i
#in some cases (e.g. strong divergence) output is written in a new file. let's have it.
mv -v *new $i
done
#cleanup
rm -v *out *sum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment