Skip to content

select_subset

Import path: earth2studio.grids.select_subset

View source on GitHub

Documentation

Select target_grid from a field on source_grid, when it is an exact crop.

Only rectilinear and projected grids on the same CRS can be cropped, by their dimension labels, which must match within a thousandth of the source spacing. The result carries the target's coordinates and grid attributes.

Parameters:

  • x (DataArray) –

    Field on source_grid.

  • source_grid (GridDefinition) –

    Grid of x.

  • target_grid (GridDefinition) –

    Grid to select.

Returns:

  • DataArray | None –

    Field on target_grid, or None when the target is not a crop of the source.