annotate output_report.py @ 2:c59d1373230e draft

"planemo upload commit eeba34c94465f41d13c2f5bcf68177d23c92d971-dirty"
author gregor.m
date Mon, 23 Nov 2020 14:38:37 +0000
parents 1d62de03829d
children 4d7f30a7e2f6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
1 ''' Produces plots and a summary html 'headless' '''
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
2
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
3 import os
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
4 import matplotlib
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
5 # headless plotting and disable latex
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
6 matplotlib.use('Agg')
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
7 matplotlib.rcParams['text.usetex'] = False
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
8 import matplotlib.pyplot as ppl
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
9
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
10 import logging
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
11
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
12 import spyboat.plotting as spyplot
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
13
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
14 logger = logging.getLogger(__name__)
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
15
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
16 # figure resolution
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
17 DPI=250
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
18
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
19 def produce_snapshots(input_movie, results, frame, Wkwargs,
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
20 img_path='.'):
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
21
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
22 '''
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
23 Takes the *input_movie* and the
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
24 *results* dictionary from spyboat.processing.run_parallel
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
25 and produces phase, period and amplitude snapshot png's.
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
26
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
27 For the period snapshot also the period range is needed,
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
28 hence the analysis dictionary 'Wkwargs' also gets passed.
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
29
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
30 The output files name pattern is:
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
31 [input, phase, period, amplitude]_frame{frame}.png
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
32 and the storage location in *img_path*.
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
33
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
34 These get picked up by 'create_html'
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
35 '''
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
36
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
37
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
38 spyplot.input_snapshot(input_movie[frame])
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
39 fig = ppl.gcf()
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
40 out_path = os.path.join(img_path, f'input_frame{frame}.png')
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
41 fig.savefig(out_path, dpi=DPI)
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
42
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
43 spyplot.phase_snapshot(results['phase'][frame])
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
44 fig = ppl.gcf()
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
45 out_path = os.path.join(img_path, f'phase_frame{frame}.png')
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
46 fig.savefig(out_path, dpi=DPI)
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
47
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
48 spyplot.period_snapshot(results['period'][frame],
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
49 Wkwargs,
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
50 time_unit = 'a.u.')
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
51
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
52 fig = ppl.gcf()
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
53 out_path = os.path.join(img_path, f'period_frame{frame}.png')
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
54 fig.savefig(out_path, dpi=DPI)
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
55
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
56 spyplot.amplitude_snapshot(results['amplitude'][frame])
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
57 fig = ppl.gcf()
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
58 out_path = os.path.join(img_path, f'amplitude_frame{frame}.png')
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
59 fig.savefig(out_path, dpi=DPI)
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
60
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
61
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
62 logger.info(f'Produced 4 snapshots for frame {frame}..')
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
63
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
64 def produce_distr_plots(results, Wkwargs, img_path='.'):
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
65
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
66 '''
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
67 Output file names are:
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
68
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
69 period_distr.png, power_distr.png and phase_distr.png
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
70 '''
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
71
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
72 spyplot.period_distr_dynamics(results['period'], Wkwargs)
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
73 fig = ppl.gcf()
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
74 out_path = os.path.join(img_path, f'period_distr.png')
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
75 fig.savefig(out_path, dpi=DPI)
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
76
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
77 spyplot.power_distr_dynamics(results['power'], Wkwargs)
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
78 fig = ppl.gcf()
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
79 out_path = os.path.join(img_path, f'power_distr.png')
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
80 fig.savefig(out_path, dpi=DPI)
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
81
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
82 spyplot.phase_coherence_dynamics(results['phase'], Wkwargs)
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
83 fig = ppl.gcf()
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
84 out_path = os.path.join(img_path, f'phase_distr.png')
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
85 fig.savefig(out_path, dpi=DPI)
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
86
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
87 logger.info(f'Produced 3 distribution plots..')
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
88
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
89
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
90 def create_html(frame_num, html_fname='OutputReport.html'):
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
91
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
92 '''
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
93 The html generated assumes the respective png's (7 in total)
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
94 have been created with 'produce_snapshots' and 'produce_distr_plots'
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
95 and can be found at the cwd (that's how Galaxy works..)
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
96 '''
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
97
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
98 html_string =f'''
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
99 <html>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
100 <title>SpyBOAT Output Report</title>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
101 <head>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
102 <!-- that doesn't work with galaxy.. -->
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
103 <!--link rel="stylesheet" href="styles.css"-->
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
104 <style type="text/css">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
105 body{{ margin:10 100; background:whitesmoke; }}
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
106 /*body{{ margin:10 100; background:darkslategrey; }}*/
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
107 .center{{
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
108 display: block;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
109 margin-left: auto;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
110 margin-right: auto;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
111 width: 40%;}}
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
112
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
113 /* matplotlib output at 1600x1200 */
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
114 .distr_gallery {{
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
115 display: grid;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
116 margin: 0 auto;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
117 text-align: center;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
118 /* border: 1px dashed rgba(4, 4, 4, 0.35); */
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
119 grid-template-columns: repeat(3,1fr);
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
120 grid-template-rows: 25vw;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
121 grid-gap: 0px;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
122 column-gap: 0px
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
123 }}
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
124 .distr_gallery__img {{
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
125 width: 100%;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
126 height: 100%;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
127 object-fit: contain;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
128 }}
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
129
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
130
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
131 /* matplotlib output at 1600x1200 */
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
132 .snapshot_gallery {{
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
133 display: grid;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
134 margin: 0 auto;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
135 border: 1px dashed rgba(4, 4, 4, 0.35);
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
136 text-align: center;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
137 grid-template-columns: repeat(2,1fr);
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
138 grid-template-rows: repeat(2,20vw);
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
139 grid-gap: 5px;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
140 }}
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
141 .snapshot_gallery__img {{
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
142 width: 100%;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
143 height: 100%;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
144 object-fit: contain;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
145 }}
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
146 </style>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
147 </head>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
148 <body>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
149 <h1 style="text-align:center">SpyBOAT Results Report</h1>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
150 <hr style="width:50%">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
151 <div class="distr_gallery">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
152 <figure class=”distr_gallery__item distr_gallery__item--1">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
153 <img src="period_distr.png" alt="Period" class="distr_gallery__img">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
154 </figure>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
155
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
156 <figure class=”distr_gallery__item distr_gallery__item--2">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
157 <img src="power_distr.png" alt="Power" class="distr_gallery__img">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
158 </figure>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
159
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
160 <figure class=”distr_gallery__item distr_gallery__item--3">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
161 <img src="phase_distr.png" alt="Phase" class="distr_gallery__img">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
162 </figure>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
163
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
164 </div>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
165
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
166 <h2 style="text-align:center"> Snapshots - Frame {frame_num}</h2>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
167 <div class="snapshot_gallery">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
168 <figure class=”snapshot_gallery__item snapshot_gallery__item--1">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
169 <img src="input_frame{frame_num}.png" alt="The Input" class="snapshot_gallery__img">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
170 </figure>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
171
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
172 <figure class=”snapshot_gallery__item snapshot_gallery__item--2">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
173 <img src="phase_frame{frame_num}.png" alt="Phase" class="snapshot_gallery__img">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
174 </figure>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
175
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
176 <figure class=”snapshot_gallery__item snapshot_gallery__item--3">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
177 <img src="period_frame{frame_num}.png" alt="Period" class="snapshot_gallery__img">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
178 </figure>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
179
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
180 <figure class=”snapshot_gallery__item snapshot_gallery__item--4">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
181 <img src="amplitude_frame{frame_num}.png" alt="Amplitude" class="snapshot_gallery__img">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
182 </figure>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
183 </div>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
184
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
185
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
186 <!-- *** Section 1 *** --->
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
187 </body>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
188 </html>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
189 '''
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
190
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
191 with open(html_fname, 'w') as OUT:
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
192
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
193 OUT.write(html_string)
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
194
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
195 logger.info(f'Created html report')
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
196 return html_string
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
197
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
198 # for local testing
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
199 # create_html(125)