-
Notifications
You must be signed in to change notification settings - Fork 0
/
fitrm3
executable file
·39 lines (31 loc) · 1.6 KB
/
fitrm3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env tcsh
# wrapper to take input for fitrm-textout and python plot
# clean up
rm -f /tmp/tmp-pound /tmp/tmp-logall /tmp/tmp-rmspectrumall /tmp/tmp-rmsall
rm -f /tmp/tmp-pound /tmp/tmp-log1430 /tmp/tmp-rmspectrum1430 /tmp/tmp-rms1430
rm -f log rm_spectrum_1001.txt
rm -f fitrm.log
# create rm spectrum
#echo 'First do spectrum of all data over +-5000 rad/m2 (need to type /xs to move through)'
cp $1 log
set name = `echo $1:t:r | cut -c 5-`
fitrm-5000 | tee -a fitrm$name.log
grep 'RMS (obs)' fitrm$name.log | tail -n 1 | gawk '{printf("%10.3f\n",$6)}' > /tmp/tmp-rmsall$name
# create files for python plotting
echo -n '#' > /tmp/tmp-pound
cat /tmp/tmp-pound log > /tmp/tmp-logall$name
cat /tmp/tmp-pound rm_spectrum_1001.txt > /tmp/tmp-rmspectrumall$name
fitrmpeak.py /tmp/tmp-rmspectrumall$name /tmp/tmp-rmsall$name | tee -a results.txt
#echo 'Next do spectrum of 1430 data over +-90000 rad/m2 (need to type /xs to move through)'
cp $1:r.1430 log
fitrm-textout | tee -a fitrm$name.log
grep 'RMS (obs)' fitrm$name.log | tail -n 1 | gawk '{printf("%10.3f\n",$6)}' > /tmp/tmp-rms1430$name
# create files for python plotting
echo -n '#' > /tmp/tmp-pound
cat /tmp/tmp-pound log > /tmp/tmp-log1430$name
cat /tmp/tmp-pound rm_spectrum_1001.txt > /tmp/tmp-rmspectrum1430$name
fitrmpeak.py /tmp/tmp-rmspectrum1430$name /tmp/tmp-rms1430$name | tee -a results.txt
# python plot
rm-est.py /tmp/tmp-logall$name /tmp/tmp-rmspectrumall$name /tmp/tmp-rmsall$name /tmp/tmp-rmspectrum1430$name /tmp/tmp-rms1430$name $name | tee -a results.txt
convert plotrm-${name}-nice.png plotrm-${name}-nice.ps
mv rm_components.txt rmcomp-${name}.txt