terrasensetk.utils package

Submodules

terrasensetk.utils.ArgChecker module

terrasensetk.utils.Results module

class terrasensetk.utils.Results.Results(x_test, y_test, x_train, y_train, model, features, parameters, ids_train, ids_test, study=None)[source]

Bases: object

Class used by the experiment to return all the information needed to perform further data analysis.

property features

Gets the features

property ids_test

The Range of indices for the test eopatches

property ids_train

The Range of indices for the train eopatches

property model

Gets the model

property parameters

Get the models parameters

property study

The Hyperoptimization study

property x_test

Gets the x_test

property x_train

Gets the x_train

property y_pred

Get the corresponding prediction for x_test

property y_test

Gets the y_test aka groundtruth

property y_train

Gets the y_train

terrasensetk.utils.eotasks module

class terrasensetk.utils.eotasks.AddIndicesTask(*args: Any, **kwargs: Any)[source]

Bases: eolearn.core.

execute(eopatch)[source]
class terrasensetk.utils.eotasks.CountValid(*args: Any, **kwargs: Any)[source]

Bases: eolearn.core.

The task counts number of valid observations in time-series and stores the results in the timeless mask.

execute(eopatch)[source]
class terrasensetk.utils.eotasks.EuclideanNorm(*args: Any, **kwargs: Any)[source]

Bases: eolearn.core.

The tasks calculates Euclidian Norm of all bands within an array: norm = sqrt(sum_i Bi**2), where Bi are the individual bands within user-specified feature array.

execute(eopatch)[source]
class terrasensetk.utils.eotasks.InterpolationTask(*args: Any, **kwargs: Any)[source]

Bases: eolearn.core.

execute(eopatch)[source]
class terrasensetk.utils.eotasks.NormalizedDifferenceIndex(*args: Any, **kwargs: Any)[source]

Bases: eolearn.core.

The tasks calculates user defined Normalised Difference Index (NDI) between two bands A and B as: NDI = (A-B)/(A+B).

execute(eopatch)[source]
class terrasensetk.utils.eotasks.SentinelHubValidData[source]

Bases: object

Combine Sen2Cor’s classification map with IS_DATA to define a VALID_DATA_SH mask The SentinelHub’s cloud mask is asumed to be found in eopatch.mask[‘CLM’]

terrasensetk.utils.filtervectortoraster module

class terrasensetk.utils.filtervectortoraster.FilterVectorToRaster(*args: Any, **kwargs: Any)[source]

Bases: eolearn.core.

execute(eopatch, dataset)[source]

terrasensetk.utils.utils module

terrasensetk.utils.utils.get_indexes_from_bands()[source]
terrasensetk.utils.utils.get_lucas_copernicus_path()[source]
terrasensetk.utils.utils.get_time_interval(middle_date, number_of_days)[source]

Gets the time interval surrounding the middle date separated by slashes

Parameters
  • middle_date – A string containing the date which will be included in the timerange

  • number_of_days – The number of days counting from the middle_date that will correspond to the min and max date

Returns

A list with the ´number_of_days´ before and after of the ´middle_date´

Example

>>> get_time_interval("15/09/1998", 3)
>>> ['1998-09-12', '1998-09-18']
terrasensetk.utils.utils.parse_table_to_dict(html_table)[source]
terrasensetk.utils.utils.to_square(polygon)[source]

Module contents