pysteps.utils.dimension.aggregate_fields_space

pysteps.utils.dimension.aggregate_fields_space

pysteps.utils.dimension.aggregate_fields_space(R, metadata, space_window, ignore_nan=False)

Upscale fields in space.

Parameters
R: array-like

Array of shape (m,n), (t,m,n) or (l,t,m,n) containing a single field or a time series of (ensemble) input fields.

metadata: dict

Metadata dictionary containing the xpixelsize, ypixelsize and unit attributes as described in the documentation of pysteps.io.importers.

space_window: float or None

The length of the space window that is used to upscale the fields. The space_window unit is the same used in the geographical projection of R and hence the same as for the xpixelsize and ypixelsize attributes. The space spanned by the m and n dimensions of R must be a multiple of space_window. If set to None, it returns a copy of the original R and metadata.

ignore_nan: bool, optional

If True, ignore nan values.

Returns
outputarray: array-like

The new array of aggregated fields of shape (k,j), (t,k,j) or (l,t,k,j), where k = m*ypixelsize/space_window and j = n*xpixelsize/space_window.

metadata: dict

The metadata with updated attributes.