closest
closest(x, v)
Categories: Indexing
Description
finds the value and index in x closest to a value in v. e.g. x = cosine of angles between pairs of peaks v = idealised values based on hkl geometry ibest set to the x[i] matching to a v[j] with diff "best"
Parameters
| Name | Description |
|---|---|
v |
Array of values to search for (e.g. experimental cosines). |
x |
Array of candidate values to search (e.g. ideal cosines from hkl geometry). |
Constraints
x.format == 'd'v.format == 'd'
Overloads
| C function | Condition |
|---|---|
closest |
always |
Built from commit 7ba8255fa8d680e1a1df79e67aee3873247ce69c (v0.4.5)