NEARESTN Purpose nearestN takes takes a list of source locations and, for a list of test positions, returns the index of the n'th nearest source.