loone-data-prep 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. loone_data_prep-0.1.4/LICENSE +11 -0
  2. loone_data_prep-0.1.4/PKG-INFO +92 -0
  3. loone_data_prep-0.1.4/README.md +79 -0
  4. loone_data_prep-0.1.4/loone_data_prep/GEOGLOWS_LOONE_DATA_PREP.py +644 -0
  5. loone_data_prep-0.1.4/loone_data_prep/LOONE_DATA_PREP.py +920 -0
  6. loone_data_prep-0.1.4/loone_data_prep/__init__.py +0 -0
  7. loone_data_prep-0.1.4/loone_data_prep/data_analyses_fns.py +127 -0
  8. loone_data_prep-0.1.4/loone_data_prep/flow_data/S65E_total.py +24 -0
  9. loone_data_prep-0.1.4/loone_data_prep/flow_data/__init__.py +1 -0
  10. loone_data_prep-0.1.4/loone_data_prep/flow_data/forecast_bias_correction.py +90 -0
  11. loone_data_prep-0.1.4/loone_data_prep/flow_data/get_forecast_flows.py +449 -0
  12. loone_data_prep-0.1.4/loone_data_prep/flow_data/get_inflows.py +70 -0
  13. loone_data_prep-0.1.4/loone_data_prep/flow_data/get_outflows.py +80 -0
  14. loone_data_prep-0.1.4/loone_data_prep/flow_data/hydro.py +61 -0
  15. loone_data_prep-0.1.4/loone_data_prep/utils.py +682 -0
  16. loone_data_prep-0.1.4/loone_data_prep/water_level_data/__init__.py +1 -0
  17. loone_data_prep-0.1.4/loone_data_prep/water_level_data/get_all.py +35 -0
  18. loone_data_prep-0.1.4/loone_data_prep/water_level_data/hydro.py +46 -0
  19. loone_data_prep-0.1.4/loone_data_prep/water_quality_data/__init__.py +1 -0
  20. loone_data_prep-0.1.4/loone_data_prep/water_quality_data/get_inflows.py +42 -0
  21. loone_data_prep-0.1.4/loone_data_prep/water_quality_data/get_lake_wq.py +47 -0
  22. loone_data_prep-0.1.4/loone_data_prep/water_quality_data/wq.py +85 -0
  23. loone_data_prep-0.1.4/loone_data_prep/weather_data/__init__.py +1 -0
  24. loone_data_prep-0.1.4/loone_data_prep/weather_data/get_all.py +34 -0
  25. loone_data_prep-0.1.4/loone_data_prep/weather_data/weather.py +122 -0
  26. loone_data_prep-0.1.4/loone_data_prep.egg-info/PKG-INFO +92 -0
  27. loone_data_prep-0.1.4/loone_data_prep.egg-info/SOURCES.txt +30 -0
  28. loone_data_prep-0.1.4/loone_data_prep.egg-info/dependency_links.txt +1 -0
  29. loone_data_prep-0.1.4/loone_data_prep.egg-info/requires.txt +5 -0
  30. loone_data_prep-0.1.4/loone_data_prep.egg-info/top_level.txt +1 -0
  31. loone_data_prep-0.1.4/pyproject.toml +15 -0
  32. loone_data_prep-0.1.4/setup.cfg +4 -0
@@ -0,0 +1,11 @@
1
+ BSD-3-Clause License
2
+
3
+ Copyright (c) 2023 Aquaveo
4
+
5
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6
+
7
+ - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8
+ - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9
+ - Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10
+
11
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,92 @@
1
+ Metadata-Version: 2.1
2
+ Name: loone_data_prep
3
+ Version: 0.1.4
4
+ Summary: Prepare data to run the LOONE model.
5
+ Author-email: Michael Souffront <msouffront@aquaveo.com>, James Dolinar <jdolinar@aquaveo.com>, Osama Tarabih <osamatarabih@usf.edu>
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE
8
+ Requires-Dist: rpy2
9
+ Requires-Dist: retry
10
+ Requires-Dist: pandas
11
+ Requires-Dist: scipy
12
+ Requires-Dist: geoglows>=0.27.1
13
+
14
+ LOONE_DATA_PREP
15
+ # LOONE_DATA_PREP
16
+
17
+ Prepare data for the LOONE water quality model.
18
+
19
+ Link to LOONE model repository: [https://github.com/osamatarabih/LOONE](https://github.com/osamatarabih/LOONE)
20
+
21
+ ## Prerequisites:
22
+
23
+ * R ([https://www.r-project.org/](https://www.r-project.org/))
24
+ * R packages: dbhydroR, rio, dplyr
25
+
26
+ ## Installation:
27
+
28
+ ```bash
29
+ cd /path/to/loone_data_prep/
30
+ pip install .
31
+ ```
32
+
33
+ ### Examples
34
+
35
+ **From the command line:**
36
+
37
+ ```bash
38
+ # Get flow data
39
+ python -m loone_data_prep.flow_data.get_inflows /path/to/workspace/
40
+ python -m loone_data_prep.flow_data.get_outflows /path/to/workspace/
41
+ python -m loone_data_prep.flow_data.S65E_total /path/to/workspace/
42
+
43
+ # Get water quality data
44
+ python -m loone_data_prep.water_quality_data.get_inflows /path/to/workspace/
45
+ python -m loone_data_prep.water_quality_data.get_lake_wq /path/to/workspace/
46
+
47
+ # Get weather data
48
+ python -m loone_data_prep.weather_data.get_all /path/to/workspace/
49
+
50
+ # Get water level
51
+ python -m loone_data_prep.water_level_data.get_all /path/to/workspace/
52
+
53
+ # Interpolate data
54
+ python -m loone_data_prep.utils interp_all /path/to/workspace/
55
+
56
+ # Prepare data for LOONE
57
+ python -m loone_data_prep.LOONE_DATA_PREP /path/to/workspace/ /path/to/output/directory/
58
+ ```
59
+
60
+ **From Python:**
61
+
62
+ ```python
63
+ from loone_data_prep.utils import get_dbkeys
64
+ from loone_data_prep.water_level_data import hydro
65
+ from loone_data_prep import LOONE_DATA_PREP
66
+
67
+ input_dir = '/path/to/workspace/'
68
+ output_dir = '/path/to/output/directory/'
69
+
70
+ # Get dbkeys for water level data
71
+ dbkeys = get_dbkeys(
72
+ station_ids=["L001", "L005", "L006", "LZ40"],
73
+ category="SW",
74
+ param="STG",
75
+ stat="MEAN",
76
+ recorder="CR10",
77
+ freq="DA",
78
+ detail_level="dbkey"
79
+ )
80
+
81
+ # Get water level data
82
+ hydro.get(
83
+ workspace=input_dir,
84
+ name="lo_stage",
85
+ dbkeys=dbkeys,
86
+ date_min="1950-01-01",
87
+ date_max="2023-03-31"
88
+ )
89
+
90
+ # Prepare data for LOONE
91
+ LOONE_DATA_PREP(input_dir, output_dir)
92
+ ```
@@ -0,0 +1,79 @@
1
+ LOONE_DATA_PREP
2
+ # LOONE_DATA_PREP
3
+
4
+ Prepare data for the LOONE water quality model.
5
+
6
+ Link to LOONE model repository: [https://github.com/osamatarabih/LOONE](https://github.com/osamatarabih/LOONE)
7
+
8
+ ## Prerequisites:
9
+
10
+ * R ([https://www.r-project.org/](https://www.r-project.org/))
11
+ * R packages: dbhydroR, rio, dplyr
12
+
13
+ ## Installation:
14
+
15
+ ```bash
16
+ cd /path/to/loone_data_prep/
17
+ pip install .
18
+ ```
19
+
20
+ ### Examples
21
+
22
+ **From the command line:**
23
+
24
+ ```bash
25
+ # Get flow data
26
+ python -m loone_data_prep.flow_data.get_inflows /path/to/workspace/
27
+ python -m loone_data_prep.flow_data.get_outflows /path/to/workspace/
28
+ python -m loone_data_prep.flow_data.S65E_total /path/to/workspace/
29
+
30
+ # Get water quality data
31
+ python -m loone_data_prep.water_quality_data.get_inflows /path/to/workspace/
32
+ python -m loone_data_prep.water_quality_data.get_lake_wq /path/to/workspace/
33
+
34
+ # Get weather data
35
+ python -m loone_data_prep.weather_data.get_all /path/to/workspace/
36
+
37
+ # Get water level
38
+ python -m loone_data_prep.water_level_data.get_all /path/to/workspace/
39
+
40
+ # Interpolate data
41
+ python -m loone_data_prep.utils interp_all /path/to/workspace/
42
+
43
+ # Prepare data for LOONE
44
+ python -m loone_data_prep.LOONE_DATA_PREP /path/to/workspace/ /path/to/output/directory/
45
+ ```
46
+
47
+ **From Python:**
48
+
49
+ ```python
50
+ from loone_data_prep.utils import get_dbkeys
51
+ from loone_data_prep.water_level_data import hydro
52
+ from loone_data_prep import LOONE_DATA_PREP
53
+
54
+ input_dir = '/path/to/workspace/'
55
+ output_dir = '/path/to/output/directory/'
56
+
57
+ # Get dbkeys for water level data
58
+ dbkeys = get_dbkeys(
59
+ station_ids=["L001", "L005", "L006", "LZ40"],
60
+ category="SW",
61
+ param="STG",
62
+ stat="MEAN",
63
+ recorder="CR10",
64
+ freq="DA",
65
+ detail_level="dbkey"
66
+ )
67
+
68
+ # Get water level data
69
+ hydro.get(
70
+ workspace=input_dir,
71
+ name="lo_stage",
72
+ dbkeys=dbkeys,
73
+ date_min="1950-01-01",
74
+ date_max="2023-03-31"
75
+ )
76
+
77
+ # Prepare data for LOONE
78
+ LOONE_DATA_PREP(input_dir, output_dir)
79
+ ```