pysteps.blending.utils.blend_optical_flows
pysteps.blending.utils.blend_optical_flows#
- pysteps.blending.utils.blend_optical_flows(flows, weights)#
Combine advection fields using given weights. Following [BPS06] the second level of the cascade is used for the weights
- Parameters
flows (array-like) – A stack of multiple advenction fields having shape (S, 2, m, n), where flows[N, :, :, :] contains the motion vectors for source N. Advection fields for each source can be obtanined by calling any of the methods implemented in pysteps.motion and then stack all together
weights (array-like) – An array of shape [number_sources] containing the weights to be used to combine the advection fields of each source. weights are modified to make their sum equal to one.
- Returns
out – Return the blended advection field having shape (2, m, n), where out[0, :, :] contains the x-components of the blended motion vectors and out[1, :, :] contains the y-components. The velocities are in units of pixels / timestep.
- Return type
ndarray