loone-data-prep 0.1.4__tar.gz → 0.1.6__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 (34) hide show
  1. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/LICENSE +1 -1
  2. loone_data_prep-0.1.6/PKG-INFO +112 -0
  3. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/README.md +10 -3
  4. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/LOONE_DATA_PREP.py +1 -1
  5. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/flow_data/forecast_bias_correction.py +19 -1
  6. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/flow_data/get_forecast_flows.py +4 -0
  7. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/utils.py +4 -2
  8. loone_data_prep-0.1.6/loone_data_prep.egg-info/PKG-INFO +112 -0
  9. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep.egg-info/requires.txt +1 -1
  10. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/pyproject.toml +6 -3
  11. loone_data_prep-0.1.4/PKG-INFO +0 -92
  12. loone_data_prep-0.1.4/loone_data_prep.egg-info/PKG-INFO +0 -92
  13. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/GEOGLOWS_LOONE_DATA_PREP.py +0 -0
  14. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/__init__.py +0 -0
  15. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/data_analyses_fns.py +0 -0
  16. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/flow_data/S65E_total.py +0 -0
  17. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/flow_data/__init__.py +0 -0
  18. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/flow_data/get_inflows.py +0 -0
  19. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/flow_data/get_outflows.py +0 -0
  20. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/flow_data/hydro.py +0 -0
  21. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/water_level_data/__init__.py +0 -0
  22. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/water_level_data/get_all.py +0 -0
  23. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/water_level_data/hydro.py +0 -0
  24. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/water_quality_data/__init__.py +0 -0
  25. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/water_quality_data/get_inflows.py +0 -0
  26. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/water_quality_data/get_lake_wq.py +0 -0
  27. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/water_quality_data/wq.py +0 -0
  28. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/weather_data/__init__.py +0 -0
  29. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/weather_data/get_all.py +0 -0
  30. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep/weather_data/weather.py +0 -0
  31. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep.egg-info/SOURCES.txt +0 -0
  32. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep.egg-info/dependency_links.txt +0 -0
  33. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/loone_data_prep.egg-info/top_level.txt +0 -0
  34. {loone_data_prep-0.1.4 → loone_data_prep-0.1.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  BSD-3-Clause License
2
2
 
3
- Copyright (c) 2023 Aquaveo
3
+ Copyright (c) 2024 University of South Florida
4
4
 
5
5
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6
6
 
@@ -0,0 +1,112 @@
1
+ Metadata-Version: 2.1
2
+ Name: loone_data_prep
3
+ Version: 0.1.6
4
+ Summary: Prepare data to run the LOONE model.
5
+ Author-email: Osama Tarabih <osamatarabih@usf.edu>
6
+ Maintainer-email: Michael Souffront <msouffront@aquaveo.com>, James Dolinar <jdolinar@aquaveo.com>
7
+ License: BSD-3-Clause License
8
+
9
+ Copyright (c) 2024 University of South Florida
10
+
11
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
12
+
13
+ - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
14
+ - 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.
15
+ - 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.
16
+
17
+ 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.
18
+
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: rpy2
22
+ Requires-Dist: retry
23
+ Requires-Dist: pandas
24
+ Requires-Dist: scipy
25
+ Requires-Dist: geoglows==0.27.1
26
+
27
+ LOONE_DATA_PREP
28
+ # LOONE_DATA_PREP
29
+
30
+ Prepare data for the LOONE water quality model.
31
+
32
+ Line to the LOONE model: [https://pypi.org/project/loone](https://pypi.org/project/loone)
33
+ Link to LOONE model repository: [https://github.com/Aquaveo/LOONE](https://github.com/Aquaveo/LOONE)
34
+
35
+ ## Prerequisites:
36
+
37
+ * R ([https://www.r-project.org/](https://www.r-project.org/))
38
+ * R packages: dbhydroR, rio, dplyr
39
+
40
+ ## Installation:
41
+
42
+ ```bash
43
+ pip install loone_data_prep
44
+ ```
45
+
46
+ ### Development Installation:
47
+
48
+ ```bash
49
+ cd /path/to/loone_data_prep/repo
50
+ pip install -e .
51
+ ```
52
+
53
+ ### Examples
54
+
55
+ **From the command line:**
56
+
57
+ ```bash
58
+ # Get flow data
59
+ python -m loone_data_prep.flow_data.get_inflows /path/to/workspace/
60
+ python -m loone_data_prep.flow_data.get_outflows /path/to/workspace/
61
+ python -m loone_data_prep.flow_data.S65E_total /path/to/workspace/
62
+
63
+ # Get water quality data
64
+ python -m loone_data_prep.water_quality_data.get_inflows /path/to/workspace/
65
+ python -m loone_data_prep.water_quality_data.get_lake_wq /path/to/workspace/
66
+
67
+ # Get weather data
68
+ python -m loone_data_prep.weather_data.get_all /path/to/workspace/
69
+
70
+ # Get water level
71
+ python -m loone_data_prep.water_level_data.get_all /path/to/workspace/
72
+
73
+ # Interpolate data
74
+ python -m loone_data_prep.utils interp_all /path/to/workspace/
75
+
76
+ # Prepare data for LOONE
77
+ python -m loone_data_prep.LOONE_DATA_PREP /path/to/workspace/ /path/to/output/directory/
78
+ ```
79
+
80
+ **From Python:**
81
+
82
+ ```python
83
+ from loone_data_prep.utils import get_dbkeys
84
+ from loone_data_prep.water_level_data import hydro
85
+ from loone_data_prep import LOONE_DATA_PREP
86
+
87
+ input_dir = '/path/to/workspace/'
88
+ output_dir = '/path/to/output/directory/'
89
+
90
+ # Get dbkeys for water level data
91
+ dbkeys = get_dbkeys(
92
+ station_ids=["L001", "L005", "L006", "LZ40"],
93
+ category="SW",
94
+ param="STG",
95
+ stat="MEAN",
96
+ recorder="CR10",
97
+ freq="DA",
98
+ detail_level="dbkey"
99
+ )
100
+
101
+ # Get water level data
102
+ hydro.get(
103
+ workspace=input_dir,
104
+ name="lo_stage",
105
+ dbkeys=dbkeys,
106
+ date_min="1950-01-01",
107
+ date_max="2023-03-31"
108
+ )
109
+
110
+ # Prepare data for LOONE
111
+ LOONE_DATA_PREP(input_dir, output_dir)
112
+ ```
@@ -3,7 +3,8 @@ LOONE_DATA_PREP
3
3
 
4
4
  Prepare data for the LOONE water quality model.
5
5
 
6
- Link to LOONE model repository: [https://github.com/osamatarabih/LOONE](https://github.com/osamatarabih/LOONE)
6
+ Line to the LOONE model: [https://pypi.org/project/loone](https://pypi.org/project/loone)
7
+ Link to LOONE model repository: [https://github.com/Aquaveo/LOONE](https://github.com/Aquaveo/LOONE)
7
8
 
8
9
  ## Prerequisites:
9
10
 
@@ -13,8 +14,14 @@ Link to LOONE model repository: [https://github.com/osamatarabih/LOONE](https://
13
14
  ## Installation:
14
15
 
15
16
  ```bash
16
- cd /path/to/loone_data_prep/
17
- pip install .
17
+ pip install loone_data_prep
18
+ ```
19
+
20
+ ### Development Installation:
21
+
22
+ ```bash
23
+ cd /path/to/loone_data_prep/repo
24
+ pip install -e .
18
25
  ```
19
26
 
20
27
  ### Examples
@@ -418,7 +418,7 @@ def main(input_dir: str, output_dir: str) -> None:
418
418
  Stg_3A28 = pd.read_csv(f'{input_dir}/Stg_3A28.csv')
419
419
  Stg_3A28 = DF_Date_Range(Stg_3A28, St_Yr, St_M, St_D, En_Yr, En_M, En_D)
420
420
  WCA_Stg = pd.DataFrame(Stg_3A28['date'], columns=['date'])
421
- WCA_Stg['3A-NW'] = Stg_3ANW['3A-NW_STG_ft NGVD29'].values
421
+ WCA_Stg['3A-NW'] = Stg_3ANW.iloc[:, -1].values
422
422
  WCA_Stg['2A-17'] = Stg_2A17.iloc[:, -1].values
423
423
  WCA_Stg['3A-3'] = Stg_3A3.iloc[:, -1].values
424
424
  WCA_Stg['3A-4'] = Stg_3A4.iloc[:, -1].values
@@ -1,4 +1,5 @@
1
1
  import sys
2
+ import os
2
3
  import pandas as pd
3
4
  import geoglows
4
5
 
@@ -12,6 +13,7 @@ def get_bias_corrected_data(
12
13
  observed_data_path: str,
13
14
  station_ensembles: pd.DataFrame,
14
15
  station_stats: pd.DataFrame,
16
+ cache_path: str = None,
15
17
  ) -> dict:
16
18
  # Load the observed data from a CSV file
17
19
  observed_data = pd.read_csv(
@@ -34,7 +36,23 @@ def get_bias_corrected_data(
34
36
  prepared_od = prep_observed_data(observed_data)
35
37
 
36
38
  # Get the historical simulation data for the given reach ID
37
- historical_data = geoglows.streamflow.historic_simulation(reach_id)
39
+ historical_data = None
40
+
41
+ if cache_path is None:
42
+ historical_data = geoglows.streamflow.historic_simulation(reach_id)
43
+ else:
44
+ # Create the geoglows cache directory if it doesn't exist
45
+ geoglows_cache_path = os.path.join(cache_path, 'geoglows_cache')
46
+ if not os.path.exists(geoglows_cache_path):
47
+ os.makedirs(geoglows_cache_path)
48
+
49
+ # Check if the historical simulation data is already cached
50
+ if os.path.exists(os.path.join(geoglows_cache_path, f'{reach_id}_historic_simulation.csv')):
51
+ historical_data = pd.read_csv(os.path.join(geoglows_cache_path, f'{reach_id}_historic_simulation.csv'), index_col=0)
52
+ historical_data.index = pd.to_datetime(historical_data.index)
53
+ else:
54
+ historical_data = geoglows.streamflow.historic_simulation(reach_id)
55
+ historical_data.to_csv(os.path.join(geoglows_cache_path, f'{reach_id}_historic_simulation.csv'))
38
56
 
39
57
  # Correct the forecast bias in the station ensembles
40
58
  station_ensembles = geoglows.bias.correct_forecast(
@@ -366,6 +366,7 @@ def main(
366
366
  forecast_date: str = FORECAST_DATE,
367
367
  bias_corrected: bool = False,
368
368
  observed_data_dir: str | None = None,
369
+ cache_path: str | None = None,
369
370
  ):
370
371
  """Downloads the flow forecasts for the given station ids and writes them
371
372
  out as .csv files.
@@ -379,6 +380,8 @@ def main(
379
380
  Default is False.
380
381
  observed_data_dir (str): The path to the observed flow data directory
381
382
  (only needed if bias_corrected is True).
383
+ cache_path (str): The path to the cache directory for geoglows data.
384
+ Should hold a directory named geoglows_cache that holds the cached files. Use None to not use a cache.
382
385
  """
383
386
  # Local Variables
384
387
  reach_ids = {}
@@ -428,6 +431,7 @@ def main(
428
431
  observed_data_path,
429
432
  station_ensembles,
430
433
  station_stats,
434
+ cache_path,
431
435
  )
432
436
 
433
437
  ensembles_to_csv(
@@ -4,6 +4,7 @@ import datetime
4
4
  import math
5
5
  from glob import glob
6
6
  from calendar import monthrange
7
+ import traceback
7
8
  import numpy as np
8
9
  import pandas as pd
9
10
  from retry import retry
@@ -635,8 +636,9 @@ def nutrient_prediction(
635
636
  predicted_column.columns = [column_name]
636
637
 
637
638
  prediction_columns.append(predicted_column)
638
- except RuntimeWarning:
639
- breakpoint()
639
+ except RuntimeWarning as e:
640
+ print(f"Unexpected RuntimeWarning: {str(e)}")
641
+ traceback.print_exc()
640
642
 
641
643
  # Concat individual ensemble columns together into one pandas DataFrame
642
644
  out_dataframe = pd.concat(objs=prediction_columns, axis="columns")
@@ -0,0 +1,112 @@
1
+ Metadata-Version: 2.1
2
+ Name: loone_data_prep
3
+ Version: 0.1.6
4
+ Summary: Prepare data to run the LOONE model.
5
+ Author-email: Osama Tarabih <osamatarabih@usf.edu>
6
+ Maintainer-email: Michael Souffront <msouffront@aquaveo.com>, James Dolinar <jdolinar@aquaveo.com>
7
+ License: BSD-3-Clause License
8
+
9
+ Copyright (c) 2024 University of South Florida
10
+
11
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
12
+
13
+ - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
14
+ - 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.
15
+ - 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.
16
+
17
+ 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.
18
+
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: rpy2
22
+ Requires-Dist: retry
23
+ Requires-Dist: pandas
24
+ Requires-Dist: scipy
25
+ Requires-Dist: geoglows==0.27.1
26
+
27
+ LOONE_DATA_PREP
28
+ # LOONE_DATA_PREP
29
+
30
+ Prepare data for the LOONE water quality model.
31
+
32
+ Line to the LOONE model: [https://pypi.org/project/loone](https://pypi.org/project/loone)
33
+ Link to LOONE model repository: [https://github.com/Aquaveo/LOONE](https://github.com/Aquaveo/LOONE)
34
+
35
+ ## Prerequisites:
36
+
37
+ * R ([https://www.r-project.org/](https://www.r-project.org/))
38
+ * R packages: dbhydroR, rio, dplyr
39
+
40
+ ## Installation:
41
+
42
+ ```bash
43
+ pip install loone_data_prep
44
+ ```
45
+
46
+ ### Development Installation:
47
+
48
+ ```bash
49
+ cd /path/to/loone_data_prep/repo
50
+ pip install -e .
51
+ ```
52
+
53
+ ### Examples
54
+
55
+ **From the command line:**
56
+
57
+ ```bash
58
+ # Get flow data
59
+ python -m loone_data_prep.flow_data.get_inflows /path/to/workspace/
60
+ python -m loone_data_prep.flow_data.get_outflows /path/to/workspace/
61
+ python -m loone_data_prep.flow_data.S65E_total /path/to/workspace/
62
+
63
+ # Get water quality data
64
+ python -m loone_data_prep.water_quality_data.get_inflows /path/to/workspace/
65
+ python -m loone_data_prep.water_quality_data.get_lake_wq /path/to/workspace/
66
+
67
+ # Get weather data
68
+ python -m loone_data_prep.weather_data.get_all /path/to/workspace/
69
+
70
+ # Get water level
71
+ python -m loone_data_prep.water_level_data.get_all /path/to/workspace/
72
+
73
+ # Interpolate data
74
+ python -m loone_data_prep.utils interp_all /path/to/workspace/
75
+
76
+ # Prepare data for LOONE
77
+ python -m loone_data_prep.LOONE_DATA_PREP /path/to/workspace/ /path/to/output/directory/
78
+ ```
79
+
80
+ **From Python:**
81
+
82
+ ```python
83
+ from loone_data_prep.utils import get_dbkeys
84
+ from loone_data_prep.water_level_data import hydro
85
+ from loone_data_prep import LOONE_DATA_PREP
86
+
87
+ input_dir = '/path/to/workspace/'
88
+ output_dir = '/path/to/output/directory/'
89
+
90
+ # Get dbkeys for water level data
91
+ dbkeys = get_dbkeys(
92
+ station_ids=["L001", "L005", "L006", "LZ40"],
93
+ category="SW",
94
+ param="STG",
95
+ stat="MEAN",
96
+ recorder="CR10",
97
+ freq="DA",
98
+ detail_level="dbkey"
99
+ )
100
+
101
+ # Get water level data
102
+ hydro.get(
103
+ workspace=input_dir,
104
+ name="lo_stage",
105
+ dbkeys=dbkeys,
106
+ date_min="1950-01-01",
107
+ date_max="2023-03-31"
108
+ )
109
+
110
+ # Prepare data for LOONE
111
+ LOONE_DATA_PREP(input_dir, output_dir)
112
+ ```
@@ -2,4 +2,4 @@ rpy2
2
2
  retry
3
3
  pandas
4
4
  scipy
5
- geoglows>=0.27.1
5
+ geoglows==0.27.1
@@ -4,12 +4,15 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "loone_data_prep"
7
- version = "0.1.4"
7
+ version = "0.1.6"
8
8
  description = "Prepare data to run the LOONE model."
9
9
  readme = "README.md"
10
+ license = { file = "LICENSE" }
10
11
  authors = [
12
+ { name = "Osama Tarabih", email = "osamatarabih@usf.edu" },
13
+ ]
14
+ maintainers = [
11
15
  { name = "Michael Souffront", email = "msouffront@aquaveo.com" },
12
16
  { name = "James Dolinar", email = "jdolinar@aquaveo.com" },
13
- { name = "Osama Tarabih", email = "osamatarabih@usf.edu" },
14
17
  ]
15
- dependencies = ["rpy2", "retry", "pandas", "scipy", "geoglows>=0.27.1"]
18
+ dependencies = ["rpy2", "retry", "pandas", "scipy", "geoglows==0.27.1"]
@@ -1,92 +0,0 @@
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
- ```
@@ -1,92 +0,0 @@
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
- ```