satpy.multiscene._blend_funcs module

satpy.multiscene._blend_funcs._combine_stacked_attrs(collected_attrs: Sequence[Mapping]) dict[source]
satpy.multiscene._blend_funcs._fill_weights_for_invalid_dataset_pixels(datasets: Sequence[DataArray], weights: Sequence[DataArray]) Iterable[DataArray][source]

Replace weight valus with 0 where data values are invalid/null.

satpy.multiscene._blend_funcs._get_weighted_blending_func(blend_type: str) Callable[source]
satpy.multiscene._blend_funcs._stack_blend_by_weights(datasets: Sequence[DataArray], weights: Sequence[DataArray]) DataArray[source]

Stack datasets blending overlap using weights.

satpy.multiscene._blend_funcs._stack_no_weights(datasets: Sequence[DataArray]) DataArray[source]
satpy.multiscene._blend_funcs._stack_select_by_weights(datasets: Sequence[DataArray], weights: Sequence[DataArray]) DataArray[source]

Stack datasets selecting pixels using weights.

satpy.multiscene._blend_funcs._stack_with_weights(datasets: Sequence[DataArray], weights: Sequence[DataArray], blend_type: str) DataArray[source]
satpy.multiscene._blend_funcs.stack(data_arrays: Sequence[DataArray], weights: Sequence[DataArray] | None = None, blend_type: str = 'select_with_weights') DataArray[source]

Combine a series of datasets in different ways.

By default, DataArrays are stacked on top of each other, so the last one applied is on top. Each DataArray is assumed to represent the same geographic region, meaning they have the same area. If a sequence of weights is provided then they must have the same shape as the area. Weights with greater than 2 dimensions are not currently supported.

When weights are provided, the DataArrays will be combined according to those weights. Data can be integer category products (ex. cloud type), single channels (ex. radiance), or a multi-band composite (ex. an RGB or RGBA true_color). In the latter case, the weight array is applied to each band (R, G, B, A) in the same way. The result will be a composite DataArray where each pixel is constructed in a way depending on blend_type.

Blend type can be one of the following:

  • select_with_weights: The input pixel with the maximum weight is chosen.

  • blend_with_weights: The final pixel is a weighted average of all valid input pixels.

satpy.multiscene._blend_funcs.temporal_rgb(data_arrays: Sequence[DataArray]) DataArray[source]

Combine a series of datasets as a temporal RGB.

The first dataset is used as the Red component of the new composite, the second as Green and the third as Blue. All the other datasets are discarded.


Expand dataset with and concatenate by time dimension.