fetch.validate_query
fetch.validate_query(roi, time_range=None)Validate an AOI + optional time_range early, before any provider call. Raises ValueError with an actionable message on any of:
- roi is not a 4-tuple
[lon_min, lat_min, lon_max, lat_max] - lon out of [-180, 180] or lat out of [-90, 90]
- lat_min >= lat_max (empty or inverted latitude range)
- lon_min > lon_max, i.e. the AOI crosses the +/- 180 antimeridian. A single call across the antimeridian is not supported by our current provider paths (the STAC / earthdata bboxes are read as “regular” west->east). Users should split into two AOIs on either side of the antimeridian and fetch each separately.
- time_range is not a 2-element (start, end) tuple/list of ISO-8601 date strings that pandas can parse
- time_range start >= end (empty or inverted window)
Called from fetch_sentinel_data before dispatch so every provider path shares the same up-front sanity check. Deliberately does NOT check for provider-specific temporal coverage (e.g. NISAR-L only 2026-06-17 onward) – that lives in the per-provider search step where the actionable message can name the product.
Motivating review comment: reviewer noted that queries across the antimeridian and inverted time_ranges silently returned unexpected results downstream. See openjournals/joss-reviews#11034 (Aug 24 2026).