Skip to content

Conversation

@negin513
Copy link
Collaborator

Compatibility validation: check_titiler_cmr_compatibility(...)

This helper performs a lightweight smoke test to confirm your dataset + config work with a TiTiler-CMR endpoint:

  • Discovers TileJSONs by querying
    GET /timeseries/{tileMatrixId}/tilejson.json for the requested interval and sampling points.
    It ensures that at least one TileJSON is available.
  • If TileJSONs are found, it calls
    GET /timeseries/statistics using random bounds inferred from TileJSON to verify valid, non-empty responses.
  • Returns a clear compatibility flag ("compatible" vs. "issues_detected"), plus a dataset overview: timestep counts and basic statistics (min, max, median, masked counts, etc.).

Usage example — quick compatibility check

datetime_range = "2022-03-01T00:00:01Z/2022-03-01T23:59:59Z"
variable = "precipitation"

ds_xarray = DatasetParams(
    concept_id=concept_id,
    backend="xarray",
    datetime_range=datetime_range,
    variable=variable,
    step="P1D",
    temporal_mode="point",
)
compat = await check_titiler_cmr_compatibility(
    endpoint=endpoint,
    dataset=ds_xarray,
    timeout_s=250.0,
)

print(f"Compatibility: {compat['compatibility']}")

@maxrjones maxrjones merged commit 2b36ae1 into developmentseed:main Sep 22, 2025
2 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