Skip to content

Commit

Permalink
Merge pull request #45 from Open-EO/12-job-splitters
Browse files Browse the repository at this point in the history
12 job splitters
  • Loading branch information
GriffinBabe authored Mar 11, 2024
2 parents 71969bf + 86bd7c4 commit 63541e9
Show file tree
Hide file tree
Showing 29 changed files with 1,736 additions and 438 deletions.
908 changes: 908 additions & 0 deletions examples/extraction_pipelines/S2_extraction_example.ipynb

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions examples/feature_extractors/quantile_feature_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ def output_labels(self) -> list:

def execute(self, inarr: xr.DataArray) -> xr.DataArray:
# compute indices
b03 = inarr.sel(bands="S2-B03")
b04 = inarr.sel(bands="S2-B04")
b05 = inarr.sel(bands="S2-B05")
b06 = inarr.sel(bands="S2-B06")
b08 = inarr.sel(bands="S2-B08")
b11 = inarr.sel(bands="S2-B11")
b12 = inarr.sel(bands="S2-B12")
b03 = inarr.sel(bands="S2-L2A-B03")
b04 = inarr.sel(bands="S2-L2A-B04")
b05 = inarr.sel(bands="S2-L2A-B05")
b06 = inarr.sel(bands="S2-L2A-B06")
b08 = inarr.sel(bands="S2-L2A-B08")
b11 = inarr.sel(bands="S2-L2A-B11")
b12 = inarr.sel(bands="S2-L2A-B12")

ndvi = (b08 - b04) / (b08 + b04)
ndwi = (b03 - b08) / (b03 + b08)
Expand Down Expand Up @@ -100,14 +100,14 @@ def execute(self, inarr: xr.DataArray) -> xr.DataArray:

# The bands that you can extract are defined in the code openeo_gfmap.fetching.s2.BASE_SENTINEL2_L2A_MAPPING
bands = [
"S2-B03",
"S2-B04",
"S2-B05",
"S2-B06",
"S2-B08",
"S2-B11",
"S2-B12",
"S2-SCL",
"S2-L2A-B03",
"S2-L2A-B04",
"S2-L2A-B05",
"S2-L2A-B06",
"S2-L2A-B08",
"S2-L2A-B11",
"S2-L2A-B12",
"S2-L2A-SCL",
]

# Use the base feching
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ dependencies = [
"openeo[localprocessing]",
"cftime",
"pyarrow",
"fastparquet"
"fastparquet",
"h3",
]

[project.urls]
Expand Down
10 changes: 10 additions & 0 deletions src/openeo_gfmap/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Backend(Enum):
TERRASCOPE = "terrascope"
EODC = "eodc" # Dask implementation. Do not test on this yet.
CDSE = "cdse" # Terrascope implementation (pyspark) #URL: openeo.dataspace.copernicus.eu (need to register)
CDSE_STAGING = "cdse-staging"
LOCAL = "local" # Based on the same components of EODc


Expand Down Expand Up @@ -82,6 +83,14 @@ def cdse_connection() -> openeo.Connection:
)


def cdse_staging_connection() -> openeo.Connection:
"""Performs a connection to the CDSE backend using oidc authentication."""
return _create_connection(
url="openeo-staging.dataspace.copernicus.eu",
env_var_suffix="CDSE_STAGING",
)


def eodc_connection() -> openeo.Connection:
"""Perfroms a connection to the EODC backend using the oidc authentication."""
return _create_connection(
Expand All @@ -93,4 +102,5 @@ def eodc_connection() -> openeo.Connection:
BACKEND_CONNECTIONS: Dict[Backend, Callable] = {
Backend.TERRASCOPE: vito_connection,
Backend.CDSE: cdse_connection,
Backend.CDSE_STAGING: cdse_staging_connection,
}
11 changes: 0 additions & 11 deletions src/openeo_gfmap/extractions/__init__.py

This file was deleted.

41 changes: 0 additions & 41 deletions src/openeo_gfmap/extractions/commons.py

This file was deleted.

78 changes: 0 additions & 78 deletions src/openeo_gfmap/extractions/extraction.py

This file was deleted.

129 changes: 0 additions & 129 deletions src/openeo_gfmap/extractions/s2.py

This file was deleted.

Loading

0 comments on commit 63541e9

Please sign in to comment.