Skip to content

Mosaic Methods

lazycogs.MosaicMethodBase

Bases: ABC

Abstract base class for pixel-selection mosaic methods.

data property

data: ndarray

Return the filled mosaic as a plain numpy array.

Remaining masked pixels are filled with zero.

is_done property

is_done: bool

Return True when every output pixel has a valid value.

__init__

__init__() -> None

Initialise an empty mosaic accumulator.

feed abstractmethod

feed(arr: MaskedArray) -> None

Incorporate a new tile into the mosaic.

Parameters:

Name Type Description Default
arr MaskedArray

Masked array with shape (bands, height, width). Masked positions indicate no-data pixels in the new tile.

required

lazycogs.FirstMethod

Bases: MosaicMethodBase

Use the first valid pixel encountered (first-on-top compositing).

feed

feed(arr: MaskedArray) -> None

Incorporate arr by filling any still-empty positions.

Parameters:

Name Type Description Default
arr MaskedArray

Masked array with shape (bands, height, width).

required

lazycogs.HighestMethod

Bases: MosaicMethodBase

Use the pixel with the highest value across all tiles.

feed

feed(arr: MaskedArray) -> None

Incorporate arr by keeping the maximum value at each position.

Parameters:

Name Type Description Default
arr MaskedArray

Masked array with shape (bands, height, width).

required

lazycogs.LowestMethod

Bases: MosaicMethodBase

Use the pixel with the lowest value across all tiles.

feed

feed(arr: MaskedArray) -> None

Incorporate arr by keeping the minimum value at each position.

Parameters:

Name Type Description Default
arr MaskedArray

Masked array with shape (bands, height, width).

required

lazycogs.MeanMethod

Bases: MosaicMethodBase

Use the mean of all valid pixel values across tiles.

data property

data: ndarray

Return filled mean mosaic.

Returns:

Type Description
ndarray

Numpy array with shape (bands, height, width).

__init__

__init__() -> None

Initialise accumulators for incremental mean computation.

feed

feed(arr: MaskedArray) -> None

Incorporate arr into the running mean.

Parameters:

Name Type Description Default
arr MaskedArray

Masked array with shape (bands, height, width).

required

lazycogs.MedianMethod

Bases: MosaicMethodBase

Use the median of all valid pixel values across tiles.

data property

data: ndarray

Return the pixel-wise median of all fed tiles.

Returns:

Type Description
ndarray

Numpy array with shape (bands, height, width).

__init__

__init__() -> None

Initialise the tile stack.

feed

feed(arr: MaskedArray) -> None

Add arr to the stack. Median is computed lazily in data.

Parameters:

Name Type Description Default
arr MaskedArray

Masked array with shape (bands, height, width).

required

lazycogs.StdevMethod

Bases: MosaicMethodBase

Use the standard deviation of all valid pixel values across tiles.

data property

data: ndarray

Return the pixel-wise standard deviation of all fed tiles.

Returns:

Type Description
ndarray

Numpy array with shape (bands, height, width).

__init__

__init__() -> None

Initialise the tile stack.

feed

feed(arr: MaskedArray) -> None

Add arr to the stack.

Parameters:

Name Type Description Default
arr MaskedArray

Masked array with shape (bands, height, width).

required

lazycogs.CountMethod

Bases: MosaicMethodBase

Count the number of valid observations at each pixel.

data property

data: ndarray

Return the per-pixel observation count.

Returns:

Type Description
ndarray

Numpy array with shape (bands, height, width).

feed

feed(arr: MaskedArray) -> None

Accumulate the count of valid pixels.

Parameters:

Name Type Description Default
arr MaskedArray

Masked array with shape (bands, height, width).

required