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, tuple or None) – The length of the space window that is used to upscale the fields. If a float is given, the same window size is used for the x- and y-directions. Separate window sizes are used for x- and y-directions if a two-element tuple is given. 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 n- and m-dimensions of R must be a multiple of space_window. If set to None, the function 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[1] and j = n*xpixelsize/space_window[0].

  • metadata (dict) – The metadata with updated attributes.