Commit 51e3c685 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema

Update reduction

parent 80285d29
......@@ -7,3 +7,5 @@
*.psh
*.par
*.png*
*.txt
*.npy
......@@ -8,9 +8,25 @@ import numpy as np
zapname = sys.argv[1]
npyname = sys.argv[2]
profilepngname = sys.argv[3]
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())
np.save(npyname, arch.get_data() * arch.get_weights()[:, np.newaxis, :, np.newaxis])
data = arch.get_data() * arch.get_weights()[:, np.newaxis, :, np.newaxis]
np.save(npyname, data)
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
frequencies = 441.668359375 - 35.0*np.arange(256)/256.0
data_to_plot = data[:,0,:,:].mean(axis=(0,1))
fig, ax = plt.subplots(1, figsize=(8,8));
ax.plot(np.linspace(0,1,len(data_to_plot)), data_to_plot, 'k');
ax.set_title(npyname[:-4])
ax.set_yticks([])
ax.set_xticks([])
ax.autoscale(enable=True, axis='x', tight=True)
plt.savefig(profilepngname, bbox_inches='tight')
......@@ -2,7 +2,9 @@
set -e
for fil in 2018-01-19-*.fil
rm -f htmlout.html
for fil in 2018-01-28-12\:44*.fil
do
headername=${fil/fil/txt}
header $fil > ${headername}
......@@ -19,7 +21,8 @@ do
ddname=${arname/.ar/.dd}
pam -e dd -D ${zapname} 2>&1 > /dev/null
npyname=${fil/fil/npy}
./convert.py ${ddname} ${npyname} >> ${headername}
profilepngname=${arname/.ar/_profile.png}
./convert.py ${ddname} ${npyname} ${profilepngname} >> ${headername}
rm ${ddname}
pngname=${arname/.ar/.png}
pav -dGTp ${zapname} -g ${arname/.ar/.png}/png
......@@ -30,13 +33,15 @@ do
<td>CB+TJD</td>
<td>
<ul>
<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> ($( du -h ${zapname} | awk '{print $1}' ))</li>
<li><a href="${npyname}">Numpy array</a> ($( du -h ${npyname} | awk '{print $1}' ))</li>
<li><a href="${fil//:/%3A}">Filterbank</a> ($( du -h ${fil} | awk '{print $1}' ))</li>
<li><a href="${headername//:/%3A}">Filterbank header</a></li>
<li><a href="${zapname//:/%3A}">Pulsar archive</a> ($( du -h ${zapname} | awk '{print $1}' ))</li>
<li><a href="${npyname//:/%3A}">Numpy array</a> ($( du -h ${npyname} | awk '{print $1}' ))</li>
</ul>
</td>
<td>420 MHz</td>
<td><a href="${profilepngname//:/%3A}"><img src="${profilepngname//:/%3A}" width="94" height="100" alt="Profile of B${psrname}"></a></td>
<td><a href="${pngname//:/%3A}"><img src="${pngname//:/%3A}" width="125" height="100" alt="Spectrum of B${psrname}"></a></td>
<td></td>
</tr>
EOF
......
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