Package: hf-hydrodata
hf_hydrodataThehf_hydrodataPython package is a product of theHydroFrame projectand is designed to provide easy access to national hydrologic simulations generated using the National ParFlow model (ParFlow-CONUS1andParFlow-CONUS2) as well as a variety of other gridded model
input datasets and point observations. Some of the datasets provided here are direct observations
(e.g. USGS streamflow observations) while other are model outputs (e.g. ParFlow-CONUS2) or data products
(e.g. remote sensing products).InstallationThe best way to installhf_hydrodatais using pip. This installs our
latest stable release with fully-supported features:pip install hf_hydrodataUsers must create a HydroFrame API account and register their PIN before using thehf_hydrodatapackage. Please seeCreating a HydroFrame API Accountfor detailed instructions.DocumentationYou can view the full package documentation onRead the Docs.
Please see ourPython API Referencefor detail on each core
method.UsageYou can usehf_hydrodatato get access to both gridded and point observation data from various
datasets.You can view the available datasets and variables fromthe documentationor you can get the list of dataset and variables from functions.import hf_hydrodata as hf

datasets = hf.get_datasets()
variables = hf.get_variables({"dataset": "NLDAS2", "grid": "conus1"})You can get gridded data using theget_gridded_data()function.import hf_hydrodata as hf

options = {
  "dataset": "NLDAS2", "variable": "precipitation", "period": "hourly",
  "start_time": "2005-10-1", "end_time": "2005-10-2", "grid_bounds": [100, 100, 200, 200]
}
data = hf.get_gridded_data(options)hf_hydrodatasupports access to a collection of site-level data from a variety of sources using theget_point_data()function.The below syntax will return daily USGS streamflow data from January 1, 2022 through January 5, 2022
for sites that are within the bounding box with latitude bounds of (45, 50) and longitude bounds
of (-75, -50).from hf_hydrodata import get_point_data, get_point_metadata

data_df = get_point_data(
                     dataset = "usgs_nwis",
                     variable = "streamflow",
                     temporal_resolution = "daily",
                     aggregation = "mean",
                     date_start = "2022-01-01", 
                     date_end = "2022-01-05",
                     latitude_range = (45, 50),
                     longitude_range = (-75, -50)
                     )
data_df.head(5)

# Get the metadata about the sites with returned data
metadata_df = get_point_metadata(
                     dataset = "usgs_nwis",
                     variable = "streamflow",
                     temporal_resolution = "daily",
                     aggregation = "mean",
                     date_start = "2022-01-01", 
                     date_end = "2022-01-05",
                     latitude_range = (45, 50),
                     longitude_range = (-75, -50)
                     )
metadata_df.head(5)Build InstructionsTo build the component you must have a Python virtual environment containing
the required components. Install the required components with:pip install -r requirements.txtEdit the Python components insrc/hf_hydrodataand the unit tests intests/hf_hydrodataand the data catalog model CSV files insrc/hf_hydrodata/model.
Use Excel to edit the CSV files so that files are saved in standard CSV format.Generate the documentation with:cd docs
make htmlThis will validate the model CSV files and
generate the read-the-docs html into the html folder.LicenseCopyright © 2023 The Trustees of Princeton University and The Arizona Board of Regents on behalf of The University of Arizona. All rights reserved.hf_hydrodatawas created by William M. Hasling, Laura Condon, Reed Maxwell, George Artavanis, Will Lytle, Amy M. Johnson, Amy C. Defnet. It is licensed under the terms of the MIT license. For details, see theLICENSEfile.Data Use PolicyThe software is licenced under MIT licence, but the data is controlled by aData Use Policy.Report an IssueIf you have a question about our code or find an issue, please create a GitHub Issue with enough information for us to reproduce what you are seeing.ContributeIf you would like to contribute tohf_hydrodata, please open a GitHub Issue with a description of your plan to initiate a conversation with our development team. Then detailed implementation review will be done via a Pull Request.