[17] | 1 | <%inherit file="base.html"/>
|
---|
| 2 |
|
---|
| 3 | <%
|
---|
| 4 | import collections
|
---|
| 5 | import os.path
|
---|
| 6 |
|
---|
| 7 | skygenerator = context['data']['skygenerator']
|
---|
| 8 | frequency_axis = skygenerator['frequency axis']
|
---|
| 9 | sources = 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
|
---|
| 32 | for 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
|
---|
[30] | 39 | context_copy['stagename'] = 'skygenerator'
|
---|
| 40 | context_copy['resultname'] = 'sky model'
|
---|
[17] | 41 | f.write(template.render(**context_copy))
|
---|
| 42 |
|
---|
| 43 | # construct html pages with model source spectra plots
|
---|
| 44 | for 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
|
---|
[30] | 51 | context_copy['spectrum'] = context['data']['skygenerator']['sources']\
|
---|
| 52 | [sourceid]['spectrum']
|
---|
| 53 |
|
---|
[17] | 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">
|
---|
[30] | 67 | <img src="sky_modelplane${wn}.png" alt="...">
|
---|
[17] | 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
|
---|