pyGWRetrieval v0.2.0
pyGWRetrieval v0.2.0
This release migrates pyGWRetrieval to the modern USGS Water Data OGC API and adds a water-table depth interpolation subsystem. It includes breaking changes — see below.
Highlights
- 🌐 Modern USGS backend. All retrieval now uses the USGS Water Data OGC API (
dataretrieval >= 1.2.0):get_monitoring_locations,get_daily,get_continuous, andget_field_measurements. This restores field-measurement (gwlevels) retrieval — the deprecated NWIS endpoint had started returning an HTML notice instead of data — and adds native large-area request chunking. The legacy NWIS endpoints remain only as an automatic fallback. - 🗺️ Water-table depth maps. New
WaterTableInterpolatorturns point observations into gridded rasters for a chosen window (period='all'|'monthly'|'annual'|'custom') at a resolution you set in meters. Methods:idw(core),kriging(pykrige), andlinear/cubic/nearest/rbf(scipy). Results support.plot(),.to_geotiff(), and.to_xarray(). Also addsidw_at_points(scattered-point IDW with leave-one-out cross-validation). - 💧 Aquifer filtering.
get_aquifer_info()returns each well'saqfr_type_cd('U'unconfined,'C'confined,'M'mixed) so you can restrict to unconfined wells before mapping water-table depth.
Added
WaterTableInterpolator,InterpolationResult, andidw_at_points, plus the optional dependency group installed withpip install pyGWRetrieval[interp](scipy, pykrige, rasterio, xarray). Delaunay methods can backfill beyond the wells' convex hull viafill_outside='nearest'.GroundwaterRetrieval.get_aquifer_info()for aquifer type / well-depth attributes.- A
parameter_cdcolumn identifying the USGS parameter behind each value — filter withdata['parameter_cd'] == '72019'to keep wells on the same footing (depth vs. elevation). - Upper Colorado River Basin example (
examples/ucrc/): a 1 km mean water-table depth map with a five-method interpolation comparison and an unconfined-aquifer gap-fill. - New documentation: a Water-Table Depth Interpolation guide and expanded API reference.
Fixed
- Field-measurement (
gwlevels) retrieval, which previously returned an HTML notice instead of data. get_data_by_statenow maps two-letter USPS codes (e.g.NV) to the full state name required by the OGC API; it previously returned no wells.- CLI
--versionnow reports the installed package version (was hardcoded to0.1.0).
⚠️ Breaking changes
site_nonow carries the full monitoring-location id (e.g.USGS-393000119000001) instead of the bare site number.- Default
data_sourcesis now'dv'(daily values) instead of'all'. Passdata_sources='gwlevels','iv','all', or a list to override (Python API and CLI). - Retrieved-data schema changed. Records are standardized to
site_no,datetime,value/lev_va, andparameter_cdacross all sources; NWIS-only columns (lev_tm,lev_acy_cd,lev_src_cd,lev_meth_cd,lev_status_cd) are no longer present. - Minimum Python is now 3.10 (was 3.8) and
dataretrieval >= 1.2.0is required.
Install
pip install --upgrade pyGWRetrieval — or with interpolation support: pip install --upgrade "pyGWRetrieval[interp]"
Full changelog: https://github.com/montimaj/pyGWRetrieval/blob/main/CHANGELOG.md