Vector Field Similarity
Per-pixel similarity between a multi-band "vector field" raster (a raster where each pixel holds a D-dimensional vector spread across D bands) and a reference vector. Generalizes the original `embedding_trajectory_similarity` op — the math (cosine / L2 over per-pixel vectors) is the same regardless of whether the per-pixel vector is a stacked time trajectory, a single-time embedding, an ensemble of FM embeddings, or any other multi-band feature stack. Typical inputs: - Output of `stack_concat` (T*D bands; trajectory recipe). - A single-time embedding raster (D bands). - Any multi-band feature stack where bands form a coherent vector. The reference can be specified two ways: 1. A single pixel index via the `reference_pixel` param (object `{row, col}`). 2. A region mask passed as the `reference_mask` input (single-band raster matching the field grid; cells with finite value > 0 are included). The reference vector is the NaN-aware mean of per-pixel vectors under the mask. Default metric is cosine similarity in [-1, 1]. Setting `metric: "l2"` yields L2 distance in [0, +inf). Multi-reference output: `references` (optional, array of `{row, col}` pixels OR an array of `reference_mask` keys) emits one output band per reference. K references → K bands; tile previewers expecting <=4 bands may fail. NaN handling: pixels whose vector contains any NaN return NaN. If the reference itself contains NaN (or the mask selects no usable cells), the entire output is NaN. Renamed 2026-05-01 from `embedding_trajectory_similarity` per arch-review verdict that the math is general — see registry alias in `packages/compute/src/ops/index.ts` for backward compatibility.
| ID | vector_field_similarity |
|---|---|
| Domain | geo |
| Category | analysis |
| Type | raster-to-raster |
| Version | 1.0.0 |