eolearn.io.sentinelhub_process

Input tasks that collect data from Sentinel-Hub Process API

class eolearn.io.sentinelhub_process.SentinelHubInputBaseTask(data_collection, size=None, resolution=None, cache_folder=None, config=None, max_threads=None, upsampling=None, downsampling=None, session_loader=None)[source]

Bases: EOTask

Base class for Processing API input tasks

Parameters:
  • data_collection (DataCollection) – A collection of requested satellite data.

  • size (tuple[int, int] | None) – Number of pixels in x and y dimension.

  • resolution (float | tuple[float, float] | None) – Resolution in meters, passed as a single number or a tuple of two numbers - resolution in horizontal and resolution in vertical direction.

  • cache_folder (str | None) – Path to cache_folder. If set to None (default) requests will not be cached.

  • config (SHConfig | None) – An instance of SHConfig defining the service

  • max_threads (int | None) – Maximum threads to be used when downloading data.

  • upsampling (ResamplingType | None) – A type of upsampling to apply on data

  • downsampling (ResamplingType | None) – A type of downsampling to apply on data

  • session_loader (Callable[[], SentinelHubSession] | None) – A callable that returns a valid SentinelHubSession, used for session sharing. Creates a new session if set to None, which should be avoided in large scale parallelization.

execute(eopatch=None, bbox=None, time_interval=None, geometry=None)[source]

Main execute method for the Process API tasks. The geometry is used only in conjunction with the bbox and does not act as a replacement.

Parameters:
  • eopatch (EOPatch | None) –

  • bbox (BBox | None) –

  • time_interval (Tuple[None | str | date, None | str | date] | None) –

  • geometry (Geometry | None) –

Return type:

EOPatch

class eolearn.io.sentinelhub_process.SentinelHubEvalscriptTask(features, evalscript, data_collection, size=None, resolution=None, maxcc=None, time_difference=None, mosaicking_order=None, cache_folder=None, config=None, max_threads=None, upsampling=None, downsampling=None, aux_request_args=None, session_loader=None, timestamp_filter=<function filter_times>)[source]

Bases: SentinelHubInputBaseTask

Process API task to download data using evalscript

Parameters:
  • features (FeaturesSpecification) – Features to construct from the evalscript.

  • evalscript (str) – Evalscript for the request. Beware that all outputs from SentinelHub services should be named and should have the same name as corresponding feature

  • data_collection (DataCollection) – Source of requested satellite data.

  • size (tuple[int, int] | None) – Number of pixels in x and y dimension.

  • resolution (float | tuple[float, float] | None) – Resolution in meters, passed as a single number or a tuple of two numbers - resolution in horizontal and resolution in vertical direction.

  • maxcc (float | None) – Maximum cloud coverage, a float in interval [0, 1]

  • time_difference (dt.timedelta | None) – Minimum allowed time difference, used when filtering dates. Also used by the service for mosaicking, timestamps might be misleading for large values.

  • cache_folder (str | None) – Path to cache_folder. If set to None (default) requests will not be cached.

  • config (SHConfig | None) – An instance of SHConfig defining the service

  • max_threads (int | None) – Maximum threads to be used when downloading data.

  • upsampling (ResamplingType | None) – A type of upsampling to apply on data

  • downsampling (ResamplingType | None) – A type of downsampling to apply on data

  • mosaicking_order (str | MosaickingOrder | None) – Mosaicking order, which has to be either ‘mostRecent’, ‘leastRecent’ or ‘leastCC’.

  • aux_request_args (dict | None) – a dictionary with auxiliary information for the input_data part of the SH request

  • session_loader (Callable[[], SentinelHubSession] | None) – A callable that returns a valid SentinelHubSession, used for session sharing. Creates a new session if set to None, which should be avoided in large scale parallelization.

  • timestamp_filter (Callable[[list[dt.datetime], dt.timedelta], list[dt.datetime]]) – A function that performs the final filtering of timestamps, usually to remove multiple occurrences within the time_difference window. Check get_available_timestamps for more info.

class eolearn.io.sentinelhub_process.SentinelHubInputTask(data_collection, size=None, resolution=None, bands_feature=None, bands=None, additional_data=None, evalscript=None, maxcc=None, time_difference=None, cache_folder=None, config=None, max_threads=None, bands_dtype=None, single_scene=False, mosaicking_order=None, upsampling=None, downsampling=None, aux_request_args=None, session_loader=None, timestamp_filter=<function filter_times>)[source]

