.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery_vignettes/plot_get_characteristics.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_vignettes_plot_get_characteristics.py: View Watershed Characterisitics Using StreamStats =============================================================== .. GENERATED FROM PYTHON SOURCE LINES 6-12 Import Packages ---------------- To get started, download the necessary Python packages. The ``GeoPandas`` package is an open source project that assists in working with geospatial data in Python. Learn more about `GeoPandas `_. .. GENERATED FROM PYTHON SOURCE LINES 12-16 .. code-block:: default import streamstats import geopandas as gpd .. GENERATED FROM PYTHON SOURCE LINES 17-23 Indentify watershed --------------------- To identify a HUC, use a latitude and longitude value to select a specific watershed. Assign cordinates to variables ``lat`` and ``lon``. Using StreamStat's data, assign location to a variable that will represent the delineated watershed using the USGS StreamStats API. .. GENERATED FROM PYTHON SOURCE LINES 23-27 .. code-block:: default lat, lon = 39.966256, -105.482227 ws = streamstats.Watershed(lat=lat, lon=lon) .. GENERATED FROM PYTHON SOURCE LINES 28-36 Find the Hydrologic Unit Code (HUC) of the watershed ----------------------------------------------------- The USGS delineates watershed using a series of numbers based a hierarchal region system. Every watershed is assigned a series of numbers called the hydrological unit code (HUC). StreamStats uses HUC to identify and delineate watersheds. `Learn more `_ about Hydrologic Units . The ``ws.huc`` function will return the HUC of the identified watershed. .. GENERATED FROM PYTHON SOURCE LINES 36-39 .. code-block:: default ws.huc .. rst-class:: sphx-glr-script-out Out: .. code-block:: none '10190005' .. GENERATED FROM PYTHON SOURCE LINES 40-47 Find Characteristics of the watershed -------------------------------------- The function ``ws.characteristics()`` will return the available basin characteristics for the identified watershed.In order to return information on a specific characteristic, use function ``ws.get_characteristic('StatLabel')``. `Learn more `_ about StreamStats Basin Characteristic Definitions. .. GENERATED FROM PYTHON SOURCE LINES 47-53 .. code-block:: default # Available characteristics ws.characteristics # Specific characteristics ws.get_characteristic('DRNAREA') .. rst-class:: sphx-glr-script-out Out: .. code-block:: none {'ID': 0, 'name': 'Drainage Area', 'description': 'Area that drains to a point on a stream', 'code': 'DRNAREA', 'unit': 'square miles', 'value': 38.6} .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 1 minutes 1.674 seconds) .. _sphx_glr_download_gallery_vignettes_plot_get_characteristics.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_get_characteristics.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_get_characteristics.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_