cf.RegridOperator¶

class
cf.
RegridOperator
(weights=None, row=None, col=None, coord_sys=None, method=None, src_shape=None, dst_shape=None, src_cyclic=None, dst_cyclic=None, src_mask=None, dst_mask=None, src_coords=None, src_bounds=None, start_index=0, src_axes=None, dst_axes=None, dst=None)[source]¶ Bases:
cf.mixin_container.Container
,cfdm.abstract.container.Container
A regridding operator between two grids.
Regridding is the process of interpolating from one grid resolution to a different grid resolution.
The regridding operator stores the regridding weights; auxiliary information, such as the grid shapes; the CF metadata for the destination grid; and the source grid coordinates.
Initialization
 Parameters
 weights: array_like
The 1d array of regridding weights for locations in the 2d dense weights matrix. The locations are defined by the row and col parameters.
 row, col: array_like, array_like
The 1d arrays of the row and column indices of the regridding weights in the dense weights matrix, which has J rows and I columns, where J and I are the total number of cells in the destination and source grids respectively. See the start_index parameter.
 coord_sys:
str
The name of the coordinate system of the source and destination grids. Either
'spherical'
or'Cartesian'
. method:
str
The name of the regridding method.
 src_shape: sequence of
int
The shape of the source grid.
 dst_shape: sequence of
int
The shape of the destination grid.
 src_cyclic:
bool
For spherical regridding, specifies whether or not the source grid longitude axis is cyclic.
 dst_cyclic:
bool
For spherical regridding, specifies whether or not the destination grid longitude axis is cyclic.
 src_mask:
numpy.ndarray
orNone
, optional If a
numpy.ndarray
with shape src_shape then this is the source grid mask that was used during the creation of the weights. If src_mask is a scalar array with valueFalse
, then this is equivalent to a source grid mask with shape src_shape entirely populated withFalse
.If
None
(the default), then the weights are assumed to have been created assuming no source grid masked cells. dst_mask:
numpy.ndarray
orNone
, optional A destination grid mask to be applied to the weights matrix, in addition to those destination grid cells that have no nonzero weights. If
None
(the default) then no additional destination grid cells are masked. If a Booleannumpy
array then it must have shape dst_shape, and a value ofTrue
signifies a masked destination grid cell. start_index:
int
, optional Specify whether the row and col parameters use 0 or 1based indexing. By default 0based indexing is used.
 parameters: Deprecated at version 3.14.0
Use keyword parameters instead.
 dst:
Field
orDomain
The definition of the destination grid.
 dst_axes:
dict
or sequence orNone
, optional The destination grid axes to be regridded.
 src_axes:
dict
or sequence orNone
, optional The source grid axes to be regridded.
Methods
Return a deep copy. 

A full description of the regrid operator. 

Return a regrid operation parameter. 

Get the CF metadata parameters for the destination grid. 

Return the weights in dense format. 

Return the weights in sparse COOrdinate format. 
Attributes
The 1d array of the column indices of the regridding weights. 

The name of the regridding coordinate system. 

The definition of the destination grid. 

The destination grid axes to be regridded. 

Whether or not the destination grid longitude axis is cyclic. 

A destination grid mask to be applied to the weights matrix. 

The shape of the destination grid. 

The name of the regridding method. 

The name of the regridding method. 

The 1d array of the row indices of the regridding weights. 

The source grid axes to be regridded. 

The bounds of the source grid cells. 

The coordinates of the source grid cells. 

Whether or not the source grid longitude axis is cyclic. 

The source grid mask that was applied during the weights creation. 

The shape of the source grid. 

The start index of the row and column indices. 

The 1d array of the regridding weights. 
Special¶
Methods