spectrochempy.Coord.loc2index

Coord.loc2index(loc)[source]

Return the index corresponding to a given location.

Parameters

loc (float.) – Value corresponding to a given location on the coordinates axis.

Returns

index (int.) – The corresponding index.

Examples

>>> dataset = scp.NDDataset.read("irdata/nh4y-activation.spg")
>>> dataset.x.loc2index(1644.0)
4517