eogrow.tasks.features

Implements tasks needed for calculating features in FeaturesPipeline.

eogrow.tasks.features.join_valid_and_cloud_masks(valid_mask, cloud_mask)[source]

Used to zip together information about valid data and clouds into a combined validity mask

Parameters:
  • valid_mask (ndarray) –

  • cloud_mask (ndarray) –

Return type:

ndarray

class eogrow.tasks.features.ValidDataFractionPredicate(validity_threshold)[source]

Bases: object

Predicate that defines if a frame from EOPatch’s time-series is valid or not. Frame is valid, if the valid data fraction is above the specified threshold.

Parameters:

validity_threshold (float) –

class eogrow.tasks.features.MaxNDVI(*args, **kwargs)[source]

Bases: MapFeatureTask

Parameters:
  • input_features (FeaturesSpecification) – A collection of the input features to be mapped.

  • output_features (FeaturesSpecification) – A collection of the output features to which to assign the output data.

  • map_function (Callable | None) – A function or lambda to be applied to the input data.

  • kwargs (Any) – kwargs to be passed to the map function.

Raises:

ValueError – Raises an exception when passing feature collections with different lengths.

map_method(feature)[source]

A function that will be applied to the input features.

Parameters:

feature (ndarray) –

Return type:

ndarray

class eogrow.tasks.features.MosaickingTask(*args, **kwargs)[source]

Bases: EOTask

Base class for mosaicking images given an interval of edge dates

Stores initialization parameters and the order to the instance attribute init_args.

Parameters:
  • feature (Feature) –

  • dates (list[date] | tuple[date, date, int]) –

  • valid_mask (Feature | None) –

  • ndvi_feature (Feature | None) –

compute_mosaic_dates()[source]

Compute dates of corresponding mosaics

Return type:

list[datetime.datetime]

compute_mosaic(eopatch)[source]

Computes mosaic

Parameters:

eopatch (EOPatch) –

Return type:

ndarray

execute(eopatch)[source]

Compute mosaic for given dates

Parameters:

eopatch (EOPatch) –

Return type:

EOPatch

class eogrow.tasks.features.MaxNDVIMosaickingTask(*args, **kwargs)[source]

Bases: MosaickingTask

Task to create mosaics of data based on the max NDVI value between provided dates

Stores initialization parameters and the order to the instance attribute init_args.

Parameters:
  • feature (Feature) –

  • dates (list[date] | tuple[date, date, int]) –

  • ndvi_feature (Feature) –

  • valid_mask (Feature | None) –

class eogrow.tasks.features.MedianMosaickingTask(*args, **kwargs)[source]

Bases: MosaickingTask

Task to create mosaics of data based on the median value between provided dates

Stores initialization parameters and the order to the instance attribute init_args.

Parameters:
  • feature (Feature) –

  • dates (list[date] | tuple[date, date, int]) –

  • valid_mask (Feature | None) –