index_of

method of dascore.core.coords.Grid source

index_of(
    self ,
    ticks ,
    forward: bool ,
)

The sample index each label tick maps to.

Forward: the first index whose label is at or past the tick in the run’s direction. Otherwise the last index whose label is at or before it. Exact, since a label is the floor of its ideal position and a tick is an integer; Python integers, so no overflow.