Bases: SentinelHubInputBaseTask

Process API input task that loads 16bit integer data and converts it to a 32bit float feature.

Parameters:
  • data_collection (DataCollection) – Source of requested satellite data.

  • size (tuple[int, int] | None) – Number of pixels in x and y dimension.

  • resolution (float | tuple[float, float] | None) – Resolution in meters, passed as a single number or a tuple of two numbers - resolution in horizontal and resolution in vertical direction.

  • bands_feature (Feature | None) – A target feature into which to save the downloaded images.

  • bands (list[str] | None) – An array of band names. If not specified it will download all bands specified for a given data collection.

  • additional_data (list[Feature] | None) – A list of additional data to be downloaded, such as SCL, SNW, dataMask, etc.

  • evalscript (str | None) – An optional parameter to override an evalscript that is generated by default

  • maxcc (float | None) – Maximum cloud coverage.

  • time_difference (dt.timedelta | None) – Minimum allowed time difference, used when filtering dates. Also used by the service for mosaicking, timestamps might be misleading for large values.

  • cache_folder (str | None) – Path to cache_folder. If set to None (default) requests will not be cached.

  • config (SHConfig | None) – An instance of SHConfig defining the service

  • max_threads (int | None) – Maximum threads to be used when downloading data.

  • bands_dtype (None | np.dtype | type) – output type of the bands array, if set to None the default is used

  • single_scene (bool) – If true, the service will compute a single image for the given time interval using mosaicking.

  • mosaicking_order (str | MosaickingOrder | None) – Mosaicking order, which has to be either ‘mostRecent’, ‘leastRecent’ or ‘leastCC’.

  • upsampling (ResamplingType | None) – A type of upsampling to apply on data

  • downsampling (ResamplingType | None) – A type of downsampling to apply on data

  • aux_request_args (dict | None) – a dictionary with auxiliary information for the input_data part of the SH request

  • session_loader (Callable[[], SentinelHubSession] | None) – A callable that returns a valid SentinelHubSession, used for session sharing. Creates a new session if set to None, which should be avoided in large scale parallelization.

  • timestamp_filter (Callable[[list[dt.datetime], dt.timedelta], list[dt.datetime]]) – A callable that performs the final filtering of timestamps, usually to remove multiple occurrences within the time_difference window. Check get_available_timestamps for more info.

class eolearn.io.sentinelhub_process.SentinelHubDemTask(feature=None, data_collection=DataCollection.DEM, **kwargs)[source]

Bases: SentinelHubEvalscriptTask

Adds DEM data (one of the collections) to

DATA_TIMELESS EOPatch feature.

Parameters:
  • features – Features to construct from the evalscript.

  • evalscript – Evalscript for the request. Beware that all outputs from SentinelHub services should be named and should have the same name as corresponding feature

  • data_collection (DataCollection) – Source of requested satellite data.

  • size – Number of pixels in x and y dimension.

  • resolution – Resolution in meters, passed as a single number or a tuple of two numbers - resolution in horizontal and resolution in vertical direction.

  • maxcc – Maximum cloud coverage, a float in interval [0, 1]

  • time_difference – Minimum allowed time difference, used when filtering dates. Also used by the service for mosaicking, timestamps might be misleading for large values.

  • cache_folder – Path to cache_folder. If set to None (default) requests will not be cached.

  • config – An instance of SHConfig defining the service

  • max_threads – Maximum threads to be used when downloading data.

  • upsampling – A type of upsampling to apply on data

  • downsampling – A type of downsampling to apply on data

  • mosaicking_order – Mosaicking order, which has to be either ‘mostRecent’, ‘leastRecent’ or ‘leastCC’.

  • aux_request_args – a dictionary with auxiliary information for the input_data part of the SH request

  • session_loader – A callable that returns a valid SentinelHubSession, used for session sharing. Creates a new session if set to None, which should be avoided in large scale parallelization.

  • timestamp_filter – A function that performs the final filtering of timestamps, usually to remove multiple occurrences within the time_difference window. Check get_available_timestamps for more info.

  • feature (None | str | Feature) –

  • kwargs (Any) –