xugrid.OverlapRegridder#

class xugrid.OverlapRegridder(source: UgridDataArray, target: UgridDataArray, method: str | Callable = 'mean')[source]#

The OverlapRegridder regrids by computing which target faces overlap with which source faces. It stores the area of overlap, which can be used in multiple ways to aggregate the values associated with the source faces.

Currently supported aggregation methods are:

  • "mean"

  • "harmonic_mean"

  • "geometric_mean"

  • "sum"

  • "minimum"

  • "maximum"

  • "mode"

  • "median"

  • "max_overlap"

Custom aggregation functions are also supported, if they can be compiled by Numba. See the User Guide.

Parameters:
__init__(source: UgridDataArray, target: UgridDataArray, method: str | Callable = 'mean')[source]#

Methods

__init__(source, target[, method])

from_dataset(dataset)

Reconstruct the regridder from a dataset with source, target indices and weights.

from_weights(weights, target[, method])

regrid(object)

Regrid the data from a DataArray from its old grid topology to the new target topology.

regrid_dataarray(source, source_dims)

to_dataset()

Store the computed weights and target in a dataset for re-use.

Attributes

weights