esmf_regrid.schemes module¶
Provides an iris interface for regridding.
- class esmf_regrid.schemes.ESMFAreaWeighted(mdtol=0)[source]¶
Bases:
objectA scheme which can be recognised by
iris.cube.Cube.regrid().This class describes an area-weighted regridding scheme for regridding between horizontal grids with separated
XandYcoordinates. It usesESMFto be able to handle grids in different coordinate systems.Area-weighted scheme for regridding between rectilinear grids.
- Parameters
mdtol (float, default=0) – Tolerance of missing data. The value returned in each element of the returned array will be masked if the fraction of missing data exceeds
mdtol. This fraction is calculated based on the area of masked cells within each target cell.mdtol=0means no masked data is tolerated whilemdtol=1will mean the resulting element will be masked if and only if all the overlapping elements of the source grid are masked.
- regridder(src_grid, tgt_grid)[source]¶
Create regridder to perform regridding from
src_gridtotgt_grid.- Parameters
src_grid (
iris.cube.Cube) – TheCubedefining the source grid.tgt_grid (
iris.cube.Cube) – TheCubedefining the target grid.
- Returns
- A callable instance of a regridder with the interface:
regridder(cube) … where
cubeis aCubewith the same grid assrc_gridthat is to be regridded to the grid oftgt_grid.
- A callable instance of a regridder with the interface:
- Return type
- class esmf_regrid.schemes.ESMFAreaWeightedRegridder(src_grid, tgt_grid, mdtol=0)[source]¶
Bases:
objectRegridder class for unstructured to rectilinear
Cube\ s.Create regridder for conversions between
src_gridandtgt_grid.- Parameters
src_grid (
iris.cube.Cube) – The rectilinearCubeproviding the source grid.tgt_grid (
iris.cube.Cube) – The rectilinearCubeproviding the target grid.mdtol (float, default=0) – Tolerance of missing data. The value returned in each element of the returned array will be masked if the fraction of masked data exceeds
mdtol.mdtol=0means no missing data is tolerated whilemdtol=1will mean the resulting element will be masked if and only if all the contributing elements of data are masked.
- esmf_regrid.schemes.regrid_rectilinear_to_rectilinear(src_cube, grid_cube, mdtol=0)[source]¶
Regrid rectilinear
Cubeonto another rectilinear grid.Return a new
Cubewithdatavalues calculated using the area weighted mean ofdatavalues fromsrc_cuberegridded onto the horizontal grid ofgrid_cube.- Parameters
src_cube (
iris.cube.Cube) – A rectilinear instance ofCubethat supplies the data, metadata and coordinates.grid_cube (
iris.cube.Cube) – A rectilinear instance ofCubethat supplies the desired horizontal grid definition.mdtol (float, default=0) – Tolerance of missing data. The value returned in each element of the returned
Cube\ ‘sdataarray will be masked if the fraction of masked data in the overlapping cells ofsrc_cubeexceedsmdtol. This fraction is calculated based on the area of masked cells within each target cell.mdtol=0means no missing data is tolerated whilemdtol=1will mean the resulting element will be masked if and only if all the overlapping cells ofsrc_cubeare masked.
- Returns
A new
Cubeinstance.- Return type