Commit 9aef80bc authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema

Add reduce script

parent 82f0225a
#!/bin/bash
for fil in *.fil
do
headername=${fil/fil/txt}
header $fil > ${headername}
psrname=${fil:21:7}
obsdate=${fil:0:10}
obstime=${fil:11:5}
arname=$(dspsr -E parfiles/${psrname}.par -L10 -A $fil 2>&1 | tail -n 1 | sed -e "s/[^']*'\(.*\)'[^']*/\1/g")
zapname=${arname/.ar/.zap}
if [ ! -f ${zapname} ]; then
psrsh -e med median_zap.psh $arname 2>&1 > /dev/null
zapname=${arname/.ar/.med}
fi
npyname=${fil/fil/npy}
python -c "import psrchive; import numpy; archive=psrchive.Archive_load('${zapname}'); print 'Folding period :', archive.get_Integration(0).get_folding_period(); print 'Folding dispersion measure :', archive.get_Integration(0).get_dispersion_measure(); numpy.save('${npyname}', archive.get_data()*archive.get_weights()[:,numpy.newaxis,:,numpy.newaxis])" >> ${headername}
pngname=${arname/.ar/.png}
pav -dGTp ${zapname} -g ${arname/.ar/.png}/png
cat >> htmlout.html <<EOF
<tr>
<td>${obsdate} ${obstime}</td>
<td>B${psrname}</td>
<td>CB+TJD</td>
<td>
<ul>
<li><a href="${fil}">Filterbank</a> (313 MB)</li>
<li><a href="${headername}">Filterbank header</a></li>
<li><a href="${zapname}">Pulsar archive</a> (16 MB)</li>
<li><a href="${npyname}">Numpy array</a> (32 MB)</li>
<li><a href="${pngname}">Plot</a></li>
</ul>
</td>
<td>420 MHz</td>
<td></td>
</tr>
EOF
done
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment