From 6d1ad8ec69afe9579aa98e6eab79f7037b0d1bb9 Mon Sep 17 00:00:00 2001 From: Elise Hinman Date: Tue, 23 Jul 2024 20:57:38 -0500 Subject: [PATCH 1/5] address typos Andy found --- .../examples/flow_duration_curve_examples.rst | 2 +- docs/source/meta/calculations.rst | 16 +++++++++------- .../regional_runoff_calculations.ipynb | 17 +++++++++-------- example_notebooks/single_gage_analysis.ipynb | 10 +++++----- .../site_conditions_examples.ipynb | 5 +---- hyswap/utils.py | 2 +- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/docs/source/examples/flow_duration_curve_examples.rst b/docs/source/examples/flow_duration_curve_examples.rst index e0ba7c8..8be6c34 100644 --- a/docs/source/examples/flow_duration_curve_examples.rst +++ b/docs/source/examples/flow_duration_curve_examples.rst @@ -3,7 +3,7 @@ Flow Duration Curves -------------------- These examples show how flow duration curves can be constructed by fetching data from NWIS using `dataretrieval`, analyzing that data using functions provided by `hyswap` (:obj:`hyswap.exceedance.calculate_exceedance_probability_from_values_multiple`), and then plotted using another `hyswap` function (:obj:`hyswap.plots.plot_flow_duration_curve`). -For more information on flow duration curves, see the USGS report titled "Flow-duration curves" by James K. Searcy and published in 1959 (https://doi.org/10.3133/wsp1542A). +For more information on flow duration curves, see the 1959 USGS report by James K. Searcy, titled ["Flow-duration curves"](https://doi.org/10.3133/wsp1542A). Creating a Flow Duration Curve for Site 01646500 diff --git a/docs/source/meta/calculations.rst b/docs/source/meta/calculations.rst index 2f12b1f..9d7ae7a 100644 --- a/docs/source/meta/calculations.rst +++ b/docs/source/meta/calculations.rst @@ -6,6 +6,7 @@ A quick-reference guide to the common types of calculations performed within the Assumptions and Caveats ----------------------- The ``hyswap`` package functions assume that provided streamflow data has been quality controlled. No checks on incorrect, missing, or negative values are performed. Users should perform any necessary QA/QC checks on the data prior to using ``hyswap`` functions. Additionally, ``hyswap`` does not detect artifacts or shifts in streamflow data that potentially violate statistical methods, such as: + - negative flows associated with tidal-influenced locations or other phenomena - regulated flows or transitions from regulated to unregulated flows (or vice versa) - major watershed changes @@ -58,7 +59,7 @@ Streamflow percentiles are a core calculation of ``hyswap`` that are used to det | | the year. | +---------------------------+-------------------------------------------+ -By default, ``hyswap`` computes streamflow percentiles using the unbiased Weibull plotting position formula, :math:`i/(n+1)`, where *i* is the rank of an observation and *n* is the sample size (Weibull, 1939). The Weibull formula has been the standard approach used by hydrologists for generating flow-duration and flood-frequency curves `(Helsel and others, 2020)`_. Weibull plotting position does not set values to either 0 or 100, recognizing the existence of a non-zero probablity of exceeding the maximum or minimum observed value. For further discussion of plotting positions refer to `(Helsel and others, 2020)`_. +By default, ``hyswap`` computes streamflow percentiles using the unbiased Weibull plotting position expression, :math:`i/(n+1)`, where *i* is the rank of an observation and *n* is the sample size (Weibull, 1939). The Weibull formula has been the standard approach used by hydrologists for generating flow-duration and flood-frequency curves `(Helsel and others, 2020)`_. Weibull plotting position does not set values to either 0 or 100, recognizing the existence of a non-zero probablity of exceeding the maximum or minimum observed value. For further discussion of plotting positions refer to `(Helsel and others, 2020)`_. ``hyswap`` uses the ``numpy.percentile()`` implementation of the Weibull method (Type 6) for calculating percentiles. Additional methods of computing percentiles that exist in the ``numpy.percentile()`` function can be used in ``hyswap``. Users can refer to the `numpy function documentation `_ for additional details. @@ -75,42 +76,42 @@ Flow Categorization ^^^^^^^^^^^^^^^^^^^ Streamflow observations at a streamgage can be assigned a flow condition category using ``hyswap`` by use of the `hyswap` :obj:`hyswap.utils.categorize_flows` function. Streamflow percentiles or interpolated estimated streamflow percentiles are compared to a categorization schema. Multiple categorization schema are available in ``hyswap`` with the default being flow categories similar to those displayed on the USGS National Water Dashboard. Categorization schema are applicable to both variable and fixed percentile types. Available schema are described below: -* "NWD" -- Categorization schema similar to the USGS National Water Dashboard, *default* +"NWD" -- Categorization schema similar to the USGS National Water Dashboard, *default* Categorizes streamflow across all range of possible streamflow magnitudes. Typically used with variable percentiles .. image:: ../reference/nwd.png :width: 800 :alt: Categorization schema of percentile ranges, labels, and color palette similar to the National Water Dashboard. -* "WaterWatch" -- Categorization schema similar to the USGS WaterWatch website +"WaterWatch" -- Categorization schema similar to the USGS WaterWatch website Categorizes streamflow across all range of possible streamflow magnitudes. Typically used with variable percentiles .. image:: ../reference/waterwatch.png :width: 800 :alt: Categorization schema of percentile ranges, labels, and color palette similar to USGS WaterWatch. -* "NIDIS_Drought" -- Categorization schema similar to the NIDIS U.S. Drought Monitor +"NIDIS_Drought" -- Categorization schema similar to the NIDIS U.S. Drought Monitor Categorizes streamflow across only low-flow conditions. .. image:: ../reference/nidis_drought.png :width: 800 :alt: Categorization schema of percentile ranges, labels, and color palette similar to NIDIS U.S. Drought Monitor. -* "WaterWatch_Drought" -- Categorization schema similar to the USGS WaterWatch Drought Conditions +"WaterWatch_Drought" -- Categorization schema similar to the USGS WaterWatch Drought Conditions Categorizes streamflow across only low-flow conditions. Typically used with variable percentiles .. image:: ../reference/waterwatch_drought.png :width: 800 :alt: Categorization schema of percentile ranges, labels, and color palette similar to USGS WaterWatch Drought Conditions. -* "WaterWatch_Flood" -- Categorization schema similar to the USGS WaterWatch Flood Conditions +"WaterWatch_Flood" -- Categorization schema similar to the USGS WaterWatch Flood Conditions Categorizes streamflow across only high-flow conditions. Typically used with fixed percentiles .. image:: ../reference/waterwatch_flood.png :width: 800 :alt: Categorization schema of percentile ranges, labels, and color palette similar to USGS WaterWatch Flood Conditions. -* "WaterWatch_BrownBlue" -- Categorization schema similar to the USGS WaterWatch categories but with an alternative color palette +"WaterWatch_BrownBlue" -- Categorization schema similar to the USGS WaterWatch categories but with an alternative color palette Categorizes streamflow across all range of possible streamflow magnitudes. Typically used with variable percentiles .. image:: ../reference/waterwatch_brownblue.png @@ -145,6 +146,7 @@ After obtaining a table of intersecting HUC8s and streamgage basins, the next st 1. For each unit of time with runoff data at one or more streamgages whose basins intersect the HUC8, obtain a weighted average of all runoff values. 2. If a HUC8 and a streamgage basin have near perfect overlap (e.g. the proportion of the HUC8's area in the basin is greater than 0.9 and the proportion of the basin's area in the HUC8 is greater than 0.9), simply use the runoff values from that streamgage basin. If perfect overlap does not exist, use a weighted average of runoff values from: + (a) all streamgage basins *contained* by the HUC8, and (b) the smallest streamgage basin that *contains* the HUC8 diff --git a/example_notebooks/regional_runoff_calculations.ipynb b/example_notebooks/regional_runoff_calculations.ipynb index 754bc8f..f77ab47 100644 --- a/example_notebooks/regional_runoff_calculations.ipynb +++ b/example_notebooks/regional_runoff_calculations.ipynb @@ -19,7 +19,9 @@ "\n", "This example notebook relies on use of the [dataretrieval](https://github.com/DOI-USGS/dataRetrieval) package for downloading streamflow information from USGS NWIS.\n", "\n", - "Hydrologic units will be referred to as \"hucs\" and the drainage area captured by a streamflow gage will be referred to as a \"basin\". " + "Hydrologic units will be referred to as \"hucs\" and the drainage area captured by a streamflow gage will be referred to as a \"basin\".\n", + "\n", + "Please note that warnings in this notebook have been silenced to economize space in the documentation pages, but it is recommended to comment out this line for individual use." ] }, { @@ -35,7 +37,7 @@ "import matplotlib.patches\n", "from pynhd import WaterData\n", "import warnings\n", - "warnings.filterwarnings('ignore') # ignore warnings from dataretrieval" + "warnings.filterwarnings('ignore')" ] }, { @@ -195,7 +197,7 @@ "metadata": {}, "source": [ "### Download gage data\n", - "Let's try using `query_nwis_runoff_data` to download streamflow data and convert it to runoff (in mm/day) from 2013-2023 for our selected huc '07090001'. Note that not all gage sites listed in `basins_overlap_single_huc` will necessarily have data for the date range specified." + "Let's try using `query_nwis_runoff_data` to download streamflow data and convert it to runoff (in mm/day) from 2013-2023 for our selected huc '17010209'. Note that not all gage sites listed in `basins_overlap_single_huc` will necessarily have data for the date range specified." ] }, { @@ -207,7 +209,7 @@ "df_nwis_ro_data = query_nwis_runoff_data(basins_overlap_single_huc,\n", "start_date = start_date,\n", "end_date = end_date)\n", - "display(df_nwis_ro_data[df_nwis_ro_data['site_no'] == '06078500'])" + "df_nwis_ro_data.head()" ] }, { @@ -215,7 +217,7 @@ "metadata": {}, "source": [ "### Estimate runoff for the huc\n", - "With daily basin runoff data in hand, we are ready to estimate runoff for the huc in mm/day. Please reference `hyswap`'s Calculations page to understand how runoff is estimated using this function. Briefly, this function identifies basins contained within the huc and basins that contain the huc that have runoff data for the entire time period in the dataset. It then estimates a weighted mean runoff value for each day using applicable and available basins. If `clip_downstream_basins` is set to True, the function only uses the smallest basin that contains the huc and disregards downstream gages that represent larger basins that contain the huc. This example will loop through each water year and estimate runoff using basins with complete records for each water year." + "With daily basin runoff data in hand, we are ready to estimate runoff for the huc in mm/day. Please reference `hyswap`'s [Calculations](https://doi-usgs.github.io/hyswap/meta/calculations.html) page to understand how runoff is estimated using this function. Briefly, this function identifies basins contained within the huc and basins that contain the huc that have runoff data for the entire time period in the dataset. It then estimates a weighted mean runoff value for each day using applicable and available basins. If `clip_downstream_basins` is set to True, the function only uses the smallest basin that contains the huc and disregards downstream gages that represent larger basins that contain the huc. This example will loop through each water year and estimate runoff using basins with complete records for each water year." ] }, { @@ -233,12 +235,11 @@ " \n", " # loop through each water year\n", "for year, df_year in df_nwis_ro_data.groupby(df_nwis_ro_data.water_year):\n", - " df_nwis_ro_data_sub = df_nwis_ro_data[df_nwis_ro_data['water_year'] == year]\n", "\n", - " # estimate runoff for each water year of data\n", + " # estimate runoff for each water year of data\n", " single_huc_runoff = hyswap.calculate_geometric_runoff(\n", " geom_id=single_huc,\n", - " runoff_df=df_nwis_ro_data_sub,\n", + " runoff_df=df_year,\n", " geom_intersection_df=intersection_table_full,\n", " site_col='da_site_no',\n", " geom_id_col='huc_id',\n", diff --git a/example_notebooks/single_gage_analysis.ipynb b/example_notebooks/single_gage_analysis.ipynb index 6c88866..4151802 100644 --- a/example_notebooks/single_gage_analysis.ipynb +++ b/example_notebooks/single_gage_analysis.ipynb @@ -15,7 +15,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "This notebook provides a demonstration of the use of [hywsap](https://doi-usgs.github.io/hyswap/) python package for analyzing streamflow conditions at a single streamgage including plotting of flow duration curves, duration hydrographs, and cumulative streamflow. \n", + "This notebook provides a demonstration of the use of [hyswap](https://doi-usgs.github.io/hyswap/) python package for analyzing streamflow conditions at a single streamgage including plotting of flow duration curves, duration hydrographs, and cumulative streamflow. \n", "\n", "This example notebook relies on use of the [dataretrieval](https://github.com/DOI-USGS/dataRetrieval) package for downloading streamflow information from USGS NWIS\n" ] @@ -178,7 +178,7 @@ "metadata": {}, "outputs": [], "source": [ - "# calcualte summary statistics on only approved data (quality-assured data that may be published and used in statistical analsysis)\n", + "# calculate summary statistics on only approved data (quality-assured data that may be published and used in statistical analsysis)\n", "summary_stats = hyswap.calculate_summary_statistics(approved_flow_data)" ] }, @@ -196,8 +196,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "To view long-term patterns and trends in streamflow, raster hydrographs can be plotted using `hyswap`\n", - "Here, let's utilize a raster hydrograph to see the historical flow at the site from the pst 50 years (1973-2023)" + "To view long-term patterns and trends in streamflow, raster hydrographs can be plotted using `hyswap`.\n", + "Here, let's utilize a raster hydrograph to see the historical flow at the site from the past 50 years (1973-2023)" ] }, { @@ -271,7 +271,7 @@ "## Analyze annual streamflow through cumulative flow and flow duration curves \n", "Use calculations of streamflow percentiles (variable by day) to analyze annual patterns in streamflow\n", "\n", - "Let's look at the last four years (2020-2023) of cumulative streamflow by plotting a cumulative hydrographs of different water years along with the envelope that 90% of annual cumulative streamflow is expected to be within, and the years with the minimum and maximum annual cumulative streamflows." + "Let's look at the last four years (2020-2023) of cumulative streamflow by plotting cumulative hydrographs of different water years along with the envelope that 90% of annual cumulative streamflow is expected to be within, and the years with the minimum and maximum annual cumulative streamflows." ] }, { diff --git a/example_notebooks/site_conditions_examples.ipynb b/example_notebooks/site_conditions_examples.ipynb index d8c89c9..72ddc38 100644 --- a/example_notebooks/site_conditions_examples.ipynb +++ b/example_notebooks/site_conditions_examples.ipynb @@ -143,10 +143,7 @@ "metadata": {}, "source": [ "## Data Downloading and Processing\n", - "Utilize an example state to select streamgages for generating various flow condition maps. Certain past days selected in the notebook are relevant to using the state of Vermont (VT) as an example, but the notebook can be run for any state.\n", - "\n", - "### Find all stream sites active in the last year within a State\n", - "Limit the search to streamgages that have also been operational prior to approximately 10 years ago as a minimum of 10 years of flow records should be available for calculating streamflow percentiles." + "Utilize an example state to select streamgages for generating various flow condition maps. Certain past days selected in the notebook are relevant to using the state of Vermont (VT) as an example, but the notebook can be run for any state. Next, find all stream sites active in the last year within the state." ] }, { diff --git a/hyswap/utils.py b/hyswap/utils.py index 0818038..a70312d 100644 --- a/hyswap/utils.py +++ b/hyswap/utils.py @@ -53,7 +53,7 @@ def rolling_average(df, data_column_name, data_type, and uses the data_type argument ('1D', '7D', '14D', '28D') to set the `min_periods` argument in `pandas.DataFrame.rolling`. The function returns NaN values if any of the values in the window are NaN or if the - `mind_periods` argument is not satisifed. Properties of the windowing + `min_periods` argument is not satisifed. Properties of the windowing can be changed by passing additional keyword arguments which are fed to `pandas.DataFrame.rolling`. From 6812595ed69cb63362083993f53f9eee7e531eb9 Mon Sep 17 00:00:00 2001 From: Elise Hinman Date: Tue, 23 Jul 2024 21:11:29 -0500 Subject: [PATCH 2/5] address Courtney's typo catches --- docs/source/examples/cumulative_hydrograph_examples.rst | 4 ---- docs/source/examples/percentile_calculation_examples.rst | 2 +- docs/source/examples/similarity_examples.rst | 2 +- docs/source/meta/calculations.rst | 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/docs/source/examples/cumulative_hydrograph_examples.rst b/docs/source/examples/cumulative_hydrograph_examples.rst index 9bfd747..f2bf61e 100644 --- a/docs/source/examples/cumulative_hydrograph_examples.rst +++ b/docs/source/examples/cumulative_hydrograph_examples.rst @@ -19,10 +19,6 @@ In this example we will fetch 20 years of data from a single site and then use t df, md = dataretrieval.nwis.get_dv( '06803495', start='2001-01-01', end='2021-12-31') -.. plot:: - :context: - :include-source: - # plot the cumulative streamflow hydrograph fig, ax = plt.subplots(figsize=(8, 5)) ax = hyswap.plots.plot_cumulative_hydrograph( diff --git a/docs/source/examples/percentile_calculation_examples.rst b/docs/source/examples/percentile_calculation_examples.rst index 212731d..5ebca77 100755 --- a/docs/source/examples/percentile_calculation_examples.rst +++ b/docs/source/examples/percentile_calculation_examples.rst @@ -12,7 +12,7 @@ Calculating Historic Percentiles for One Site The :obj:`hyswap.percentiles.calculate_fixed_percentile_thresholds` function is used to calculate a set of percentile thresholds given a set of data. This function simply calculates one set of fixed percentile thresholds using all available data, -and is not intended to be used for calculating percentile thresholds separatly for individual days of the year. +and is not intended to be used for calculating percentile thresholds separately for individual days of the year. By default this method calculates percentiles using the Weibull distribution with an alpha parameter of 0 and a beta parameter of 0. The Weibull diff --git a/docs/source/examples/similarity_examples.rst b/docs/source/examples/similarity_examples.rst index 54a8ecc..4724345 100644 --- a/docs/source/examples/similarity_examples.rst +++ b/docs/source/examples/similarity_examples.rst @@ -4,7 +4,7 @@ Similarity Measures Sometimes it is helpful to compare the relationships between a set of streamgaging stations and their respective measurements. These examples showcase the usage of the functions in the `similarity` module to quantify how similar streamflow records are across multiple streamgages. Matrices of similarity measures (e.g., correlations) are calculated and visualized by generating heatmap visualizations via the :obj:`hyswap.plots.plot_similarity_heatmap` function. -The `similarity` functions packaged in `hyswap` handle some of the data clean-up for you by ensuring the time-series of observations being compared acros the same dates, and by removing any missing data. This ensures that your results are not skewed by missing data or gaps in one of the time-series. +The `similarity` functions packaged in `hyswap` handle some of the data clean-up for you by ensuring the time-series observations are compared across the same dates, and by removing any missing data. This ensures that your results are not skewed by missing data or gaps in one of the time-series. Pearson's *r* Correlations Between 5 Stations diff --git a/docs/source/meta/calculations.rst b/docs/source/meta/calculations.rst index 9d7ae7a..9a22000 100644 --- a/docs/source/meta/calculations.rst +++ b/docs/source/meta/calculations.rst @@ -5,7 +5,7 @@ A quick-reference guide to the common types of calculations performed within the Assumptions and Caveats ----------------------- -The ``hyswap`` package functions assume that provided streamflow data has been quality controlled. No checks on incorrect, missing, or negative values are performed. Users should perform any necessary QA/QC checks on the data prior to using ``hyswap`` functions. Additionally, ``hyswap`` does not detect artifacts or shifts in streamflow data that potentially violate statistical methods, such as: +The ``hyswap`` package functions assume that provided streamflow data are quality controlled. No checks on incorrect, missing, or negative values are performed. Users should perform any necessary QA/QC checks on the data prior to using ``hyswap`` functions. Additionally, ``hyswap`` does not detect artifacts or shifts in streamflow data that potentially violate statistical methods, such as: - negative flows associated with tidal-influenced locations or other phenomena - regulated flows or transitions from regulated to unregulated flows (or vice versa) From 98be851ea9e660353f22320c3694a1c12e5ecf46 Mon Sep 17 00:00:00 2001 From: Elise Hinman Date: Tue, 23 Jul 2024 22:10:31 -0500 Subject: [PATCH 3/5] address joe's typo catches --- docs/source/meta/calculations.rst | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/source/meta/calculations.rst b/docs/source/meta/calculations.rst index 9a22000..83efc28 100644 --- a/docs/source/meta/calculations.rst +++ b/docs/source/meta/calculations.rst @@ -7,11 +7,11 @@ Assumptions and Caveats ----------------------- The ``hyswap`` package functions assume that provided streamflow data are quality controlled. No checks on incorrect, missing, or negative values are performed. Users should perform any necessary QA/QC checks on the data prior to using ``hyswap`` functions. Additionally, ``hyswap`` does not detect artifacts or shifts in streamflow data that potentially violate statistical methods, such as: -- negative flows associated with tidal-influenced locations or other phenomena -- regulated flows or transitions from regulated to unregulated flows (or vice versa) -- major watershed changes +* negative flows associated with tidal-influenced locations or other phenomena +* regulated flows or transitions from regulated to unregulated flows (or vice versa) +* major watershed changes -For users who are applying ``hyswap`` functions directly to data retrieved from USGS NWIS, please be aware that non-standard parameter names occasionally occur. Reasons for this could be to indicate that a site has an upstream and downstream sensor, a sensor was moved in the water column, or a site was measured multiple times. This package treats sites with non-standard parameter names as outliers and skips those sites. Users should take appropriate steps to check for non-standard parameter names and determine appropriate data handling steps based on their needs. +For users who are applying ``hyswap`` functions directly to data retrieved from USGS NWIS, please be aware that non-standard parameter names occasionally occur (e.g. `00060_2_Mean` or `00060_incorrect_Mean` instead of simply `00060_Mean`). Reasons for this could be to indicate that a site has an upstream and downstream sensor, a sensor was moved in the water column, or a site was measured multiple times. This package treats sites with non-standard parameter names as outliers and skips those sites. Users should take appropriate steps to check for non-standard parameter names and determine appropriate data handling steps based on their needs. Streamflow Percentiles ---------------------- @@ -133,11 +133,11 @@ The calculation of area-based runoff in ``hyswap`` involves the steps described Workflow for Associating Streamgages with HUC8s for Area-Based Runoff Calculations ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Spatial datasets describing the respective drainage basin boundaries of the streamgages and the boundaries of hydrologic cataloging units must be obtained that cover all areas of interest (e.g. CONUS). Geospatial boundaries of streamgages may be based on delineated gage drainage areas calculated using NHDPlus Version 1 data `(U.S. Geological Survey, 2011)`_ or determined via other watershed delineation approaches. HUC8 boundaries are contained within the `USGS Watershed Boundary Dataset (WBD) `_. +Spatial datasets describing the respective drainage basin boundaries of the streamgages and the boundaries of hydrologic cataloging units must be obtained that cover all areas of interest (e.g. CONUS). Geospatial boundaries of streamgages may be based on delineated gage drainage areas calculated using NHDPlus Version 1 data `(U.S. Geological Survey, 2011)`_ or determined via other watershed delineation approaches. HUC8 boundaries are contained within the `USGS Watershed Boundary Dataset (WBD) `_. Check out the `HyRiver `_ software stack for APIs to access NHDPlus and WBD data products. Each geospatial streamgage drainage basin boundary is overlain on a geospatial dataset of HUC8s (the polygons outlined in thick gray-brown lines in Figure 1 example) to determine the area of intersection within the two datasets. For each overlapping area of HUC8s and streamgage drainage basin boundaries, the fraction of the basin in the HUC8 and the fraction of the HUC8 in the basin are calculated. These fractions are then multiplied by each other to compute a weighting factor for each basin in the runoff calculation. -You can find an example intersection dataset between CONUS HUC8s and streamgage basins in the `hyswap-example-notebooks repository `_. This intersection dataset was created using the `surface water geospatial data assembly repository `_. +You can find an example intersection dataset between CONUS HUC8s and streamgage basins in the `example_data `_ folder within the `example_notebooks` folder of this repository. This intersection dataset was created using the `hyswap geospatial data assembly repository `_. Workflow for Estimating Area-Based Runoff ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -152,6 +152,8 @@ After obtaining a table of intersecting HUC8s and streamgage basins, the next st Note that in cases where there is near perfect overlap for multiple streamgage basins and a HUC8, the streamgage basin-HUC8 intersection with the *highest* weight is used to estimate runoff. This is the same method used to determine the smallest streamgage basin that contains the HUC8: among all the streamgage basins that contain the HUC8 (in other words, the proportion of the HUC8's area in the streamgage basins is roughly 1), find the HUC8-streamgage basin intersection with the highest weight (which means the proportion of the streamgage basin's area in the HUC8 is the largest). See Figure 1 for an example of this workflow. Note that in Figure 1, 'Fraction#' is analogous to 'proportion of shape X's area in shape Y'. +An example Jupyter notebook exemplifying this workflow is available for `download `_ from the hyswap repository and can be viewed within the ``hyswap`` `documentation `_. + .. image:: ../reference/huc8_runoff_example.gif :width: 600 :alt: Map and table that provide an example of the computation of area-based runoff for a given HUC. From bda62643c0f5333b811b7b990c7a294dbec566d8 Mon Sep 17 00:00:00 2001 From: Elise Hinman Date: Wed, 24 Jul 2024 10:11:02 -0500 Subject: [PATCH 4/5] small typo fixes --- .gitignore | 15 ++++----------- .../examples/flow_duration_curve_examples.rst | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index fd2525d..7e195dd 100644 --- a/.gitignore +++ b/.gitignore @@ -56,17 +56,17 @@ cover/ *.mo *.pot -# Django stuff: +# Django: *.log local_settings.py db.sqlite3 db.sqlite3-journal -# Flask stuff: +# Flask: instance/ .webassets-cache -# Scrapy stuff: +# Scrapy: .scrapy # Sphinx documentation @@ -114,7 +114,7 @@ ipython_config.py # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm __pypackages__/ -# Celery stuff +# Celery: celerybeat-schedule celerybeat.pid @@ -154,13 +154,6 @@ dmypy.json # Cython debug symbols cython_debug/ -# PyCharm -# JetBrains specific template is maintained in a separate JetBrains.gitignore that can -# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore -# and can be added to the global gitignore or merged into this file. For a more nuclear -# option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ - # MacOS *.DS_Store diff --git a/docs/source/examples/flow_duration_curve_examples.rst b/docs/source/examples/flow_duration_curve_examples.rst index 8be6c34..502013e 100644 --- a/docs/source/examples/flow_duration_curve_examples.rst +++ b/docs/source/examples/flow_duration_curve_examples.rst @@ -3,7 +3,7 @@ Flow Duration Curves -------------------- These examples show how flow duration curves can be constructed by fetching data from NWIS using `dataretrieval`, analyzing that data using functions provided by `hyswap` (:obj:`hyswap.exceedance.calculate_exceedance_probability_from_values_multiple`), and then plotted using another `hyswap` function (:obj:`hyswap.plots.plot_flow_duration_curve`). -For more information on flow duration curves, see the 1959 USGS report by James K. Searcy, titled ["Flow-duration curves"](https://doi.org/10.3133/wsp1542A). +For more information on flow duration curves, see the 1959 USGS report by James K. Searcy, titled `"Flow-duration curves" `_. Creating a Flow Duration Curve for Site 01646500 From 40540c1f55d89d25d2a4de11731de5c0a79227df Mon Sep 17 00:00:00 2001 From: Elise Hinman Date: Wed, 24 Jul 2024 10:18:23 -0500 Subject: [PATCH 5/5] change link to WBD --- docs/source/meta/calculations.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/meta/calculations.rst b/docs/source/meta/calculations.rst index 83efc28..1b7a9c0 100644 --- a/docs/source/meta/calculations.rst +++ b/docs/source/meta/calculations.rst @@ -220,7 +220,7 @@ Ziel, F., 2021. The energy distance for ensemble and scenario reduction, Phil, T .. _(Brakebill and others, 2011): https://doi.org/10.1111/j.1752-1688.2011.00578.x .. _(Helsel and others, 2020): https://doi.org/10.3133/tm4A3 -.. _(Jones and others, 2022): https://doi.org/10.3133/tm11A3 +.. _(Jones and others, 2022): https://pubs.usgs.gov/tm/11/a3/ .. _(Magyar & Sambridge, 2023): https://doi.org/10.5194/hess-27-991-2023 .. _(U.S. Geological Survey, 2011): https://water.usgs.gov/lookup/getspatial?streamgagebasins .. _(U.S. Geological Survey, 2023): http://dx.doi.org/10.5066/F7P55KJN