Skip to content

Facts for agents

egms_client.facts

Answers as data: every number with where it comes from and how far to trust it.

A language model words an answer; it never makes one. The functions here compute the answer from local files and return it as a plain dict (JSON ready) that carries, next to each number:

  • release and window: when the satellites measured. The data stop at the end of the window and do not describe the ground of today;
  • files: the archive files the number was read from;
  • reliability: how far to trust it (:mod:egms_client.reliability), with its reasons;
  • licence and notes: the credit EGMS asks for, and what a number is not (not measured is not zero; a velocity is not an alert).

The MCP server returns these dicts; :mod:egms_client.check checks a text written from them. Pure: no network, only the GeoTIFFs (and, for the fit of the series, the L3 attributes) given. Needs the raster extra.

summarize

summarize(tiffs: list[Path], *, box: tuple[float, float, float, float], stable_band: float = 2.0, fastest: int = 5) -> _Stats

The statistics area_summary returns, over the cells inside a box in degrees.

Only cells whose centre falls inside the box count (the box is curved in EPSG:3035, so its bounding rectangle holds more). Pure: no network.

window_facts

window_facts(release: str, level: str = 'L3') -> dict[str, Any]

The window of a release as data: exact dates when known, else the years only.

velocity

velocity(tiffs: Iterable[Path], lon: float, lat: float, *, component: str = 'U', release: str, attributes: Any = None) -> dict[str, Any]

The L3 velocity of the 100 m cell at a point, with its reliability and window.

tiffs are the L3 tiles of component around the point; attributes, optional, the L3 attributes of the same component (for the fit of the series).

area

area(tiffs: Iterable[Path], box: tuple[float, float, float, float], *, component: str = 'U', release: str, stable_band: float = 2.0) -> dict[str, Any]

Statistics of the L3 velocity over a box in degrees (mcp_server.summarize).

moving_points

moving_points(tiffs: Iterable[Path], box: tuple[float, float, float, float], *, component: str = 'U', release: str, threshold: float = 5.0, limit: int = 10) -> dict[str, Any]

The cells of a box that move against their region, the fastest first.

A cell moves when its velocity differs from the median of the box by threshold mm/year or more: EGMS velocities carry regional offsets, so the median of the box is the reference, not zero. Each cell has its coverage within RADIUS_M and whether it is reliable (coverage at least FULL_COVERAGE * RELIABLE_FROM): a lone fast cell is weak evidence. Only cells whose centre is inside the box count.

to_records

to_records(facts: dict[str, Any]) -> list[dict[str, Any]]

The facts of :func:velocity, :func:area or :func:moving_points as records.

Records follow opendata-record/v1 (:mod:egms_client.records), the shape the application reads from every source. A velocity is one observation. An area and the moving cells are one fact with the statistics, then one observation per cell listed. A missing value stays null and carries the reason not_measured.