interp_scattered — MATH interp_poly op

데이터 종류: points × signal × pointstable

호출: import fullseye as fs; fs.ledger.interp_scattered(points, values, query, method='linear', fill_value=nan, rescale=False, neighbors=None)(구현을 직접 호출하려면 import mathops; mathops.interp_scattered(points, values, query, method='linear', fill_value=nan, rescale=False, neighbors=None), 원장에서 가져오려면 opsmath.get("interp_scattered"))

사용법

> 이 연산자의 설명은 아직 번역이 없습니다. 원문을 그대로 싣습니다.

Values at *query* from scattered samples — sensor nets, boreholes, weather.

:func:interp_linear and :func:interp_cubic need samples on a sorted 1-D

axis. A great deal of measurement does not arrive that way: temperature

sensors bolted wherever a rack allowed, boreholes drilled where access

permitted, weather stations placed by history. This is the N-D scattered

entry point (`scipy.interpolate`), and it returns **how much of the answer

was not interpolation at all**.

*method*:

`"nearest"`

the value of the closest sample. Defined everywhere, and never

overshoots, but it is a staircase: on a smooth field the step itself

becomes a false feature. Measured on a smooth 3-D field sampled at 0.60,

the nearest-neighbour reconstruction leaves a residual of 0.975 units

where the sensor noise is only 0.15 — 6.5 times the noise, and none of

it is noise.

`"linear"`

barycentric interpolation on a Delaunay triangulation. Never exceeds the

surrounding samples, and is undefined outside their convex hull.

`"rbf"`

a thin-plate radial basis function through every sample. Smooth and

defined everywhere, but it overshoots its own nodes: measured on the

same field it returns peaks 1.372 times the sampled height, which is a

37 % over-statement of a hot spot that no interpolation of the data can

justify.

**The point of the `outside` return value.** Sensors sit inside a room, a

site, a country; the corners are always outside their hull. Ask a linear

interpolator there and it returns `fill_value`, or, if a caller quietly

falls back to nearest, it returns a different method's answer under the

first method's name. Measured on a 12 x 8.4 x 3.0 m room sampled at 1.20 m

spacing, 71.2 % of the evaluation grid lay outside the hull. A number

that large has to be visible, so it is returned rather than logged.

Parameters

----------

points : (n, d) array_like

Sample coordinates. 1-D input is accepted and treated as `(n, 1)`.

values : (n,) array_like

query : (m, d) or (..., d) array_like

Where to evaluate. The leading shape is preserved in the result.

method : {"linear", "nearest", "rbf"}

fill_value : float

Returned outside the convex hull for `"linear". "nearest"` and

`"rbf"` are defined everywhere and ignore it.

rescale : bool

Normalise each axis before triangulating. Needed when the axes have very

different units (metres against millimetres); ignored by `"rbf"`.

neighbors : int or None

`"rbf"` only: solve against the *k* nearest samples instead of all of

them. The global solve is O(n^3); measured on 5000 query points in 3-D,

it costs 0.55 / 1.76 / 7.53 s at 1400 / 4000 / 8000 samples, while

`neighbors=48` costs 0.38 / 0.55 / 0.81 s. Below a few thousand

samples the global solve is fine and exact — the knob earns its place

above that. `None` keeps the exact global solution.

Returns

-------

dict

`value (query shape), outside` (bool mask, query shape, of query

points beyond the convex hull of the samples), `outside_fraction`,

`method, n_points`.

Fail-closed: fewer samples than `d + 1` cannot define a simplex, and

raises `ValueError rather than returning a field made of fill_value`.

See also

--------

interp_linear : the sorted 1-D case, which is cheaper and needs no hull.

패밀리 공통 입력 계약(fail-closed)

mathops 의 모든 연산자는 입력을 검증한 뒤에 계산합니다(조용히 통과시키지 않습니다):

• **complex 입력은 ValueError** —— float64 로의 강제 변환은 허수부를 조용히 버립니다(numpy 는 ComplexWarning 만 내고 「그럴듯하게 틀린」 실수를 돌려줍니다). .real/.imag/abs() 를 명시하거나 복소수를 다루는 complexops 를 쓰세요.

• **masked 요소가 있는 masked array 는 ValueError** —— 마스크를 벗겨 아래 원값을 쓰는 암묵 변환을 거부합니다. 채울지 버릴지를 명시하세요.

• **NaN/Inf 는 모든 입력에서 ValueError**(개수를 명시하고 거부 —— 결과 전체로 전파되므로).

형상은 엄격: 1-D 와 2-D 를 암묵적으로 승격·브로드캐스트하지 않습니다(vector 슬롯에 matrix, matrix 슬롯에 vector 는 ValueError. reshape 를 명시하세요).

크기 상한: 행렬을 받는 연산자와 stat_histogram 의 bins 는 mathops.MAX_ELEMENTS(2^26 ≈ 6700 만 요소)를 넘으면 ValueError.

자세한 사용 가이드

math_metrology 패밀리 가이드

참고(샘플 데이터·문헌)

• 샘플 데이터 카탈로그(DL URL / 라이선스) —— 2-D 는 skimage.data(BSD/public)+ 합성, 3-D 는 실데이터 소스(Stanford/PDS 등)의 DL URL.

• 연산자의 내력·참고문헌 —— 이 연산자 족의 바탕이 된 연구/기법의 출처.

• 알고리즘의 정전(저자·연도)과 용도는 위의 패밀리 사용 가이드에 적혀 있습니다.

실행 가능한 예제(이 연산자를 실제로 호출하는 검증된 샘플)

poc_datacenter_thermal_fieldpy -3.11 examples/poc_datacenter_thermal_field.py

poc_multibeam_bathymetrypy -3.11 examples/poc_multibeam_bathymetry.py

poc_stockpile_volumepy -3.11 examples/poc_stockpile_volume.py

타입이 이어지는 다음 연산자(table 를 입력으로 받는 것)

같은 카테고리(interp_poly)

interp_linear · interp_cubic · poly_fit · poly_eval · poly_roots


*Provenance: mathops.py — MATH 연산자 레지스트리. 이 op 노트는 tools/opdocs.py md 가 자동 생성합니다(직접 편집하지 마세요).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.