1 | <%inherit file="base.html"/>
|
---|
2 |
|
---|
3 | <%
|
---|
4 | import collections
|
---|
5 | import matplotlib.pyplot as plt
|
---|
6 | import os.path
|
---|
7 |
|
---|
8 | mylookup = context['mylookup']
|
---|
9 |
|
---|
10 | beamsgenerator = context['data']['beamsgenerator']
|
---|
11 | wavenumbers = beamsgenerator['primary beam'].keys()
|
---|
12 | %>
|
---|
13 |
|
---|
14 | <h2>Beam Generation Parameters</h2>
|
---|
15 |
|
---|
16 | <div class="row-fluid">
|
---|
17 | <table class="table table-condensed">
|
---|
18 | <tbody>
|
---|
19 | % for k,v in beamsgenerator.items():
|
---|
20 | <!-- don't render complicated objects-->
|
---|
21 | % if not isinstance(v, collections.Iterable):
|
---|
22 | <tr>
|
---|
23 | <td>${k}</td>
|
---|
24 | <td>${v}</td>
|
---|
25 | </tr>
|
---|
26 | % endif
|
---|
27 | % endfor
|
---|
28 | </tbody>
|
---|
29 | </table>
|
---|
30 | <div>
|
---|
31 |
|
---|
32 | <%
|
---|
33 | # construct html pages with primary beam plots
|
---|
34 | for wn in wavenumbers:
|
---|
35 | link = os.path.join(context['dirname'], 'primary_beam%s.html' % (wn))
|
---|
36 | with open(link, 'w') as f:
|
---|
37 | template = mylookup.get_template('beamplot.html')
|
---|
38 | context_copy = context.kwargs
|
---|
39 | context_copy['wn'] = wn
|
---|
40 | context_copy['beamtype'] = 'primary beam'
|
---|
41 | f.write(template.render(**context_copy))
|
---|
42 |
|
---|
43 | # construct html pages with dirty beam plots
|
---|
44 | for wn in wavenumbers:
|
---|
45 | link = os.path.join(context['dirname'], 'dirty_beam%s.html' % (wn))
|
---|
46 | with open(link, 'w') as f:
|
---|
47 | template = mylookup.get_template('beamplot.html')
|
---|
48 | context_copy = context.kwargs
|
---|
49 | context_copy['wn'] = wn
|
---|
50 | context_copy['beamtype'] = 'dirty beam'
|
---|
51 | f.write(template.render(**context_copy))
|
---|
52 |
|
---|
53 | # construct html pages with clean beam plots
|
---|
54 | for wn in wavenumbers:
|
---|
55 | link = os.path.join(context['dirname'], 'clean_beam%s.html' % (wn))
|
---|
56 | with open(link, 'w') as f:
|
---|
57 | template = mylookup.get_template('beamplot.html')
|
---|
58 | context_copy = context.kwargs
|
---|
59 | context_copy['wn'] = wn
|
---|
60 | context_copy['beamtype'] = 'clean beam'
|
---|
61 | f.write(template.render(**context_copy))
|
---|
62 | %>
|
---|
63 |
|
---|
64 | <!-- link to the plot pages from this page -->
|
---|
65 |
|
---|
66 | <h3>Primary Beams</h3>
|
---|
67 | <div class="row">
|
---|
68 | % for wn in context['data']['beamsgenerator']['primary beam'].keys():
|
---|
69 | <%
|
---|
70 | wnformatted = '%6.4gcm-1' % wn
|
---|
71 | %>
|
---|
72 | <div class="col-xs-6 col-md-3">
|
---|
73 | <a href="primary_beam${wn}.html" class="thumbnail">
|
---|
74 | <img src="primary_beam${wn}.png" alt="...">
|
---|
75 | <div>
|
---|
76 | <h4>${wnformatted}</h4>
|
---|
77 | </div>
|
---|
78 | </a>
|
---|
79 | </div>
|
---|
80 | % endfor
|
---|
81 | </div>
|
---|
82 |
|
---|
83 | <h3>Dirty Beams</h3>
|
---|
84 | <div class="row">
|
---|
85 | % for wn in context['data']['beamsgenerator']['dirty beam'].keys():
|
---|
86 | <%
|
---|
87 | wnformatted = '%6.4gcm-1' % wn
|
---|
88 | %>
|
---|
89 | <div class="col-xs-6 col-md-3">
|
---|
90 | <a href="dirty_beam${wn}.html" class="thumbnail">
|
---|
91 | <img src="dirty_beam${wn}.png" alt="...">
|
---|
92 | <div>
|
---|
93 | <h4>${wnformatted}</h4>
|
---|
94 | </div>
|
---|
95 | </a>
|
---|
96 | </div>
|
---|
97 | % endfor
|
---|
98 | </div>
|
---|
99 |
|
---|
100 | <h3>Clean Beams</h3>
|
---|
101 | <div class="row">
|
---|
102 | % for wn in context['data']['beamsgenerator']['clean beam'].keys():
|
---|
103 | <%
|
---|
104 | wnformatted = '%6.4gcm-1' % wn
|
---|
105 | %>
|
---|
106 | <div class="col-xs-6 col-md-3">
|
---|
107 | <a href="clean_beam${wn}.html" class="thumbnail">
|
---|
108 | <img src="clean_beam${wn}.png" alt="...">
|
---|
109 | <div>
|
---|
110 | <h4>${wnformatted}</h4>
|
---|
111 | </div>
|
---|
112 | </a>
|
---|
113 | </div>
|
---|
114 | % endfor
|
---|
115 | </div>
|
---|