Working with Point Observations

The hf_hydrodata.point module provides tools to access point measurements of a variety of hydrologic variables from a multiple observation networks. All source data comes from public sources that have been compiled in order for users to access the data with a single common Python syntax. Refer to Datasets for the complete list of point observations datasets available and for more details on each dataset. Please also see Point Observation Methods for descriptions of the available methods.

Point Observation Methods

Filter Parameters

The point observation functions accept filter parameters that identify data using attributes that index the data. These filter parameters may be passed by name or using a python dict with filter parameters options. All the files are organized by dataset, variable, temporal_resolution, and aggregation (see Datasets).

You can pass filter parameter using named parameters.

from hf_hydrodata import get_point_data

data_df = get_point_data(dataset = "usgs_nwis", variable = "streamflow",
                         temporal_resolution = "daily", aggregation = "mean",
                         start_date = "2022-01-01", end_date = "2022-01-05",
                         latitude_range = (45, 50),
                         longitude_range = (-75, -50))

You use pass filter parameters as dict options as well.

from hf_hydrodata import get_point_data

my_parameters = {"dataset": "usgs_nwis", "variable": "streamflow",
                 "temporal_resolution": "daily", "aggregation": "mean",
                 "start_date": "2022-01-01", "end_date": "2022-01-05",
                 "latitude_range": (45, 50), "longitude_range": (-75, -50)}

data_df = get_point_data(my_parameters)

See the Python API Refererence and Datasets for a list of all the filter parameters that may be provided. The How To also provides a range of examples for querying point observations data.

Metadata Descriptions

You can get metadata about the point observations in hydrodata using the get_point_metadata function.

from hf_hydrodata import get_point_data

my_parameters = {"dataset": "usgs_nwis", "variable": "streamflow",
                 "temporal_resolution": "daily", "aggregation": "mean",
                 "start_date": "2022-01-01", "end_date": "2022-01-05",
                 "latitude_range": (45, 50), "longitude_range": (-75, -50)}

metadata_df = get_point_metadata(my_parameters)

See Point Observations Metadata for documentation of the metadata returned by get_point_metadata.

How To

The following notebooks provide examples for using the various methods in the hf_hydrodata.point module. Each of these notebooks contains a "Launch Binder" button that can be used to run in an interactive session via Binder. Alternately, you may navigate to a specific notebook in the GitHub repository and press the download button to download the notebook and run it locally.