source: trunk/templates/sourcespectrum.html@ 17

Last change on this file since 17 was 17, checked in by JohnLightfoot, 10 years ago

initial import

File size: 650 bytes
Line 
1<%inherit file="base.html"/>
2
3<!-- do the plotting -->
4<%
5import matplotlib.pyplot as plt
6import os.path
7
8plt.figure()
9
10print 'context'
11print context
12
13sourceid = context['sourceid']
14print sourceid
15spectrum = context['data']['skygenerator']['sources'][sourceid]['spectrum']
16print 'here'
17frequency_axis = context['data']['skygenerator']['frequency axis']
18print 'here1'
19
20plt.plot(frequency_axis, spectrum)
21plt.title('Source %s' % sourceid)
22print 'here2'
23
24plt.savefig(os.path.join(context['dirname'], 'sourcespectrum%s.png' % sourceid))
25plt.close()
26%>
27
28<!-- link to the plot from html -->
29
30<img src='sourcespectrum${sourceid}.png' alt="Source spectrum">
Note: See TracBrowser for help on using the repository browser.