-
Notifications
You must be signed in to change notification settings - Fork 0
/
wwdata.html
2171 lines (2084 loc) · 117 KB
/
wwdata.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
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>wwdata package — wwdata 0.1.0 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.1.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Contributing" href="contributing.html" />
<link rel="prev" title="wwdata" href="modules.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="contributing.html" title="Contributing"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="modules.html" title="wwdata"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">wwdata 0.1.0 documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="modules.html" accesskey="U">wwdata</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="wwdata-package">
<h1>wwdata package<a class="headerlink" href="#wwdata-package" title="Permalink to this headline">¶</a></h1>
<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-wwdata.Class_HydroData">
<span id="wwdata-class-hydrodata-module"></span><h2>wwdata.Class_HydroData module<a class="headerlink" href="#module-wwdata.Class_HydroData" title="Permalink to this headline">¶</a></h2>
<p>Class_HydroData provides functionalities for handling data obtained in the context of (waste)water treatment.</p>
<p>Copyright (C) 2016 Chaim De Mulder</p>
<p>This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.</p>
<p>This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.</p>
<p>You should have received a copy of the GNU General Public License
along with this program. If not, see <a class="reference external" href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.</p>
<dl class="class">
<dt id="wwdata.Class_HydroData.HydroData">
<em class="property">class </em><code class="descclassname">wwdata.Class_HydroData.</code><code class="descname">HydroData</code><span class="sig-paren">(</span><em>data</em>, <em>timedata_column='index'</em>, <em>data_type='WWTP'</em>, <em>experiment_tag='No tag given'</em>, <em>time_unit=None</em>, <em>units=[]</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p class="rubric">Methods</p>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.absolute_to_relative">
<code class="descname">absolute_to_relative</code><span class="sig-paren">(</span><em>time_data='index'</em>, <em>unit='d'</em>, <em>inplace=True</em>, <em>save_abs=True</em>, <em>decimals=5</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.absolute_to_relative"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.absolute_to_relative" title="Permalink to this definition">¶</a></dt>
<dd><p>converts a pandas series with datetime timevalues to relative timevalues
in the given unit, starting from 0</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>time_data</strong> : str</p>
<blockquote>
<div><p>name of the column containing the time data. If this is the index
column, just give ‘index’ (also default)</p>
</div></blockquote>
<p><strong>unit</strong> : str</p>
<blockquote class="last">
<div><p>unit to which to convert the time values (sec, min, hr or d)</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.add_to_meta_valid">
<code class="descname">add_to_meta_valid</code><span class="sig-paren">(</span><em>column_names</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.add_to_meta_valid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.add_to_meta_valid" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds (a) column(s) with the given column_name(s) to the self.meta_filled
DataFrame, where all tags are set to ‘original’. This makes sure that
also data that already is very reliable can be used further down the
process (e.g. filling etc.)</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>column_names</strong> : array</p>
<blockquote class="last">
<div><p>array containing the names of the columns to add to the meta_valied
dataframe</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.calc_daily_profile">
<code class="descname">calc_daily_profile</code><span class="sig-paren">(</span><em>column_name</em>, <em>arange</em>, <em>quantile=0.9</em>, <em>plot=False</em>, <em>plot_method='quantile'</em>, <em>clear=False</em>, <em>only_checked=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.calc_daily_profile"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.calc_daily_profile" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates a typical daily profile based on data from the indicated
consecutive days. Also saves this average day, along with standard
deviation and lower and upper percentiles as given in the arguments.
Plotting is possible.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>column_name</strong> : str</p>
<blockquote>
<div><p>name of the column containing the data to calculate an average day
for</p>
</div></blockquote>
<p><strong>arange</strong> : 2-element array of ints</p>
<blockquote>
<div><p>contains the beginning and end day of the period to use for average
day calculation</p>
</div></blockquote>
<p><strong>quantile</strong> : float between 0 and 1</p>
<blockquote>
<div><p>value to use for the calculation of the quantiles</p>
</div></blockquote>
<p><strong>plot</strong> : bool</p>
<blockquote>
<div><p>plot or not</p>
</div></blockquote>
<p><strong>plot_method</strong> : str</p>
<blockquote>
<div><p>method to use for plotting. Available: “quantile” or “stdev”</p>
</div></blockquote>
<p><strong>clear</strong> : bool</p>
<blockquote>
<div><p>wether or not to clear the key in the self.daily_profile dictionary
that is already present</p>
</div></blockquote>
<p><strong>Returns</strong></p>
<p><strong>——</strong></p>
<p><strong>None; creates a dictionary self.daily_profile containing information</strong></p>
<p class="last"><strong>on the average day as calculated.</strong></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.calc_ratio">
<code class="descname">calc_ratio</code><span class="sig-paren">(</span><em>data_1</em>, <em>data_2</em>, <em>arange</em>, <em>only_checked=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.calc_ratio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.calc_ratio" title="Permalink to this definition">¶</a></dt>
<dd><p>Given two datasets or -columns, calculates the average ratio between
the first and second dataset, within the given range. Also the standard
deviation on this is calculated</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>data_1</strong> : str</p>
<blockquote>
<div><p>name of the data column containing the data to be in the numerator
of the ratio calculation</p>
</div></blockquote>
<p><strong>data_2</strong> : str</p>
<blockquote>
<div><p>name of the data column containing the data to be in the denominator
of the ratio calculation</p>
</div></blockquote>
<p><strong>arange</strong> : array of two values</p>
<blockquote>
<div><p>the range within which the ratio needs to be calculated</p>
</div></blockquote>
<p><strong>only_checked</strong> : bool</p>
<blockquote>
<div><p>if ‘True’, filtered values are excluded; default to ‘False’</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The average ratio of the first data column over the second one within</p>
<p class="last">the given range and including the standard deviation</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.calc_slopes">
<code class="descname">calc_slopes</code><span class="sig-paren">(</span><em>xdata</em>, <em>ydata</em>, <em>time_unit=None</em>, <em>slope_range=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.calc_slopes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.calc_slopes" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates slopes for given xdata and data_name; if a time unit is given as
an argument, the time values (xdata) will first be converted to this
unit, which will then be used to calculate the slopes with.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>xdata</strong> : str</p>
<blockquote>
<div><p>name of the column containing the xdata for slope calculation
(e.g. time). If ‘index’, the index is used as xdata. If datetime
objects, a time_unit is expected to calculate the slopes.</p>
</div></blockquote>
<p><strong>data_name</strong> : str</p>
<blockquote>
<div><p>name of the column containing the data_name for slope calculation</p>
</div></blockquote>
<p><strong>time_unit</strong> : str</p>
<blockquote>
<div><p>time unit to be used for the slope calculation (in case this is
based on time); if None, slopes are simply calculated based on the
values given
!! This value has no impact if the xdata column is the index and is
not a datetime type. If that is the case, it is assumed that the
user knows the unit of the xdata !!</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">pd.Series</p>
<blockquote class="last">
<div><p>pandas Series object containing the slopes calculated for the
chosen variable</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.compare_ratio">
<code class="descname">compare_ratio</code><span class="sig-paren">(</span><em>data_1</em>, <em>data_2</em>, <em>arange</em>, <em>only_checked=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.compare_ratio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.compare_ratio" title="Permalink to this definition">¶</a></dt>
<dd><p>Compares the average ratios of two datasets in multiple different ranges
and returns the most reliable one, based on the standard deviation on
the ratio values</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>data_1</strong> : str</p>
<blockquote>
<div><p>name of the data column containing the data to be in the numerator
of the ratio calculation</p>
</div></blockquote>
<p><strong>data_2</strong> : str</p>
<blockquote>
<div><p>name of the data column containing the data to be in the denominator
of the ratio calculation</p>
</div></blockquote>
<p><strong>arange</strong> : int</p>
<blockquote>
<div><p>the range (in days) for which the ratios need to be calculated and
compared</p>
</div></blockquote>
<p><strong>only_checked</strong> : bool</p>
<blockquote>
<div><p>if ‘True’, filtered values are excluded; default to ‘False’</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The average ratio within the range that has been found to be the most</p>
<p class="last">reliable one</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.drop_index_duplicates">
<code class="descname">drop_index_duplicates</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.drop_index_duplicates"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.drop_index_duplicates" title="Permalink to this definition">¶</a></dt>
<dd><p>drop rows with a duplicate index, ASSUMING THEY HAVE THE SAME DATA IN
THEM!! Also updates the meta_valid dataframe</p>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.fill_index">
<code class="descname">fill_index</code><span class="sig-paren">(</span><em>arange</em>, <em>index_type='float'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.fill_index"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.fill_index" title="Permalink to this definition">¶</a></dt>
<dd><p>function to fill in missing index values</p>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.get_avg">
<code class="descname">get_avg</code><span class="sig-paren">(</span><em>name=None</em>, <em>only_checked=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.get_avg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.get_avg" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the averages of all or certain columns in a dataframe</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>name</strong> : arary of str</p>
<blockquote>
<div><p>name(s) of the column(s) containing the data to be averaged;
defaults to [‘none’] and will calculate average for every column</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">pd.DataFrame :</p>
<blockquote class="last">
<div><p>pandas dataframe, containing the average slopes of all or certain
columns</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.get_correlation">
<code class="descname">get_correlation</code><span class="sig-paren">(</span><em>data_1</em>, <em>data_2</em>, <em>arange</em>, <em>zero_intercept=False</em>, <em>only_checked=False</em>, <em>plot=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.get_correlation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.get_correlation" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the linear regression coefficients that relate data_1 to
data_2</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>data_1 and data_2</strong> : str</p>
<blockquote>
<div><p>names of the data columns containing the data between which the
correlation will be calculated.</p>
</div></blockquote>
<p><strong>arange</strong> : array</p>
<blockquote>
<div><p>array containing the beginning and end value between which the
correlation needs to be calculated</p>
</div></blockquote>
<p><strong>zero_intercept</strong> : bool</p>
<blockquote>
<div><p>indicates whether or not to assume a zero-intercept</p>
</div></blockquote>
<p><strong>only_checked: bool</strong></p>
<blockquote>
<div><p>if ‘True’, filtered values are excluded from calculation and plotting;
default to ‘False’
if a value in one column is filtered, the corresponding value in the second
column also gets excluded!</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">the linear regression coefficients of the correlation, as well as the</p>
<p class="last">r-squared -value</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.get_highs">
<code class="descname">get_highs</code><span class="sig-paren">(</span><em>data_name</em>, <em>bound_value</em>, <em>arange</em>, <em>method='percentile'</em>, <em>plot=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.get_highs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.get_highs" title="Permalink to this definition">¶</a></dt>
<dd><p>creates a dataframe with tags indicating what indices have data-values
higher than a certain value; example: the definition/tagging of rain
events.</p>
<dl class="docutils">
<dt>data_name</dt>
<span class="classifier-delimiter">:</span> <span class="classifier">str</span><dd>name of the column to execute the function on</dd>
<dt>bound_value</dt>
<span class="classifier-delimiter">:</span> <span class="classifier">float</span><dd>the boundary value above which points will be tagged</dd>
<dt>arange</dt>
<span class="classifier-delimiter">:</span> <span class="classifier">array of two values</span><dd>the range within which high values need to be tagged</dd>
<dt>method: str (value or percentile)</dt>
<dd>when percentile, the bound value is a given percentile above which
data points will be tagged, when value, bound_values is used directly
to tag data points.</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.get_std">
<code class="descname">get_std</code><span class="sig-paren">(</span><em>name=None</em>, <em>only_checked=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.get_std"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.get_std" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the standard deviations of all or certain columns in a dataframe</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>dataframe</strong> : pd.DataFrame</p>
<blockquote>
<div><p>dataframe containing the columns to calculate the standard deviation for</p>
</div></blockquote>
<p><strong>name</strong> : arary of str</p>
<blockquote>
<div><p>name(s) of the column(s) containing the data to calculate standard
deviation for; defaults to [‘none’] and will calculate standard
deviation for every column</p>
</div></blockquote>
<p><strong>plot</strong> : bool</p>
<blockquote>
<div><p>if True, plots the calculated standard deviations, defaults to False</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">pd.DataFrame :</p>
<blockquote class="last">
<div><p>pandas dataframe, containing the average slopes of all or certain
columns</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.head">
<code class="descname">head</code><span class="sig-paren">(</span><em>n=5</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.head"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.head" title="Permalink to this definition">¶</a></dt>
<dd><p>CONFIRMED
piping pandas head function</p>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.index">
<code class="descname">index</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.index"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.index" title="Permalink to this definition">¶</a></dt>
<dd><p>piping pandas index function</p>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.moving_average_filter">
<code class="descname">moving_average_filter</code><span class="sig-paren">(</span><em>data_name</em>, <em>window</em>, <em>cutoff_frac</em>, <em>arange</em>, <em>clear=False</em>, <em>inplace=False</em>, <em>log_file=None</em>, <em>plot=False</em>, <em>final=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.moving_average_filter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.moving_average_filter" title="Permalink to this definition">¶</a></dt>
<dd><p>Filters out the peaks/outliers in a dataset by comparing its values to a
smoothened representation of the dataset (Moving Average Filtering). The
filtered values are replaced by NaN values.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>data_name</strong> : str</p>
<blockquote>
<div><p>name of the column containing the data that needs to be filtered</p>
</div></blockquote>
<p><strong>window</strong> : int</p>
<blockquote>
<div><p>the number of values from the dataset that are used to take the
average at the current point.</p>
</div></blockquote>
<p><strong>cutoff_frac: float</strong></p>
<blockquote>
<div><p>the cutoff value (in fraction 0-1) to compare the data and smoothened
data: a deviation higher than a certain percentage drops the data-
point.</p>
</div></blockquote>
<p><strong>arange</strong> : array of two values</p>
<blockquote>
<div><p>the range within which the moving average filter needs to be applied</p>
</div></blockquote>
<p><strong>clear</strong> : bool</p>
<blockquote>
<div><p>if True, the tags added to datapoints before will be removed and put
back to ‘original’.</p>
</div></blockquote>
<p><strong>inplace</strong> : bool</p>
<blockquote>
<div><p>indicates whether a new dataframe is created and returned or whether
the operations are executed on the existing dataframe (nothing is
returned)</p>
</div></blockquote>
<p><strong>log_file</strong> : str</p>
<blockquote>
<div><p>string containing the directory to a log file to be written out
when using this function</p>
</div></blockquote>
<p><strong>plot</strong> : bool</p>
<blockquote>
<div><p>if true, a plot is made, comparing the original dataset with the
new, filtered dataset</p>
</div></blockquote>
<p><strong>final</strong> : bool</p>
<blockquote>
<div><p>if true, the values are actually replaced with nan values (either
inplace or in a new hp object)</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">HydroData object (if inplace=False)</p>
<blockquote>
<div><p>the dataframe from which the double values of ‘data’ are removed</p>
</div></blockquote>
<p class="last">None (if inplace=True)</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.moving_slope_filter">
<code class="descname">moving_slope_filter</code><span class="sig-paren">(</span><em>xdata</em>, <em>data_name</em>, <em>cutoff</em>, <em>arange</em>, <em>time_unit=None</em>, <em>clear=False</em>, <em>inplace=False</em>, <em>log_file=None</em>, <em>plot=False</em>, <em>final=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.moving_slope_filter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.moving_slope_filter" title="Permalink to this definition">¶</a></dt>
<dd><p>CONFIRMED
Filters out datapoints based on the difference between the slope in one
point and the next (sudden changes like noise get filtered out), based
on a given cut off value. Replaces the dropped values with NaN values.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>xdata</strong> : str</p>
<blockquote>
<div><p>name of the column containing the xdata for slope calculation
(e.g. time). If ‘index’, the index is used as xdata. If datetime
objects, a time_unit is expected to calculate the slopes.</p>
</div></blockquote>
<p><strong>data_name</strong> : str</p>
<blockquote>
<div><p>name of the column containing the data that needs to be filtered</p>
</div></blockquote>
<p><strong>cutoff: int</strong></p>
<blockquote>
<div><p>the cutoff value to compare the slopes with to apply the filtering.</p>
</div></blockquote>
<p><strong>arange</strong> : array of two values</p>
<blockquote>
<div><p>the range within which the moving slope filter needs to be applied</p>
</div></blockquote>
<p><strong>time_unit</strong> : str</p>
<blockquote>
<div><p>time unit to be used for the slope calculation (in case this is
based on time); if None, slopes are calculated based on the values
given</p>
</div></blockquote>
<p><strong>clear</strong> : bool</p>
<blockquote>
<div><p>if True, the tags added to datapoints before will be removed and put
back to ‘original’.</p>
</div></blockquote>
<p><strong>inplace</strong> : bool</p>
<blockquote>
<div><p>indicates whether a new dataframe is created and returned or whether
the operations are executed on the existing dataframe (nothing is
returned)</p>
</div></blockquote>
<p><strong>log_file</strong> : str</p>
<blockquote>
<div><p>string containing the directory to a log file to be written out
when using this function</p>
</div></blockquote>
<p><strong>plot</strong> : bool</p>
<blockquote>
<div><p>if true, a plot is made, comparing the original dataset with the
new, filtered dataset</p>
</div></blockquote>
<p><strong>final</strong> : bool</p>
<blockquote>
<div><p>if true, the values are actually replaced with nan values (either
inplace or in a new hp object)</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">HydroData object (if inplace=False)</p>
<blockquote>
<div><p>the dataframe from which the double values of ‘data’ are removed</p>
</div></blockquote>
<p class="last">None (if inplace=True)</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.plot_analysed">
<code class="descname">plot_analysed</code><span class="sig-paren">(</span><em>data_name</em>, <em>time_range='default'</em>, <em>only_checked=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.plot_analysed"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.plot_analysed" title="Permalink to this definition">¶</a></dt>
<dd><p>plots the values and their types (original, filtered, filled) of a given column in the given time range.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>data_name</strong> : str</p>
<blockquote>
<div><p>name of the column containing the data to plot</p>
</div></blockquote>
<p><strong>time_range</strong> : array of two values</p>
<blockquote>
<div><p>the range within which the values are plotted; default is all</p>
</div></blockquote>
<p><strong>only_checked</strong> : bool</p>
<blockquote>
<div><p>if ‘True’, filtered values are excluded; default to ‘False’</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Plot</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.replace">
<code class="descname">replace</code><span class="sig-paren">(</span><em>to_replace</em>, <em>value</em>, <em>inplace=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.replace"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.replace" title="Permalink to this definition">¶</a></dt>
<dd><p>CONFIRMED
piping pandas replace function</p>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.savgol">
<code class="descname">savgol</code><span class="sig-paren">(</span><em>data_name</em>, <em>window=55</em>, <em>polyorder=2</em>, <em>plot=False</em>, <em>inplace=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.savgol"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.savgol" title="Permalink to this definition">¶</a></dt>
<dd><p>Uses the scipy.signal Savitzky-Golay filter to smoothen the data of a column;
The values are either replaced or a new dataframe is returned.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>data_name</strong> : str</p>
<blockquote>
<div><p>name of the column containing the data that needs to be filtered</p>
</div></blockquote>
<p><strong>window</strong> : int</p>
<blockquote>
<div><p>the length of the filter window; default to 55</p>
</div></blockquote>
<p><strong>polyorder</strong> : int</p>
<blockquote>
<div><p>The order of the polynomial used to fit the samples.
polyorder must be less than window. default to 1</p>
</div></blockquote>
<p><strong>plot</strong> : bool</p>
<blockquote>
<div><p>if true, a plot is made, comparing the original dataset with the
new, filtered dataset</p>
</div></blockquote>
<p><strong>inplace</strong> : bool</p>
<blockquote>
<div><p>indicates whether a new dataframe is created and returned or whether
the operations are executed on the existing dataframe (nothing is
returned)</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">HydroData object (if inplace=False)</p>
<p class="last">None (if inplace=True)</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.set_index">
<code class="descname">set_index</code><span class="sig-paren">(</span><em>keys</em>, <em>key_is_time=False</em>, <em>drop=True</em>, <em>inplace=False</em>, <em>verify_integrity=False</em>, <em>save_prev_index=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.set_index"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.set_index" title="Permalink to this definition">¶</a></dt>
<dd><p>piping pandas set_index function, including the option to define the new index
as being the time data
key_is_time : bool</p>
<blockquote>
<div>when true, the new index will we known as the time data from here on</div></blockquote>
<p>(other arguments cfr pd.set_index)</p>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.set_tag">
<code class="descname">set_tag</code><span class="sig-paren">(</span><em>tag</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.set_tag"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.set_tag" title="Permalink to this definition">¶</a></dt>
<dd><p>CONFIRMED</p>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.set_time_unit">
<code class="descname">set_time_unit</code><span class="sig-paren">(</span><em>unit</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.set_time_unit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.set_time_unit" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.set_units">
<code class="descname">set_units</code><span class="sig-paren">(</span><em>units</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.set_units"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.set_units" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.simple_moving_average">
<code class="descname">simple_moving_average</code><span class="sig-paren">(</span><em>arange</em>, <em>window</em>, <em>data_name=None</em>, <em>inplace=False</em>, <em>plot=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.simple_moving_average"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.simple_moving_average" title="Permalink to this definition">¶</a></dt>
<dd><p>CONFIRMED
Calculate the Simple Moving Average of a dataseries from a dataframe,
using a window within which the datavalues are averaged.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>arange</strong> : array of two values</p>
<blockquote>
<div><p>the range within which the moving average needs to be calculated</p>
</div></blockquote>
<p><strong>window</strong> : int</p>
<blockquote>
<div><p>the number of values from the dataset that are used to take the
average at the current point. Defaults to 10</p>
</div></blockquote>
<p><strong>data_name</strong> : str or array of str</p>
<blockquote>
<div><p>name of the column(s) containing the data that needs to be
smoothened. If None, smoothened data is computed for the whole
dataframe. Defaults to None</p>
</div></blockquote>
<p><strong>inplace</strong> : bool</p>
<blockquote>
<div><p>indicates whether a new dataframe is created and returned or whether
the operations are executed on the existing dataframe (nothing is
returned)</p>
</div></blockquote>
<p><strong>plot</strong> : bool</p>
<blockquote>
<div><p>if True, a plot is given for comparison between original and smooth
data</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">HydroData (or subclass) object</p>
<blockquote class="last">
<div><p>either a new object (inplace=False) or an adjusted object, con-
taining the smoothened data values</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.tag_doubles">
<code class="descname">tag_doubles</code><span class="sig-paren">(</span><em>data_name</em>, <em>bound</em>, <em>arange=None</em>, <em>clear=False</em>, <em>inplace=False</em>, <em>log_file=None</em>, <em>plot=False</em>, <em>final=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.tag_doubles"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.tag_doubles" title="Permalink to this definition">¶</a></dt>
<dd><p>tags double values that subsequently occur in a measurement series.
This is relevant in case a sensor has failed and produces a constant
signal. A band is provided within which the signal can vary and still
be filtered out</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>data_name</strong> : str</p>
<blockquote>
<div><p>column name of the column from which double values will be sought</p>
</div></blockquote>
<p><strong>bound</strong> : float</p>
<blockquote>
<div><p>boundary value of the band to use. When the difference between a
point and the next one is smaller then the bound value, the latter
datapoint is tagged as ‘filtered’.</p>
</div></blockquote>
<p><strong>arange</strong> : array of two values</p>
<blockquote>
<div><p>the range within which double values need to be tagged</p>
</div></blockquote>
<p><strong>clear</strong> : bool</p>
<blockquote>
<div><p>if True, the tags added to datapoints before will be removed and put
back to ‘original’.</p>
</div></blockquote>
<p><strong>inplace</strong> : bool</p>
<blockquote>
<div><p>indicates whether a new dataframe is created and returned or whether
the operations are executed on the existing dataframe (nothing is
returned). (This argument only comes into play when the ‘final’
argument is True)</p>
</div></blockquote>
<p><strong>log_file</strong> : str</p>
<blockquote>
<div><p>string containing the directory to a log file to be written out
when using this function</p>
</div></blockquote>
<p><strong>plot</strong> : bool</p>
<blockquote>
<div><p>whether or not to make a plot of the newly tagged data points</p>
</div></blockquote>
<p><strong>final</strong> : bool</p>
<blockquote>
<div><p>if true, the values are actually replaced with nan values (either
inplace or in a new hp object)</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">HydroData object (if inplace=False)</p>
<blockquote>
<div><p>the dataframe from which the double values of ‘data’ are removed or
replaced</p>
</div></blockquote>
<p class="last">None (if inplace=True)</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.tag_extremes">
<code class="descname">tag_extremes</code><span class="sig-paren">(</span><em>data_name</em>, <em>arange=None</em>, <em>limit=0</em>, <em>method='below'</em>, <em>clear=False</em>, <em>plot=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.tag_extremes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.tag_extremes" title="Permalink to this definition">¶</a></dt>
<dd><p>Tags values above or below a given limit.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>data_name</strong> : str</p>
<blockquote>
<div><p>name of the column containing the data to be tagged</p>
</div></blockquote>
<p><strong>arange</strong> : array of two values</p>
<blockquote>
<div><p>the range within which extreme values need to be tagged</p>
</div></blockquote>
<p><strong>limit</strong> : int/float</p>
<blockquote>
<div><p>limit below or above which values need to be tagged</p>
</div></blockquote>
<p><strong>method</strong> : ‘below’ or ‘above’</p>
<blockquote>
<div><p>below tags all the values below the given limit, above tags
the values above the limit</p>
</div></blockquote>
<p><strong>clear</strong> : bool</p>
<blockquote>
<div><p>if True, the tags added before will be removed and put
back to ‘original’.</p>
</div></blockquote>
<p><strong>plot</strong> : bool</p>
<blockquote>
<div><p>whether or not to make a plot of the newly tagged data points</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">None;</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.tag_nan">
<code class="descname">tag_nan</code><span class="sig-paren">(</span><em>data_name</em>, <em>arange=None</em>, <em>clear=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.tag_nan"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.tag_nan" title="Permalink to this definition">¶</a></dt>
<dd><p>adds a tag ‘filtered’ in self.meta_valid for every NaN value in the given
column</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>data_name</strong> : str</p>
<blockquote>
<div><p>column name of the column to apply the function to</p>
</div></blockquote>
<p><strong>arange</strong> : array of two values</p>
<blockquote>
<div><p>the range within which nan values need to be tagged</p>
</div></blockquote>
<p><strong>clear</strong> : bool</p>
<blockquote>
<div><p>when true, resets the tags in meta_valid for the data in column
data_name</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">None</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.tail">
<code class="descname">tail</code><span class="sig-paren">(</span><em>n=5</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.tail"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.tail" title="Permalink to this definition">¶</a></dt>
<dd><p>CONFIRMED
piping pandas tail function</p>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.to_datetime">
<code class="descname">to_datetime</code><span class="sig-paren">(</span><em>time_column='index'</em>, <em>time_format='%dd-%mm-%yy'</em>, <em>unit='D'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.to_datetime"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.to_datetime" title="Permalink to this definition">¶</a></dt>
<dd><p>CONFIRMED
flexibly piping pandas to_datetime function</p>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.to_float">
<code class="descname">to_float</code><span class="sig-paren">(</span><em>columns='all'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.to_float"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.to_float" title="Permalink to this definition">¶</a></dt>
<dd><p>convert values in given columns to float values</p>
<dl class="docutils">
<dt>columns</dt>
<span class="classifier-delimiter">:</span> <span class="classifier">array of strings</span><dd>column names of the columns where values need to be converted to floats</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="wwdata.Class_HydroData.HydroData.write">
<code class="descname">write</code><span class="sig-paren">(</span><em>filename</em>, <em>filepath='/Users/chaimdemulder/Documents/Work/github/wwdata/docs'</em>, <em>method='all'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#HydroData.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.HydroData.write" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>filepath</strong> : str</p>
<blockquote>
<div><p>the path the output file should be saved to</p>
</div></blockquote>
<p><strong>filename</strong> : str</p>
<blockquote>
<div><p>the name of the output file</p>
</div></blockquote>
<p><strong>method</strong> : str (all,filtered,filled)</p>
<blockquote>
<div><p>depending on the method choice, different values will be written out:
all values, only the filtered values or the filled values</p>
</div></blockquote>
<p><strong>for_WEST</strong> : bool</p>
<p><strong>include_units</strong> : bool</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">None; write an output file</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="wwdata.Class_HydroData.total_seconds">
<code class="descclassname">wwdata.Class_HydroData.</code><code class="descname">total_seconds</code><span class="sig-paren">(</span><em>timedelta_value</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_HydroData.html#total_seconds"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_HydroData.total_seconds" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</div>
<div class="section" id="module-wwdata.Class_LabExperimBased">
<span id="wwdata-class-labexperimbased-module"></span><h2>wwdata.Class_LabExperimBased module<a class="headerlink" href="#module-wwdata.Class_LabExperimBased" title="Permalink to this headline">¶</a></h2>
<p>Class_LabExperimBased provides functionalities for data handling of data obtained in lab experiments in the field of (waste)water treatment.
Copyright (C) 2016 Chaim De Mulder</p>
<p>This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.</p>
<p>This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.</p>
<p>You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <a class="reference external" href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.</p>
<dl class="class">
<dt id="wwdata.Class_LabExperimBased.LabExperimBased">
<em class="property">class </em><code class="descclassname">wwdata.Class_LabExperimBased.</code><code class="descname">LabExperimBased</code><span class="sig-paren">(</span><em>data</em>, <em>timedata_column='index'</em>, <em>data_type='NAT'</em>, <em>experiment_tag='No tag given'</em>, <em>time_unit=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_LabExperimBased.html#LabExperimBased"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_LabExperimBased.LabExperimBased" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#wwdata.Class_HydroData.HydroData" title="wwdata.Class_HydroData.HydroData"><code class="xref py py-class docutils literal"><span class="pre">wwdata.Class_HydroData.HydroData</span></code></a></p>
<p>Superclass for a HydroData object, expanding the functionalities with
specific functions for data gathered is lab experiments.</p>
<p class="rubric">Attributes</p>
<table border="1" class="docutils">
<colgroup>
<col width="71%" />
<col width="29%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td>(see HydroData docstring)</td>
<td> </td>
</tr>
</tbody>
</table>
<p class="rubric">Methods</p>
<dl class="method">
<dt id="wwdata.Class_LabExperimBased.LabExperimBased.add_conc">
<code class="descname">add_conc</code><span class="sig-paren">(</span><em>column_name</em>, <em>x</em>, <em>y</em>, <em>new_name='default'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/wwdata/Class_LabExperimBased.html#LabExperimBased.add_conc"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#wwdata.Class_LabExperimBased.LabExperimBased.add_conc" title="Permalink to this definition">¶</a></dt>
<dd><p>calculates the concentration values of the given column and adds them as
a new column to the DataFrame.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>column_name</strong> : str</p>
<blockquote>
<div><p>column with values</p>
</div></blockquote>
<p><strong>x</strong> : int</p>
<blockquote>
<div><p>...</p>
</div></blockquote>
<p><strong>y</strong> : int</p>
<blockquote>
<div><p>...</p>
</div></blockquote>
<p><strong>new_name</strong> : str</p>
<blockquote class="last">
<div><p>name of the new column, default to ‘column_name + mg/L’</p>
</div></blockquote>
</td>
</tr>