hmf.core._kernels.lattice.lattice_index¶
- hmf.core._kernels.lattice.lattice_index(x: float, step: float, *, up: bool) int[source]¶
The index of the lattice node at or beyond
x.- Parameters:
x – A position, in the same unit as
step.step – The spacing of the lattice, > 0.
up – If True, the first node at or above
x; else the last node at or below it.
- Returns:
The node’s index
i, i.e. the node is ati * step. A position withinLATTICE_RTOLsteps of a node is on it, so rounding errors inxdo not add or drop a node.- Return type: