esmf_regrid.experimental.unstructured_scheme module¶
Provides an iris interface for unstructured regridding.
- class esmf_regrid.experimental.unstructured_scheme.GridToMeshESMFRegridder(src_mesh_cube, target_grid_cube, mdtol=1, precomputed_weights=None)[source]¶
Bases:
objectRegridder class for rectilinear to unstructured
Cube\ s.Create regridder for conversions between source grid and target mesh.
- Parameters
src_grid_cube (
iris.cube.Cube) – The unstructuredCubecube providing the source grid.target_grid_cube (
iris.cube.Cube) – The rectilinearCubeproviding the target mesh.mdtol (float, default=1) – 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.
- class esmf_regrid.experimental.unstructured_scheme.MeshToGridESMFRegridder(src_mesh_cube, target_grid_cube, mdtol=1, precomputed_weights=None)[source]¶
Bases:
objectRegridder class for unstructured to rectilinear
Cube\ s.Create regridder for conversions between source mesh and target grid.
- Parameters
src_mesh_cube (
iris.cube.Cube) – The unstructuredCubeproviding the source grid.target_grid_cube (
iris.cube.Cube) – The rectilinearCubeproviding the target grid.mdtol (float, default=1) – 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.experimental.unstructured_scheme.regrid_rectilinear_to_unstructured(src_cube, mesh_cube, mdtol=0)[source]¶
Regrid rectilinear
Cubeonto unstructured mesh.Return a new
Cubewithdatavalues calculated using the area weighted mean ofdatavalues fromsrc_cuberegridded onto the horizontal mesh ofmesh_cube. The dimensions on theCubeassociated with the grid will replaced by a dimension associated with themesh. That dimension will be the the first of the grid dimensions, whether it is associated with thexorycoordinate. Since two dimensions are being replaced by one, coordinates associated with dimensions after the grid will become associated with dimensions one lower. This function requires that the horizontal dimension ofmesh_cubeis described by a 2D mesh with data located on the faces of that mesh. This function requires that the horizontal grid ofsrc_cubeis rectilinear (i.e. expressed in terms of two orthogonal 1D coordinates). This function also requires that theCoord\ s describing the horizontal grid havebounds.- Parameters
src_cube (
iris.cube.Cube) – A rectilinear instance ofCubethat supplies the data, metadata and coordinates.mesh_cube (
iris.cube.Cube) – An unstructured instance ofCubethat supplies the desired horizontal mesh 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 of the source cube exceedsmdtol. 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 of thesrc_cubeare masked.
- Returns
A new
Cubeinstance.- Return type
- esmf_regrid.experimental.unstructured_scheme.regrid_unstructured_to_rectilinear(src_cube, grid_cube, mdtol=0)[source]¶
Regrid unstructured
Cubeonto rectilinear grid.Return a new
Cubewithdatavalues calculated using the area weighted mean ofdatavalues fromsrc_cuberegridded onto the horizontal grid ofgrid_cube. The dimension on theCubebelonging to themeshwill replaced by the two dimensions associated with the grid. This function requires that the horizontal dimension ofsrc_cubeis described by a 2D mesh with data located on the faces of that mesh. This function requires that the horizontal grid ofgrid_cubeis rectilinear (i.e. expressed in terms of two orthogonal 1D coordinates). This function also requires that theCoord\ s describing the horizontal grid havebounds.- Parameters
src_cube (
iris.cube.Cube) – An unstructured 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