eogrow.tasks.batch_to_eopatch

Tasks used to transform Sentinel Hub Batch results into EOPatches.

class eogrow.tasks.batch_to_eopatch.LoadUserDataTask(*args, **kwargs)[source]

Bases: EOTask

Task that loads and adds timestamps and tile names to an EOPatch

Parameters:
  • path (str) – A path to folder containing the tiles, relative to the filesystem object.

  • filesystem (FS) – A filesystem object.

  • userdata_feature_name (str | None) – A name of a META_INFO feature in which userdata.json content could be stored

  • userdata_timestamp_reader (str | None) – A reference to a Python function or a Python code that collects timestamps from loaded userdata.json

execute(eopatch=None, *, folder='')[source]

Adds metadata to the given EOPatch

Parameters:
  • eopatch (EOPatch | None) – Name of the eopatch to process

  • folder (str) – Folder in which userdata.json is stored

Return type:

EOPatch

class eogrow.tasks.batch_to_eopatch.FixImportedTimeDependentFeatureTask(*args, **kwargs)[source]

Bases: EOTask

Fixes a time-dependent feature that has been imported as a timeless feature from batch results.

It performs the following:

  • rotates bands axis to time axis,

  • reverses order of timestamps and feature

  • potentially removes redundant timeframes according to timestamps. This is necessary because in case there were no available acquisitions batch job still had to save a single time frame with dummy values.

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

Parameters:
  • input_feature (Feature) –

  • output_feature (Feature) –

execute(eopatch)[source]

Fixes a feature in the given EOPatch

Parameters:

eopatch (EOPatch) –

Return type:

EOPatch

class eogrow.tasks.batch_to_eopatch.DeleteFilesTask(*args, **kwargs)[source]

Bases: EOTask

Delete files

Parameters:
  • path (str) – A path to folder containing the files to be deleted, relative to filesystem object.

  • filesystem (FS) – A filesystem object

  • filenames (list[str]) – A list of filenames to delete

execute(*_, folder)[source]

Execute method to delete files relative to the specified tile

Parameters:
  • folder (str) – A folder containing files

  • _ (EOPatch) –

Return type:

None