-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbase.html
247 lines (196 loc) · 8.87 KB
/
base.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<!DOCTYPE html>
<html lang="en">
<head>
<title>KPI Report</title>
<meta charset="utf-8"/>
<link rel="stylesheet" type="text/css" href='../templates/style.css' />
{% import "macros.jinja" as macros %}
</head>
<body>
{#-------------------------------------------------------------------------#}
{# CREATE PARAMETER VOCABULARIES FOR MEASURED AND CALC SECTION#}
{% set meas_vocab = kpi.create_vocab(param_list=meas_param,
vocab_config=custom_vocab_config) %}
{% set calc_vocab = kpi.create_vocab(param_list=calc_param,
vocab_config=custom_vocab_config) %}
{#-------------------------------------------------------------------------#}
{# REPORT TITLE #}
<h1>Key Performance Indicators Report</h1>
<h2>For ICOS station <i>{{inst_config['inst_name_full']}}</i> -
{{data_config['df_start']}} to {{data_config['df_end']}}</h2>
{# Create section counter #}
{% set section_counter = 1 %}
{#-------------------------------------------------------------------------#}
{# INTRODUCTION SECTION #}
<h3>{{section_counter}}. Introduction</h3>
{# Introduction text #}
{% include 'section_text/intro_text.html' %}
{# Insert cruise track/station locaton map #}
{% if report_type == 'HO' %}
{# Station/instrument subsection #}
<h4>Station Description</h4>
{% include 'instrument_descriptions/' + inst_config['inst_name_short']
+ '.html' %}
{# Insert image of station #}
{% endif %}
{# Increase section counter #}
{% set section_counter = section_counter + 1 %}
{#-------------------------------------------------------------------------#}
{# DATA OVERVIEW SECTION #}
<h3>{{section_counter}}. Data and quality overview</h3>
{# Data overview text #}
{% include 'section_text/data_overview_text.html' %}
{# Text about each figure and table in this section #}
<p>
{{ macros.visuals_text(
section_config['overview_figures'], section_counter, False, True) }}
{{ macros.visuals_text(
section_config['overview_tables'], section_counter, False, False) }}
</p>
{# Create and include figures with captions #}
{% for kpi_name in section_config['overview_figures'] %}
{{kpi.eval_overview_fig_function(kpi_name=kpi_name,
meas_vocab=meas_vocab, calc_vocab=calc_vocab, df=df,
output_dir=output_dir) | default("", True)}}
{% set filename = kpi_name + '.png' %}
{% set figure_number = section_counter ~ '.' ~ loop.index %}
{{ macros.figure(kpi_name, filename, figure_number, False) }}
{% endfor %}
{# Create and include tables with captions #}
{% for kpi_name in section_config['overview_tables'] %}
{% set table_list = kpi.eval_overview_tab_function(kpi_name=kpi_name,
meas_vocab=meas_vocab, calc_vocab=calc_vocab, df=df) %}
{% set table_number = section_counter ~ '.' ~ loop.index %}
{{ macros.table(kpi_name, table_list, table_number, False) }}
{% endfor %}
{# Increase section counter #}
{% set section_counter = section_counter + 1 %}
{#-------------------------------------------------------------------------#}
{# MEASURED VALUES SECTION #}
<h3>{{section_counter}}. Measured values</h3>
{# Loop to create a subsection per sensors #}
{% for sensor_name, sensor_config in meas_vocab.items() %}
{# Store subsection counter #}
{% set subsection_counter = loop.index %}
{# Subsection number and title #}
<h4> {{section_counter}}.{{subsection_counter}} 
{{sensor_config['subsection_title']}} </h4>
{# Description about the sensor #}
<p> {{ macros.param_text(report_type, sensor_name) }} </p>
{# Text about each figure and table in this section #}
<p>
{{ macros.visuals_text(section_config['meas_figures'], section_counter,
subsection_counter, True) }}
{{ macros.visuals_text(section_config['meas_tables'], section_counter,
subsection_counter, False) }}
</p>
{# Create and include figures with captions #}
{% for kpi_name in section_config['meas_figures'] %}
{{ kpi.eval_fig_function(kpi_name=kpi_name, parameter=sensor_name,
vocab=meas_vocab, df=df, output_dir=output_dir)
| default("", True)}}
{% set filename = sensor_name + '_' + kpi_name + '.png' %}
{% set figure_number = section_counter ~ '.' ~ subsection_counter ~ '.'
~ loop.index %}
{{ macros.figure(kpi_name, filename, figure_number,
sensor_config['fig_label_name_html']) }}
{% endfor %}
{# Create and include tables with captions #}
{% for kpi_name in section_config['meas_tables'] %}
{% set table_list = kpi.eval_tab_function(kpi_name=kpi_name,
parameter=sensor_name, vocab=meas_vocab, df=df)
%}
{% set table_number = section_counter ~ '.' ~ subsection_counter ~ '.'
~ loop.index %}
{{ macros.table(kpi_name, table_list, table_number,
sensor_config['fig_label_name_html']) }}
{% endfor %}
{# End measured subsection for loop #}
{% endfor %}
{# Increase section counter #}
{% set section_counter = section_counter + 1 %}
{#-------------------------------------------------------------------------#}
{# CALCULATED VALUES SECTION #}
{% if calc_vocab != {} %}
<h3>{{section_counter}}. Calculated values</h3>
{# Loop to create a subsection per sensors #}
{% for calc_name, calc_config in calc_vocab.items() %}
{# Store subsection counter #}
{% set subsection_counter = loop.index %}
{# Subsection number and title #}
<h4> {{section_counter}}.{{subsection_counter}} 
{{calc_config['subsection_title']}} </h4>
{# Description about the value #}
<p> {{ macros.param_text(report_type, calc_name) }} </p>
{# Text about each figure and table in this section #}
<p>
{{ macros.visuals_text(section_config['calc_figures'], section_counter,
subsection_counter, True) }}
{{ macros.visuals_text(section_config['calc_tables'], section_counter,
subsection_counter, False) }}
</p>
{# Create and include figures with captions #}
{% for kpi_name in section_config['calc_figures'] %}
{{ kpi.eval_fig_function(kpi_name=kpi_name, parameter=calc_name,
vocab=calc_vocab, df=df, output_dir=output_dir)
| default("", True)}}
{% set filename = calc_name + '_' + kpi_name + '.png' %}
{% set figure_number = section_counter ~ '.' ~ subsection_counter ~ '.'
~ loop.index %}
{{ macros.figure(kpi_name, filename, figure_number,
calc_config['fig_label_name_html']) }}
{% endfor %}
{# Create and include tables with captions #}
{% for kpi_name in section_config['calc_tables'] %}
{% set table_list = kpi.eval_tab_function(kpi_name=kpi_name,
parameter=calc_name, vocab=calc_vocab, df=df)
%}
{% set table_number = section_counter ~ '.' ~ subsection_counter ~ '.'
~ loop.index %}
{{ macros.table(kpi_name, table_list, table_number,
calc_config['fig_label_name_html']) }}
{% endfor %}
{# End measured subsection for loop #}
{% endfor %}
{# Increase section counter #}
{% set section_counter = section_counter + 1 %}
{% endif %}
{#-------------------------------------------------------------------------#}
{# PROP-PROP SECTION #}
{% if custom_prop_config != [] %}
<h3>{{section_counter}}. Property-property plots</h3>
{# Loop to create a subsection per prop-prop plot #}
{% for prop_name, prop_config in custom_prop_config.items() %}
{# Store subsection counter #}
{% set subsection_counter = loop.index %}
{# Subsection number and title #}
<h4> {{section_counter}}.{{subsection_counter}} 
{{prop_config['subsection_title']}} </h4>
{# Description about the prop-prop plot #}
<p> {{ macros.prop_text(report_type, prop_name) }} </p>
{# Text about each figure in this section #}
<p>
{# (prop_kpi_list converts prop_name from string to list) #}
{% set prop_kpi_list = prop_name.split(' ') %}
{{ macros.visuals_text(prop_kpi_list, section_counter,
subsection_counter, True) }}
</p>
{# Create and include figures with captions #}
{{ kpi.deltaT(vocab=custom_vocab_config, prop_config=prop_config, df=df,
output_dir=output_dir) | default("", True) }}
{% set filename = prop_name + '.png' %}
{% set figure_number = section_counter ~ '.' ~ subsection_counter ~ '.'
~ loop.index %}
{{ macros.figure(prop_name, filename, figure_number, False) }}
{# End prop-prop subsection for loop #}
{% endfor %}
{# Increase section counter #}
{% set section_counter = section_counter + 1 %}
{% endif %}
{#-------------------------------------------------------------------------#}
{# DIAGNOSTICS SECTION #}
<h3>{{section_counter}}. Diagnostics</h3>
{# Increase section counter #}
{% set section_counter = section_counter + 1 %}
</body>
</html>