-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMaumee_River_Nutrient_Tracker.html
592 lines (515 loc) · 27.4 KB
/
Maumee_River_Nutrient_Tracker.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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
<!DOCTYPE html>
<html>
<head lang="en">
<!-- updated 5/7/15 12:15pm -->
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Maumee Trib Tool Test</title>
<link rel="StyleSheet" href="tribtool.css" type="text/css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<link rel="StyleSheet" href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" type="text/css">
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="data.js"></script>
<script src="climatology.js"></script>
<script>
function loadData() {
var tp = new Array();
var drp = new Array();
for (i = 0; i < dailyData.length; i++) {
var date = new Date(Date.parse(dailyData[i][0]));
tp[i] = [date, Math.round(10000 * dailyData[i][1]) / 10000];
drp[i] = [date, dailyData[i][2]];
}
return [["TP", tp], ["DRP", drp]];
}
function loadPlotData(data, dataset, startDay) {
var aYear = grabAYear(data[dataset][1], 1, startDay, 2015, true);
var years = [];
for (y = 2000; y < 2015; y++) {
years.push(grabAYear(data[dataset][1], 1, startDay, y, true))
}
var stats = generateStats(data[dataset][1], 1, startDay, true);
var stats2 = generateStats(data[dataset][1], 1, startDay, false);
var d1 = [];
var d2 = [];
var d3 = [];
var d4 = [];
var d5 = [];
var d6 = [];
var d7 = [];
var f1 = [];
var f2 = [];
var f3 = [];
var f4 = [];
var f5 = [];
var dMany = new Array(15);
for (y = 2000; y < 2015; y++) {
dMany[y - 2000] = [];
}
for (i = 0; i < 365; i++) {
date = Date.UTC(1970, 0, i + startDay);
d1.push([date, stats[4][i] - stats[3][i]]);
d2.push([date, stats[3][i] - stats[2][i]]);
d3.push([date, stats[2][i] - stats[1][i]]);
d4.push([date, stats[1][i] - stats[0][i]]);
d5.push([date, stats[0][i]]);
if (i < aYear.length) {
d6.push([date, aYear[i]]);
if (i == aYear.length - 1) {
f1.push([date,aYear[i]]);
f2.push([date,aYear[i]]);
f3.push([date,aYear[i]]);
f4.push([date,aYear[i]]);
f5.push([date,aYear[i]]);
}
}
else {
f1.push([date,f1[f1.length-1][1]+stats2[4][i]]);
f2.push([date,f2[f2.length-1][1]+stats2[3][i]]);
f3.push([date,f3[f3.length-1][1]+stats2[2][i]]);
f4.push([date,f4[f4.length-1][1]+stats2[1][i]]);
f5.push([date,f5[f5.length-1][1]+stats2[0][i]]);
}
d7.push([date, 860.0]);
for (y = 2000; y < 2015; y++) {
dMany[y - 2000].push([date, years[y - 2000][i]]);
}
}
var result = [];
result.push({type: "area", name: "max", data: d1, linecolor: "#808080", color: '#F0F0F0'});
result.push({type: "area", name: "75%ile", data: d2, color: '#D0D0D0'});
result.push({type: "area", name: "mean", data: d3, color: '#D0D0D0', lineColor: '#808080'});
result.push({type: "area", name: "25%ile", data: d4, color: '#F0F0F0'});
result.push({type: "area", name: "min", data: d5, color: '#FFFFFF'});
result.push({type: "line", name: "2015", data: d6, color: '#004400', lineWidth: 3});
result.push({
type: "line", name: "July 31 target", data: d7,
lineWidth: "1", visible: false, showInLegend: false, color: "#FF0000", dashStyle: "longdash"
});
for (y = 2000; y < 2015; y++) {
result.push({
type: "line",
name: y,
data: dMany[y - 2000],
color: '#444444',
lineWidth: 1,
visible: false,
showInLegend: false
});
}
result.push({
type: "line",
name: "forecast",
showInLegend: false,
data: f1,
color: '#888888',
lineWidth: 1,
dashStyle: "LongDash"
});
result.push({
type: "line",
name: "forecast",
showInLegend: false,
data: f3,
color: '#444400',
lineWidth: 3,
dashStyle: "ShortDot"
});
result.push({
type: "line",
name: "forecast",
showInLegend: false,
data: f5,
color: '#888888',
lineWidth: 1,
dashStyle: "LongDash"
});
return result;
}
var chart = null;
var lastYear = "none";
var lastParameter = "Total Phosphorus";
var offsetForTarget = 0;
var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var rawData;
var startDay = 60;
var startMonth = 2;
$(function () {
rawData = loadData();
var lastI = rawData[0][1].length - 1;
var lastDate = rawData[0][1][lastI][0];
var nextDate = new Date();
nextDate.setDate(lastDate.getDate() + 7);
var niceDate = $.datepicker.formatDate("MM d", lastDate);
var niceDate2 = $.datepicker.formatDate("MM d", nextDate);
alert(niceDate + ' ' + niceDate2);
var plotData = loadPlotData(rawData, 0, startDay);
var monthTickPositions = [];
for (i = 0; i < 6; i++) {
monthTickPositions.push(Date.UTC(1970, startMonth + i, 1))
}
chart = new Highcharts.Chart(
{
chart: {
type: 'area',
renderTo: 'container'
},
credits: {
enabled: false
},
subtitle: {
text: 'Cumulative Load from Maumee River to Western Lake Erie Basin'
},
title: {
text: ''
},
// subtitle: {
// text: '(March 1 to April 27, 2015)'
// },
xAxis: {
min: Date.UTC(1970, startMonth, 1),
max: Date.UTC(1970, startMonth + 5, 1),
tickPositions: monthTickPositions,
gridLineWidth: 1,
labels: {
formatter: function () {
if (this.isFirst) return null;
var date = new Date(this.value);
return date.toLocaleString("en-us", {month: "short"})
},
x: -80
}
},
yAxis: {
title: {
text: 'Total Phosphorus (metric tons)'
},
labels: {
formatter: function () {
return this.value;
}
}
},
tooltip: {
useHTML: true,
formatter: function () {
var date = new Date(this.x);
var s = '<b>' + months[date.getMonth()] + ' ' + date.getDate() + '</b>';
s = s + "<br><br><table>";
var y = this.points[4].y;
s = s + "<tr><td>Minimum: <td style='text-align:right'>" + y.toFixed(3) + " mt<br>";
y += this.points[3].y;
s = s + "<tr><td>25th percentile: <td style='text-align:right'>" + y.toFixed(3) + " mt<br>";
y += this.points[2].y;
s = s + "<tr><td>Average: <td style='text-align:right'>" + y.toFixed(3) + " mt<br>";
y += this.points[1].y;
s = s + "<tr><td>75th percentile: <td style='text-align:right'>" + y.toFixed(3) + " mt<br>";
y += this.points[0].y;
s = s + "<tr><td>Maximum: <td style='text-align:right'>" + y.toFixed(3) + " mt<br>";
if (lastYear == "none") {
if (this.points.length > 5 + offsetForTarget)
s = s + "<tr><td><b>Current year: <td style='text-align:right'>" + this.points[5 + offsetForTarget].y.toFixed(3) + " mt</b><br>";
} else {
if (this.points.length > 6 + offsetForTarget) {
s = s + "<tr><td><b>Current year: <td style='text-align:right'>" + this.points[5 + offsetForTarget].y.toFixed(3) + " mt</b><br>";
s = s + "<tr><td><b>" + this.points[6].series.name + ": <td style='text-align:right'>" + this.points[6 + offsetForTarget].y.toFixed(3) + " mt</b><br>";
} else {
s = s + "<tr><td><b>" + this.points[5].series.name + ": <td style='text-align:right'>" + this.points[5 + offsetForTarget].y.toFixed(3) + " mt</b><br>";
}
}
if (offsetForTarget > 0) {
s = s + "<tr><td>Suggested target: <td style='text-align:right'>" + this.points[5].y.toFixed(3) + " mt<br>";
}
s = s + "</table>";
return s;
},
shared: true
},
plotOptions: {
area: {
stacking: 'normal',
lineWidth: 1,
marker: {
lineWidth: 1
}
}
},
series: plotData
}
);
//plotData = loadPlotData(rawData, 1, startDay);
// var chart2 = new Highcharts.Chart(Highcharts.merge(chart.options, {
// chart: {
// series: plotData,
// visible: false
// }
// Handle toggle of forecast
$('#target').change(function () {
if (this.checked) {
chart.series[6].show();
offsetForTarget = 1;
}
else {
chart.series[6].hide();
offsetForTarget = 0;
}
})
// Handle toggle of forecast
$('#forecast').change(function () {
if (this.checked) {
chart.series[23].show();
chart.series[24].show();
chart.series[22].show();
}
else {
chart.series[23].hide();
chart.series[24].hide();
chart.series[22].hide();
}
})
// Handle switch between parameters
$('#display').selectmenu({
change: function (event, data) {
//chart2.visible = true;
chart.visible = false;
alert(data.item.value)
}
});
// Handle switch of single year being displayed
$('#year').selectmenu({
change: function (event, data) {
if (lastYear != "none") {
chart.series[lastYear - 1993].hide();
chart.series[lastYear - 1993].showInLegend = false;
}
lastYear = data.item.value;
if (lastYear != "none") {
chart.series[lastYear - 1993].lineColor = '#802020';
chart.series[lastYear - 1993].showInLegend = true;
chart.series[lastYear - 1993].show();
}
chart.isDirtyBox = true;
chart.redraw();
}
}
);
}
)
</script>
<style>
fieldset {
border: 0;
margin-left: 50px;
}
.ui-widget {
font-size: 75% !important;
}
select {
width: 200px;
}
body, td, th {
font-family: Candara, Calibri, Segoe UI;
}
</style>
</head>
<body id="pid-home"
class="front not-logged-in page-node node-type-page no-sidebars full-node layout-main sidebars-split font-size-12 grid-type-960 grid-width-16">
<div id="page" class="page">
<div id="page-inner" class="page-inner">
<!-- header-top row: width = grid_width -->
<div id="header-top-wrapper" class="header-top-wrapper full-width">
<div id="header-top" class="header-top row grid16-16">
<div id="header-top-inner" class="header-top-inner inner clearfix">
<div class="inner clearfix">
<div class="content clearfix">
</div>
</div>
<!-- /block-inner -->
</div>
<!-- /block -->
<div id="logo">
<a href="/" title="Home"><img src="logo.png" alt="Home"/></a>
</div>
<div id="site-name-wrapper" class="clearfix">
<div id="site-name"><a href="/" title="Home">Great Lakes Observing System </a></div>
<div class="tool-title"><br/><br/>Maumee River Nutrient Tracker <font size=-1><i>(5/11/2015
DRAFT)</i></font></div>
</div>
<!-- /site-name-wrapper -->
</div>
<!-- /header-site-info-inner -->
</div>
<!-- /header-site-info -->
</br></br></br>
<div id="page-content" class="page-content">
<table width="900">
<tr>
<td width="600">
<p><b>Cumulative Loads</b> March 1 to May 18, 2015:<br>
<table>
<tr>
<td> Total Phosphorus:
<td> 616.4 metric tons
<td> (21.5% below 2000-2014 average) <br>
<tr>
<td> Dissolved Reactive Phosphorus:
<td> 126.3 metric tons
<td> (18.6% below 2000-2014 average)
</table>
<br>
<i>Data last updated May 26; next update planned for June 1.</i>
</p>
</td>
<td>
<fieldset>
<input type="checkbox" id="target">Show</input>
<br>
<input type="checkbox" id="forecast">Show forecast</input>
<br>
<select id="display" name="display">
<option value="Total Phosphorus" selected="selected">Total Phosphorus</option>
<option value="Dissolved Reactive Phosphorus">Dissolved Reactive Phosphorus</option>
</select>
<br>
<select id="year" name="year">
<option selected="selected" value="none">none</option>
<option value="2000">2000</option>
<option value="2001">2001</option>
<option value="2002">2002</option>
<option value="2003">2003</option>
<option value="2004">2004</option>
<option value="2005">2005</option>
<option value="2006">2006</option>
<option>2007</option>
<option>2008</option>
<option>2009</option>
<option>2010</option>
<option>2011</option>
<option>2012</option>
<option>2013</option>
<option>2014</option>
</select>
</fieldset>
</td>
</tr>
<tr>
<td colspan="2">
<div id="container" style="display: block; width: 900px; height: 600px; margin: 0 auto"></div>
<div id="container2" style="display: none; width: 900px; height: 600px; margin: 0 auto"></div>
<p>The extent and severity of algal blooms in the Western Lake Erie Basin (WLEB) have been shown
to be
correlated with the amount of nutrients (nutrient load) entering the WLEB from the Maumee
River
Watershed through the Maumee River. Measurements of the concentration of nutrients in the
Maumee River
are collected by Heidelberg University and combined with USGS measurements of Maumee River
flow to
calculate daily nutrient loads. This web page’s tracking tool sums up nutrient loads
day-to-day to show
the current year’s total nutrient load entering the WLEB through the Maumee River, and
charts the
cumulative loads in the context of previous (2000-2014) years’ ranges.
</p>
<p>Heidelberg University retrieves water samples and performs laboratory analyses of the
samples’ water
chemistry on a regular schedule. During the critical spring and summer seasons of 2015,
Heidelberg plans
to publish analytical results and calculated daily loads on a weekly basis. The intensive
schedule,
along with development and implementation of this web page in partnership with the Great
Lakes Observing
System, is supported by the Great Lakes Restoration Initiative and the National Oceanic and
Atmospheric
Agency’s Great Lakes Environmental Research Laboratory.
<p>
Much more information is available from the following links:
</p>
</td>
</tr>
</table>
<a href="http://lakeerie.ohio.gov/Portals/0/Reports/Task_Force_Report_October_2013.pdf"
title="Click to access report recommending spring target of 800 metric tons TP and 150 metric tons DRP">suggested
target</a>
</div>
</div>
<!-- footer row: width = grid_width -->
<div id="footer-wrapper" class="footer-wrapper full-width">
<div id="footer" class="footer row grid16-16">
<div id="footer-inner" class="footer-inner inner clearfix">
<div id="block-block-1" class="block block-block odd first grid16-9">
<div class="inner clearfix">
<div class="content clearfix">
<table>
<tr>
<td width="615">
<p>GLOS is a Regional Association of the <a href="http://www.ioos.noaa.gov/"
target="_blank">Integrated Ocean
Observing System (IOOS)</a></p>
<p>Regional Coastal Observing Systems: <a href="http://www.aoos.org/"
target="_blank">Alaska</a> • <a
href="http://cara.uprm.edu/" target="_blank">Caribbean</a> • <a
href="http://www.cencoos.org/" target="_blank">Central & Northern
California</a><br/>
<a href="http://glos.us" target="_blank">Great Lakes</a> • <a
href="http://gcoos.org" target="_blank">Gulf of Mexico</a> • <a
href="http://www.soest.hawaii.edu/pacioos/" target="_blank">Pacific
Islands</a> • <a href="http://maracoos.org/" target="_blank">Mid-Atlantic</a>
• <a href="http://www.neracoos.org/"
target="_blank">Northeast-Atlantic</a><br/>
<a href="http://www.nanoos.org/" target="_blank">Pacific Northwest</a> • <a
href="http://www.sccoos.org/" target="_blank">Southern
California</a> • <a href="http://secoora.org/" target="_blank">Southeast-Atlantic</a><br/>
<a href="http://www.ioosassociation.org/">Integrated Ocean Observing System
Association</a></p>
<p>National Observing System Partners: <a href="http://www.act-us.info/"
target="_blank">Alliance for Coastal
Technologies (ACT)</a><br/>
<a href="http://www.sura.org/home/" target="_blank">Southeastern
Universities Research Association (SURA)</a></p>
</td>
<td width="813">
<div class="footerbox">
<p>
<strong>Disclaimer:</strong>
All products published on this website are prototype products and are
not intended to be used for navigational or operational purposes.
<a href="http://glos.us/legal/">View full disclaimer.</a>
</p>
<div style="margin-top:5px;padding-bottom:15px; border:none; float:left; padding-right:10px;">
<a href="mailto:[email protected]?subject=Data%20Portal%20Feedback">
<img src="feedback.png" alt="Send feedback" width="100" height="26"
style="border:none">
</a>
</div>
<p class="glosinfo">
© Great Lakes Observing System
<br>
229 Nickels Arcade
<br>
Ann Arbor, MI 48104
<br>
</p>
</div>
</td>
</tr>
</table>
</div>
</div>
<!-- /block-inner -->
</div>
<!-- /block -->
<div id="block-block-4" class="block block-block even grid16-4 fusion-right social">
<div class="inner clearfix">
<div class="content clearfix">
</div>
</div>
<!-- /block-inner -->
</div>
<!-- /block -->
</div>
</div>
</div>
</div>
</body>
</html>