annotate output_report.py @ 5:d5a4180410c4 draft default tip

"planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
author gregor.m
date Sat, 28 Nov 2020 18:50:09 +0000
parents a4c6fcf2c456
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
1 """ Produces plots and a summary html 'headless' """
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
2 import logging
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
3 import os
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
4
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
5 import matplotlib
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
6 import matplotlib.pyplot as ppl
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
7 import spyboat.plotting as spyplot
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
8
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
9 ppl.switch_backend('Agg')
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
10 matplotlib.rcParams["text.usetex"] = False
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
11 logger = logging.getLogger(__name__)
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
12
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
13 # figure resolution
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
14 DPI = 250
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
15
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
16
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
17 def produce_snapshots(input_movie, results, frame, Wkwargs, img_path="."):
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
18 """
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
19 Takes the *input_movie* and the *results* dictionary
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
20 from spyboat.processing.run_parallel and produces phase,
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
21 period and amplitude snapshot png's.
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
22
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
23 For the period snapshot also the period range is needed,
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
24 hence the analysis dictionary 'Wkwargs' also gets passed.
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
25
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
26 The output files name pattern is:
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
27 [input, phase, period, amplitude]_frame{frame}.png
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
28 and the storage location in *img_path*.
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
29
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
30 These get picked up by 'create_html'
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
31 """
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
32
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
33 spyplot.input_snapshot(input_movie[frame])
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
34 fig = ppl.gcf()
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
35 out_path = os.path.join(img_path, f"input_frame{frame}.png")
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
36 fig.savefig(out_path, dpi=DPI)
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
37 ppl.close(fig)
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
38
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
39 spyplot.phase_snapshot(results["phase"][frame])
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
40 fig = ppl.gcf()
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
41 out_path = os.path.join(img_path, f"phase_frame{frame}.png")
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
42 fig.savefig(out_path, dpi=DPI)
3
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
43 ppl.close(fig)
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
44
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
45 spyplot.period_snapshot(
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
46 results["period"][frame], Wkwargs["Tmin"],
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
47 Wkwargs["Tmax"], time_unit="a.u."
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
48 )
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
49
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
50 fig = ppl.gcf()
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
51 out_path = os.path.join(img_path, f"period_frame{frame}.png")
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
52 fig.savefig(out_path, dpi=DPI)
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
53 ppl.close(fig)
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
54
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
55 spyplot.amplitude_snapshot(results["amplitude"][frame])
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
56 fig = ppl.gcf()
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
57 out_path = os.path.join(img_path, f"amplitude_frame{frame}.png")
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
58 fig.savefig(out_path, dpi=DPI)
3
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
59 ppl.close(fig)
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
60
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
61 logger.info(f"Produced 4 snapshots for frame {frame}..")
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
62
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
63
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
64 def produce_distr_plots(results, Wkwargs, img_path="."):
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
65 """
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
66 Output file names are:
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
67
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
68 period_distr.png, power_distr.png and phase_distr.png
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
69 """
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
70
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
71 spyplot.period_distr_dynamics(results["period"], Wkwargs)
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
72 fig = ppl.gcf()
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
73 out_path = os.path.join(img_path, "period_distr.png")
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
74 fig.savefig(out_path, dpi=DPI)
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
75
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
76 spyplot.power_distr_dynamics(results["power"], Wkwargs)
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
77 fig = ppl.gcf()
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
78 out_path = os.path.join(img_path, "power_distr.png")
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
79 fig.savefig(out_path, dpi=DPI)
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
80
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
81 spyplot.phase_coherence_dynamics(results["phase"], Wkwargs)
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
82 fig = ppl.gcf()
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
83 out_path = os.path.join(img_path, "phase_distr.png")
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
84 fig.savefig(out_path, dpi=DPI)
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
85
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
86 logger.info("Produced 3 distribution plots..")
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
87
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
88
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
89 def create_html(frame_nums, html_fname="OutputReport.html"):
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
90 """
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
91 The html generated assumes the respective png's
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
92 have been created with 'produce_snapshots' and 'produce_distr_plots'
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
93 and can be found at the cwd (that's how Galaxy works..)
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
94 """
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
95
3
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
96 # -- create a gallery for every frame in frame_nums --
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
97
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
98 galleries = ""
3
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
99 for frame_num in frame_nums:
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
100 new_gal = f"""
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
101 <div class="FrameSlides">
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
102 <h3 style="text-align:center; color=#363333">
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
103 Frame Nr. {frame_num} </h3>
3
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
104
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
105 <div class="snapshot_gallery">
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
106
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
107 <figure class=”snapshot_gallery__item
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
108 snapshot_gallery__item--1">
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
109 <img src="input_frame{frame_num}.png" alt="The Input"
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
110 class="snapshot_gallery__img">
3
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
111 </figure>
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
112
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
113 <figure class=”snapshot_gallery__item
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
114 snapshot_gallery__item--2">
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
115 <img src="phase_frame{frame_num}.png" alt="Phase"
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
116 class="snapshot_gallery__img">
3
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
117 </figure>
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
118
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
119 <figure class=”snapshot_gallery__item
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
120 snapshot_gallery__item--3">
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
121 <img src="period_frame{frame_num}.png"
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
122 alt="Period" class="snapshot_gallery__img">
3
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
123 </figure>
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
124
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
125 <figure class=”snapshot_gallery__item
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
126 snapshot_gallery__item--4">
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
127 <img src="amplitude_frame{frame_num}.png"
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
128 alt="Amplitude" class="snapshot_gallery__img">
3
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
129 </figure>
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
130 </div>
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
131 </div>
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
132 """
3
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
133 galleries += new_gal
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
134
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
135 html_string = f"""
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
136 <html>
4
a4c6fcf2c456 "planemo upload commit 0584e8878deaf91614c6bb3c0122975300132c25"
gregor.m
parents: 3
diff changeset
137 <!-- this file got automatically created by 'output_report.py' -->
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
138 <title>SpyBOAT Output Report</title>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
139 <head>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
140 <!-- that doesn't work with galaxy.. -->
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
141 <!--link rel="stylesheet" href="styles.css"-->
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
142 <style type="text/css">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
143 body{{ margin:10 100; background:whitesmoke; }}
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
144 /*body{{ margin:10 100; background:darkslategrey; }}*/
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
145 .center{{
3
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
146 text-align: center;
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
147 display: block;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
148 margin-left: auto;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
149 margin-right: auto;
3
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
150 width: 100%;}}
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
151
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
152 /* matplotlib output at 1600x1200 */
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
153 .distr_gallery {{
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
154 display: grid;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
155 margin: 0 auto;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
156 text-align: center;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
157 /* border: 1px dashed rgba(4, 4, 4, 0.35); */
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
158 grid-template-columns: repeat(3,1fr);
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
159 grid-template-rows: 20vw;
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
160 grid-gap: 0px;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
161 column-gap: 0px
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
162 }}
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
163 .distr_gallery__img {{
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
164 width: 100%;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
165 height: 100%;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
166 object-fit: contain;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
167 }}
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
168
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
169
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
170 /* matplotlib output at 1600x1200 */
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
171 .snapshot_gallery {{
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
172 display: grid;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
173 margin: 0 auto;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
174 border: 1px dashed rgba(4, 4, 4, 0.35);
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
175 text-align: center;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
176 grid-template-columns: repeat(2,1fr);
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
177 grid-template-rows: repeat(2,20vw);
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
178 grid-gap: 5px;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
179 }}
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
180 .snapshot_gallery__img {{
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
181 width: 100%;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
182 height: 100%;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
183 object-fit: contain;
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
184 }}
3
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
185 .subheader{{
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
186 text-align:center;
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
187 font-size: 160%;
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
188 color:#363333;}}
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
189 </style>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
190 </head>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
191 <body>
3
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
192 <h1 style="text-align:center; color:#363333">SpyBOAT Results Report</h1>
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
193 <hr style="width:50%">
3
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
194 <h1 class="subheader"> Distribution Dynamics </h1>
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
195 <div class="distr_gallery">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
196 <figure class=”distr_gallery__item distr_gallery__item--1">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
197 <img src="period_distr.png" alt="Period" class="distr_gallery__img">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
198 </figure>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
199
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
200 <figure class=”distr_gallery__item distr_gallery__item--2">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
201 <img src="power_distr.png" alt="Power" class="distr_gallery__img">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
202 </figure>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
203
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
204 <figure class=”distr_gallery__item distr_gallery__item--3">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
205 <img src="phase_distr.png" alt="Phase" class="distr_gallery__img">
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
206 </figure>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
207
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
208 </div>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
209
3
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
210 <h1 class="subheader"> Output Movie Snapshots </h1>
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
211
3
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
212 <!-- trigger the javascript at the end--->
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
213 <div class="center">
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
214 <button class="w3-button" onclick="plusDivs(-1)">&#10094; Prev</button>
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
215 <button class="w3-button" onclick="plusDivs(1)">Next &#10095;</button>
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
216 </div>
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
217
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
218 <!-- defines all elements of the "FrameSlides" class --->
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
219 {galleries}
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
220 </div>
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
221
3
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
222 <!-- javascript with escaped '{{'--->
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
223 <script>
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
224 var slideIndex = 1;
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
225 showDivs(slideIndex);
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
226
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
227 function plusDivs(n) {{
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
228 showDivs(slideIndex += n);
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
229 }}
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
230
3
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
231 function showDivs(n) {{
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
232 var i;
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
233 var x = document.getElementsByClassName("FrameSlides");
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
234 if (n > x.length) {{slideIndex = 1}}
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
235 if (n < 1) {{slideIndex = x.length}} ;
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
236 for (i = 0; i < x.length; i++) {{
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
237 x[i].style.display = "none";
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
238 }}
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
239 x[slideIndex-1].style.display = "block";
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
240 }}
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
241 </script>
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
242 </body>
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
243 </html>
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
244 """
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
245
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
246 with open(html_fname, "w") as OUT:
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
247 OUT.write(html_string)
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
248
5
d5a4180410c4 "planemo upload commit 7bc843096b70fe1c8fc149e69d8f87fceac4eb3b"
gregor.m
parents: 4
diff changeset
249 logger.info("Created html report")
0
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
250 return html_string
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
251
1d62de03829d "planemo upload commit c6cd06d44dce1eef9136017289d362f144687dc1"
gregor.m
parents:
diff changeset
252 # for local testing
3
4d7f30a7e2f6 "planemo upload commit d070f1ba04a5141a65487f45b29c22767639e44b"
gregor.m
parents: 0
diff changeset
253 # create_html([0,20,40,60,80])