magpie.pixels.pos2pix_cart2d

magpie.pixels.pos2pix_cart2d(x, y, lengths, ngrids, origin=[0.0, 0.0])

X and Y-coordinate to 2D pixel.

Parameters
x, yfloat or array

X and Y-coordinate.

lengthsfloat or list[float]

Lengths of the 2D grids.

ngridsint or list[int]

The grid dimension.

originlist[float], optional

Minimum value along the grids.

Returns
pixIDint or array

The index of the pixel the points are located in 2D.