eolearn.visualization.eopatch_base

This module implements base objects for EOPatch visualizations.

class eolearn.visualization.eopatch_base.BasePlotConfig(rgb_factor=3.5, timestamp_column='TIMESTAMP', geometry_column='geometry')[source]

Bases: object

A base class for advanced plotting configuration parameters.

Parameters
  • rgb_factor (Optional[float]) – A factor by which to scale RGB images to make them look better.

  • timestamp_column (Optional[str]) – A name of a column containing timestamps in a GeoDataFrame feature. If set to None it will plot temporal vector features as if they were timeless.

  • geometry_column (str) – A name of a column containing geometries in a GeoDataFrame feature.

Return type

None

rgb_factor: Optional[float] = 3.5
timestamp_column: Optional[str] = 'TIMESTAMP'
geometry_column: str = 'geometry'
class eolearn.visualization.eopatch_base.BaseEOPatchVisualization(eopatch, feature, *, config, times=None, channels=None, channel_names=None, rgb=None)[source]

Bases: object

A base class for EOPatch visualization

Parameters
  • eopatch (eolearn.core.eodata.EOPatch) – An EOPatch with a feature to plot.

  • feature – A feature from the given EOPatch to plot.

  • config (eolearn.visualization.eopatch_base.BasePlotConfig) – A configuration object with advanced plotting parameters.

  • times (Optional[Union[List[int], slice]]) – A list or a slice of indices on temporal axis to be used for plotting. If not provided all indices will be used.

  • channels (Optional[Union[List[int], slice]]) – A list or a slice of indices on channels axis to be used for plotting. If not provided all indices will be used.

  • channel_names (Optional[List[str]]) – Names of channels of the last dimension in the given raster feature.

  • rgb (Optional[Tuple[int, int, int]]) – If provided, it should be a list of 3 indices of RGB channels to be plotted. It will plot only RGB images with these channels. This only works for raster features with spatial dimension.

abstract plot()[source]

Plots the given feature

Return type

object

collect_and_prepare_feature()[source]

Collects a feature from EOPatch and modifies it according to plotting parameters

Return type

Tuple[object, List[datetime.datetime]]