REST service¶
disp_xr serve STORE (or make_app) serves stores read-only over HTTP for
web clients such as the DISP portal. The OpenAPI page of a running service
(/docs) lists every route with its response schema.
serve ¶
Read-only REST service over disp-xr stores (PRD C7, plan task T40).
An xpublish <https://github.com/xpublish-community/xpublish>_ plugin that
serves, under /datasets/{dataset_id}/disp/:
timeseries: the displacement series at a point (median over a buffer), with the quality layers the store holds and its reference date;velocity: the stored velocity and its sigma at a point;cells: a regular grid or a quadtree of a bounding box, as GeoJSON;gnss: the station residuals and summary of :func:residuals.compare, written next to the cube by :meth:Comparison.to_zarr;provenance: operation history, input granules and versions.
Nothing heavy runs on request (PRD C7): velocities and GNSS residuals are
served only when the store holds them, and cells downsamples at most
MAX_CELL_PIXELS pixels. xpublish adds its own routes (Zarr over HTTP,
dataset info) and, when installed, xpublish-tiles adds web map tiles.
Every response carries the CRS and the units.
Start a service with disp_xr serve STORE or :func:make_app.
Point ¶
Bases: BaseModel
Where a point query was read.
TimeseriesResponse ¶
Bases: BaseModel
Displacement at a point, one value per epoch.
VelocityResponse ¶
Bases: BaseModel
Stored velocity at a point.
GnssStation ¶
Bases: BaseModel
One station's velocities and residual (see residuals.compare).
GnssResponse ¶
Bases: BaseModel
Station residuals and the comparison summary.
ProvenanceResponse ¶
Bases: BaseModel
How the store was made.
FeatureCollection ¶
Bases: BaseModel
GeoJSON FeatureCollection in lon/lat (RFC 7946).
DispPlugin ¶
open_store ¶
Open a store lazily, with its GNSS group when it has one.
Zarr stores (written by disp_xr stack or to_zarr), Icechunk
repositories (to_icechunk) and virtual frames (disp_xr virtual)
are supported. A virtual frame holds its granules as they are, one
reference per ministack, so it is chained on open
(:func:disp_xr.chain, lazily: nothing is read until a request).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str or Path
|
The store. |
required |
Returns:
| Type | Description |
|---|---|
Dataset
|
The cube. |
Dataset or None
|
The |
Examples:
make_app ¶
make_app(datasets: Mapping[str, Union[str, Path, Dataset]], *, gnss: Optional[Mapping[str, Dataset]] = None, tiles: bool = True) -> Rest
Return the xpublish service for datasets.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
datasets
|
mapping
|
Dataset id to a store path (opened lazily with :func: |
required |
gnss
|
mapping
|
GNSS groups (:meth: |
None
|
tiles
|
bool
|
Add web map tiles when |
True
|
Returns:
| Type | Description |
|---|---|
Rest
|
Serve with |
Examples: