Skip to content

Add waterdata.get_field_measurements_metadata#268

Merged
thodson-usgs merged 1 commit intoDOI-USGS:mainfrom
thodson-usgs:add-field-measurements-metadata
May 6, 2026
Merged

Add waterdata.get_field_measurements_metadata#268
thodson-usgs merged 1 commit intoDOI-USGS:mainfrom
thodson-usgs:add-field-measurements-metadata

Conversation

@thodson-usgs
Copy link
Copy Markdown
Collaborator

Adds a thin wrapper around the OGC /collections/field-measurements-metadata collection. Returns one row per (location, parameter) field-measurement series describing its period of record, units, etc., without the underlying observations — that's what get_field_measurements is for.

Discrete-measurement analogue to get_time_series_metadata (which describes daily / continuous series). Primary use case is inventory queries: "what field-measurement parameters does this site have, and over what date range?"

Implementation

Mirrors R's read_waterdata_field_meta, with the same output_id ("field_series_id") and parameter list. Body is the standard service-agnostic dispatch through get_ogc_data — no new infrastructure required.

Live API examples (verified)

from dataretrieval.waterdata import get_field_measurements_metadata

# All series at a surface-water site
df, md = get_field_measurements_metadata(monitoring_location_id="USGS-02238500")
# 2 rows: parameter_code 00060 (discharge) and 00065 (gage height),
# both with begin in 1943 and end in 2026.

# Multi-site narrowed to discharge
df, md = get_field_measurements_metadata(
    monitoring_location_id=["USGS-07069000", "USGS-07064000", "USGS-07068000"],
    parameter_code="00060",
)
# 3 rows, one per site.

Test plan

  • test_get_field_measurements_metadata — single-site happy path; asserts field_series_id, begin, end columns.
  • test_get_field_measurements_metadata_multi_site — exercises the multi-site POST path.
  • Live verification against api.waterdata.usgs.gov.

Related

Part of the v1.1.4 release-staging series; will be linked from a tracking issue.

@thodson-usgs
Copy link
Copy Markdown
Collaborator Author

Tracked in the v1.1.4 release-staging issue: #270.

Wraps the OGC /collections/field-measurements-metadata collection.
Returns one row per (location, parameter) field-measurement series
describing its period of record, units, etc., without the underlying
observations. Discrete-measurement analogue to
get_time_series_metadata.

Mirrors R's read_waterdata_field_meta in DOI-USGS/dataRetrieval, with
the same output_id ("field_series_id") and parameter list. Body is the
standard service-agnostic dispatch through get_ogc_data, with no new
infrastructure required.

Two live tests cover the single-site happy path and the multi-site
POST path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@thodson-usgs thodson-usgs force-pushed the add-field-measurements-metadata branch from 27d1aee to 75ba16c Compare May 6, 2026 16:18
@thodson-usgs thodson-usgs requested review from Copilot and ldecicco-USGS and removed request for Copilot May 6, 2026 17:05
@thodson-usgs thodson-usgs marked this pull request as ready for review May 6, 2026 23:41
@thodson-usgs thodson-usgs merged commit 0d079ca into DOI-USGS:main May 6, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants