source: trunk/templates/skygenerator.html@ 17

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

initial import

File size: 2.2 KB
Line 
1<%inherit file="base.html"/>
2
3<%
4import collections
5import matplotlib.pyplot as plt
6import os.path
7
8skygenerator = context['data']['skygenerator']
9frequency_axis = skygenerator['frequency axis']
10spatial_axis = skygenerator['spatial axis']
11sources = skygenerator['sources']
12%>
13
14<h2>Sky Model Parameters</h2>
15
16<div class="row-fluid">
17 <table class="table table-condensed">
18 <tbody>
19 % for k,v in skygenerator.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 sky model plane plots
34for iwn,wn in enumerate(frequency_axis):
35 link = os.path.join(context['dirname'], 'skymodelplane%s.html' % (wn))
36 with open(link, 'w') as f:
37 template = mylookup.get_template('skymodelplane.html')
38 context_copy = context.kwargs
39 context_copy['wn'] = wn
40 context_copy['iwn'] = iwn
41 f.write(template.render(**context_copy))
42
43# construct html pages with model source spectra plots
44for sourceid in sources.keys():
45 link = os.path.join(context['dirname'], 'sourcespectrum%s.html' % (
46 sourceid))
47 with open(link, 'w') as f:
48 template = mylookup.get_template('sourcespectrum.html')
49 context_copy = context.kwargs
50 context_copy['sourceid'] = sourceid
51 f.write(template.render(**context_copy))
52%>
53
54<!-- link to the plot pages from this page -->
55
56<h3>Sky Model Planes</h3>
57<div class="row">
58% for wn in frequency_axis:
59 <%
60 wnformatted = '%6.4gcm-1' % wn
61 %>
62 <div class="col-xs-6 col-md-3">
63 <a href="skymodelplane${wn}.html" class="thumbnail">
64 <img src="skymodelplane${wn}.png" alt="...">
65 <div>
66 <h4>${wnformatted}</h4>
67 </div>
68 </a>
69 </div>
70% endfor
71</div>
72
73% if sources:
74 <h3>Model Source Spectra</h3>
75 <div class="row">
76 % for sourceid in sources.keys():
77 <div class="col-xs-6 col-md-3">
78 <a href="sourcespectrum${sourceid}.html" class="thumbnail">
79 <img src="sourcespectrum${sourceid}.png" alt="...">
80 <div>
81 <h4>Source${sourceid}</h4>
82 </div>
83 </a>
84 </div>
85 % endfor
86 </div>
87% endif
Note: See TracBrowser for help on using the repository browser.