salem.Grid.transform

Grid.transform(x, y, z=None, crs=<pyproj.Proj object at 0x7f02c81c1a10>, nearest=False, maskout=False)

Converts any coordinates into the local grid.

Parameters:

x : ndarray

the grid coordinates of the point(s) you want to convert

y : ndarray

the grid coordinates of the point(s) you want to convert

z : None

ignored (but necessary since some shapes have a z dimension)

crs : crs

reference system of x, y. Could be a pyproj.Proj instance or a Grid instance. In the latter case (x, y) are actually (i, j). (Default: lonlat in wgs84).

nearest : bool

set to True if you wish to return the closest i, j coordinates instead of subpixel coords.

maskout : bool

set to true if you want to mask out the transformed coordinates that are not within the grid.

Returns:

(i, j) coordinates of the points in the local grid.