interp_scattered — MATH interp_poly op

• Data kinds: points × signal × points → table

• Call: import fullseye as fs; fs.ledger.interp_scattered(points, values, query, method='linear', fill_value=nan, rescale=False, neighbors=None) (implementation को सीधे call करना हो तो import mathops; mathops.interp_scattered(points, values, query, method='linear', fill_value=nan, rescale=False, neighbors=None), registry से लेना हो तो opsmath.get("interp_scattered"))

उपयोग

बिखरे हुए samples से *query* पर मान — sensor nets, boreholes, weather।

> नीचे का विस्तृत विवरण मूल text में है — सारांश और headings का अनुवाद हो चुका है।

interp_linear and 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.

पूरी family का input contract (fail-closed)

mathops के सभी ops गणना से पहले input की जाँच करते हैं (कुछ भी चुपचाप पास नहीं होता):

• complex input से ValueError — float64 में ज़बरदस्ती बदलने पर imaginary part चुपचाप छूट जाता है (numpy केवल ComplexWarning देता है और "सही दिखने वाला पर गलत" real number लौटाता है)। .real/.imag/abs() स्पष्ट रूप से लिखें, या complex data संभालने वाले complexops का उपयोग करें।

• masked array (masked elements वाला) से ValueError — mask हटाकर नीचे के raw values इस्तेमाल करने वाला implicit conversion अस्वीकार है। भरना है या हटाना है, यह स्पष्ट रूप से बताएँ।

• हर input पर NaN/Inf से ValueError (गिनती बताकर अस्वीकार — क्योंकि यह पूरे परिणाम में फैल जाता है)।

• Shape सख़्त है: 1-D और 2-D को implicit रूप से promote या broadcast नहीं किया जाता (vector slot में matrix या matrix slot में vector देने पर ValueError; reshape स्पष्ट रूप से करें)।

• Size की सीमा: matrix लेने वाले ops और stat_histogram के bins, mathops.MAX_ELEMENTS (2^26 ≈ 6.7 करोड़ elements) से अधिक होने पर ValueError देते हैं।

उपयोग की विस्तृत guide

• math_metrology family guide

संदर्भ (sample data, साहित्य)

• Sample data catalog (DL URL / license) — 2-D के लिए skimage.data (BSD/public) + synthetic, 3-D के लिए real data sources (Stanford/PDS आदि) के DL URL।

• Operators का स्रोत और संदर्भ — इस op family के मूल research/methods के स्रोत।

• Algorithm का मानक स्रोत (लेखक, वर्ष) और उपयोग ऊपर की family usage guide में दिए गए हैं।

चलाए जा सकने वाले उदाहरण (verified samples जो सच में यह op call करते हैं)

• poc_datacenter_thermal_field — py -3.11 examples/poc_datacenter_thermal_field.py

• poc_multibeam_bathymetry — py -3.11 examples/poc_multibeam_bathymetry.py

• poc_stockpile_volume — py -3.11 examples/poc_stockpile_volume.py

वे अगले ops जिनसे type जुड़ता है (table को input के रूप में लेते हैं)

dynsys_poincare_section · dwt_inverse · chebyshev_eval_nd

इसी category के (interp_poly)

interp_linear · interp_cubic · poly_fit · poly_eval · poly_roots


*Provenance: mathops.py — MATH operator registry. यह per-op note tools/opdocs.py md से अपने-आप generate होता है (हाथ से edit न करें)।*

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