ImageD11.closest | index /sware/exp/fable/standalone/redhate4-a64/lib/python2.5/site-packages/ImageD11/closest.so |
/* *******************************************************************
* closest.c Two useful functions for indexing grains
*
* 1. From python: closest(cosines_allowed, cosine_measured)
* Take 1 peak with hkl's assigned, compute the cosines to
* another powder ring (angles between this peak and peaks in
* that ring). This extension finds the best peak in the
* other ring to pair up with.
*
* More generally closest(array, values) finds the closest
* item in values to one of the values in array. Returns the
* difference and the index of the closest thing it finds.
*
* Both arguments should be one dimensional Numeric arrays
* of type Numeric.Float
*
* 2. From python: score(ubi, gv, tol) where ubi is an orientation
* matrix and gv are an array of g-vectors. Returns the number
* of g-vectors which have integer hkl peaks within tolerance
* tol. Uses the conv_double_to_int_fast function in here for
* factor of !EIGHT! speed increase compared to rounding in
* C. In fact this gives the nearest even integer, instead
* of the nearest integer, but we don't care, as a peak having
* hkl of 0.5 is nowhere near being indexed anyway.
*
* Returns and integer - number of peaks indexed
* UBI is a 3x3 Numeric.Float array (figure out the transposing yourself)
* GV is a nx3 Numeric.Float array, and you should try to make the 3
* be the fast index for best performance
*
* 3. From python: same as score, I hope, but ubi is overwritten
* with refined matrix following paciorek algorithm which is
* in indexing.py
*
*
* 4. score_and_assign( ubi, gv, tol, drlv, labels, (int) label)
* as for score, but assignments are only made if drlv is lower than
* the previous. Fills in label with the new label
*
* 5. refine_assigned( ubi, gv, labels, label, weight)
* Use only the peaks where label matches labels in refinement
* ...following again the Paciorek algorithm
*
* 6. put_incr( data, indices, values)
* pretty much as numeric.put but as increments
*
* ****************************************************************** */
Functions | ||
|