Commit 80285d29 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Update reduction script, do dedispersion for numpy

parent 9aef80bc
#!/usr/bin/env python
from __future__ import print_function
import sys
import psrchive
import numpy as np
zapname = sys.argv[1]
npyname = sys.argv[2]
arch = psrchive.Archive_load(zapname)
print('Folding period :', arch.get_Integration(0).get_folding_period())
print('Folding dispersion measure :', arch.get_Integration(0).get_dispersion_measure()), arch.get_data() * arch.get_weights()[:, np.newaxis, :, np.newaxis])
for fil in *.fil
set -e
for fil in 2018-01-19-*.fil
header $fil > ${headername}
......@@ -13,8 +15,12 @@ do
psrsh -e med median_zap.psh $arname 2>&1 > /dev/null
rm ${arname}
pam -e dd -D ${zapname} 2>&1 > /dev/null
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();'${npyname}', archive.get_data()*archive.get_weights()[:,numpy.newaxis,:,numpy.newaxis])" >> ${headername}
./ ${ddname} ${npyname} >> ${headername}
rm ${ddname}
pav -dGTp ${zapname} -g ${arname/.ar/.png}/png
cat >> htmlout.html <<EOF
......@@ -24,11 +30,10 @@ do
<li><a href="${fil}">Filterbank</a> (313 MB)</li>
<li><a href="${fil}">Filterbank</a> ($( du -h ${fil} | awk '{print $1}' ))</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>
<li><a href="${zapname}">Pulsar archive</a> ($( du -h ${zapname} | awk '{print $1}' ))</li>
<li><a href="${npyname}">Numpy array</a> ($( du -h ${npyname} | awk '{print $1}' ))</li>
<td>420 MHz</td>
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