lair.inventories.Inventory.resample#

Inventory.resample(resolution, regrid_method='conservative', inplace=False)[source]#

Resample the data to a new resolution.

The new grid covers the whole inventory. When the resolution does not divide its width, the last row or column reaches past the edge and holds only what was inside, so the total is kept (see lair.geo.resample()). This holds for "conservative", the default.

Parameters:
  • resolution (float | tuple[x_res, y_res]) – The new resolution in degrees. If a single value is provided, the resolution is assumed to be the same in both dimensions.

  • regrid_method (str, optional) – The regridding method, by default ‘conservative’.

  • inplace (bool, optional) – Whether to modify the data in place, by default False.

Returns:

Inventory – The resampled inventory. If inplace=True returns self, otherwise returns a new Inventory copy.

Return type:

Self

See also

Inventory.regrid

To a grid you give.

lair.geo.resample

The same for any field, bilinear by default.

Examples

From EDGAR’s 0.1 degree to 0.01 degree, as the inventory example does, keeping the total:

fine = inv.resample(0.01)