rslearn.utils.interpolation¶
interpolation ¶
Utilities for interpolating irregular lon/lat samples onto a grid.
interpolate_to_grid ¶
interpolate_to_grid(data: NDArray, lon: NDArray, lat: NDArray, grid_resolution: float) -> tuple[NDArray, Projection, PixelBounds]
Interpolate points onto a fixed-resolution grid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
NDArray
|
the band data to convert (CxN). |
required |
lon
|
NDArray
|
longitude of each pixel (N). Pixels with NaN longitude are ignored. |
required |
lat
|
NDArray
|
latitude of each pixel (N). Pixels with NaN latitude are ignored. |
required |
grid_resolution
|
float
|
the resolution of the grid. |
required |
Returns:
| Type | Description |
|---|---|
tuple[NDArray, Projection, PixelBounds]
|
a tuple (array, projection, bounds) containing the gridded array along with the projection and bounds of that array. |