source: trunk/templates/skygenerator.html

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

various improvements

File size: 2.4 KB
Line 
1<%inherit file="base.html"/>
2
3<%
4import collections
5import os.path
6
7skygenerator = context['data']['skygenerator']
8frequency_axis = skygenerator['frequency axis']
9sources = skygenerator['sources']
10%>
11
12<h2>Sky Model Parameters</h2>
13
14<div class="row-fluid">
15 <table class="table table-condensed">
16 <tbody>
17 % for k,v in skygenerator.items():
18 <!-- don't render complicated objects-->
19 % if not isinstance(v, collections.Iterable):
20 <tr>
21 <td>${k}</td>
22 <td>${v}</td>
23 </tr>
24 % endif
25 % endfor
26 </tbody>
27 </table>
28</div>
29
30<%
31# construct html pages with sky model plane plots
32for iwn,wn in enumerate(frequency_axis):
33 link = os.path.join(context['dirname'], 'skymodelplane%s.html' % (wn))
34 with open(link, 'w') as f:
35 template = mylookup.get_template('skymodelplane.html')
36 context_copy = context.kwargs
37 context_copy['wn'] = wn
38 context_copy['iwn'] = iwn
39 context_copy['stagename'] = 'skygenerator'
40 context_copy['resultname'] = 'sky model'
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 context_copy['spectrum'] = context['data']['skygenerator']['sources']\
52 [sourceid]['spectrum']
53
54 f.write(template.render(**context_copy))
55%>
56
57<!-- link to the plot pages from this page -->
58
59<h3>Sky Model Planes</h3>
60<div class="row">
61% for wn in frequency_axis:
62 <%
63 wnformatted = '%6.4gcm-1' % wn
64 %>
65 <div class="col-xs-6 col-md-3">
66 <a href="skymodelplane${wn}.html" class="thumbnail">
67 <img src="sky_modelplane${wn}.png" alt="...">
68 <div>
69 <h4>${wnformatted}</h4>
70 </div>
71 </a>
72 </div>
73% endfor
74</div>
75
76% if sources:
77 <h3>Model Source Spectra</h3>
78 <div class="row">
79 % for sourceid in sources.keys():
80 <div class="col-xs-6 col-md-3">
81 <a href="sourcespectrum${sourceid}.html" class="thumbnail">
82 <img src="sourcespectrum${sourceid}.png" alt="...">
83 <div>
84 <h4>Source${sourceid}</h4>
85 </div>
86 </a>
87 </div>
88 % endfor
89 </div>
90% endif
Note: See TracBrowser for help on using the repository browser.