-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update rest endpoints, remove v1 geometry * remove cache kwarg * allow printing urls, parse datetimes * update forecast and stats plots * remove samples, fix plots * drop compute from analyze function names * use dictionary comprehension for return periods * move plots to subpackage * use anon requests and check directory exists for table cache * correct handling requests without a reach_id * remove partially implemented plots * correct downloads * update downloading metadata tables * consolidate table download functions * update gitignore * correct parsing dates, calculate simple forecast * update recognized date formats * remove jinja2 dependency * correct plots * specify release candidate version for publishing early versions * forecast stats analysis function * allow retrieving forecasts from aws * filter statistics to complete years * correct dataframe filters * update geoglows capitalization * remove units references * revise location for downloading metadata table * change download protocol from s3 to https * update docs
- Loading branch information
1 parent
e9b463a
commit 42365c3
Showing
53 changed files
with
2,097 additions
and
2,260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ build | |
dev.ipynb | ||
geoglows.egg-info | ||
dist | ||
.pypirc | ||
.pypirc | ||
*.parquet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
================ | ||
geoglows.analyze | ||
================ | ||
|
||
Analyze | ||
~~~~~~~ | ||
Functions which post process results from the streamflow data service into additional, useful products | ||
|
||
.. automodule:: geoglows.analyze | ||
:members: gumbel1, simple_forecast, forecast_stats, daily_averages, monthly_averages, annual_averages, daily_stats, | ||
daily_variance, daily_flow_anomaly, return_periods, low_return_periods |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
============= | ||
geoglows.data | ||
============= | ||
|
||
The data module provides functions for requesting forecasted and historical data river discharge simulations. | ||
The data can be retrieved from the REST data service hosted by ECMWF or it can be retrieved from the repository sponsored | ||
by the AWS Open Data Program. The speed and reliability of the AWS source is typically better than the REST service. | ||
|
||
In general, each function requires a river ID. The name for the ID varies based on the streams network dataset. It is called | ||
LINKNO in GEOGLOWS which uses the TDX-Hydro streams dataset. This is the same as a reach_id or common id (COMID) used previously. | ||
To find a LINKNO (river ID number), please refer to https://data.geoglows.org and browse the tutorials. | ||
|
||
Forecasted Streamflow | ||
--------------------- | ||
|
||
Historical Simulation | ||
--------------------- | ||
|
||
.. automodule:: geoglows.data | ||
:members: | ||
retrospective, return_periods, annual_averages, monthly_averages, daily_averages, | ||
:noindex: | ||
|
||
GEOGLOWS Model Utilities | ||
------------------------ | ||
|
||
.. automodule:: geoglows.data | ||
:members: | ||
metadata_tables | ||
:noindex: |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: pygeoglows | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- python>=3 | ||
- dask | ||
- fastparquet | ||
- requests | ||
- pandas | ||
- plotly>=5 | ||
- jinja2 | ||
- shapely>=2 | ||
- scipy>=1 | ||
- s3fs | ||
- numpy>=1 | ||
- hydrostats | ||
- HydroErr | ||
- xarray | ||
- zarr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
import geoglows.bias | ||
import geoglows.plots | ||
import geoglows.streamflow | ||
import geoglows.analysis | ||
import geoglows.examples | ||
import geoglows._plots as plots | ||
import geoglows.data | ||
import geoglows.analyze | ||
import geoglows.streams | ||
import geoglows.tables | ||
|
||
__all__ = ['bias', 'plots', 'streamflow', 'analysis'] | ||
__version__ = '0.27.1' | ||
from ._constants import METADATA_TABLE_LOCAL_PATH as METADATA_TABLE_PATH | ||
|
||
__all__ = [ | ||
'bias', 'plots', 'data', 'analyze', 'streams', 'tables', | ||
'METADATA_TABLE_PATH' | ||
] | ||
__version__ = '1.0.0' | ||
__author__ = 'Riley Hales' | ||
__license__ = 'BSD 3-Clause Clear License' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import os | ||
|
||
METADATA_TABLE_LOCAL_PATH = os.path.join(os.path.dirname(__file__), 'data', 'metadata-tables.parquet') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from .plots import * | ||
|
||
|
||
__all__ = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from plotly.offline import plot as offline_plot | ||
|
||
|
||
def build_title(main_title, plot_titles: list): | ||
if plot_titles is not None: | ||
main_title += '<br>'.join(plot_titles) | ||
return main_title | ||
|
||
|
||
def return_period_plot_colors(): | ||
return { | ||
'2 Year': 'rgba(254, 240, 1, .4)', | ||
'5 Year': 'rgba(253, 154, 1, .4)', | ||
'10 Year': 'rgba(255, 56, 5, .4)', | ||
'20 Year': 'rgba(128, 0, 246, .4)', | ||
'25 Year': 'rgba(255, 0, 0, .4)', | ||
'50 Year': 'rgba(128, 0, 106, .4)', | ||
'100 Year': 'rgba(128, 0, 246, .4)', | ||
} | ||
|
||
|
||
def plotly_figure_to_html_plot(figure, include_plotlyjs: bool = False, ) -> str: | ||
return offline_plot( | ||
figure, | ||
config={'autosizable': True, 'responsive': True}, | ||
output_type='div', | ||
include_plotlyjs=include_plotlyjs | ||
) |
Oops, something went wrong.