Skip to content

Commit

Permalink
Merge pull request #138 from clausmichele/master
Browse files Browse the repository at this point in the history
Update of Eurac example
  • Loading branch information
soxofaan authored May 8, 2020
2 parents d2b8016 + 39302c1 commit 8a28458
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
16 changes: 6 additions & 10 deletions examples/eurac_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,15 @@
print(con.list_collections())

# Load a specific dataset
datacube = con.load_collection(collection_id="S2_L2A_T32TPS_20M", bands=['AOT', 'B02', 'B03', 'B04',
'B05', 'B06', 'B07', 'B8A',
'B11', 'B12', 'SCL', 'VIS',
'WVP', 'CLD', 'SNW'])

datacube = con.load_collection(collection_id="openEO_S2_32632_10m_L2A_D22", bands=['B02', 'B03', 'B04', 'B08'])
# Perform spatial subsetting (e.g around the city of Bolzano)
datacube = datacube.filter_bbox(west=11.279182434082033, south=46.464349400461145, east=11.406898498535158,
north=46.522729291844286, crs="EPSG:32632")
# Perform temporal subsetting (e.g. for the month of august in 2017)
temp = datacube.filter_temporal(extent=["2017-08-01T00:00:00Z", "2017-08-31T00:00:00Z"])
datacube = datacube.filter_bbox(west=11.279182434082033, south=46.464349400461145,
east=11.406898498535158, north=46.522729291844286, crs="EPSG:32632")
# Perform temporal subsetting (e.g. for the month of june in 2018, only this data available in this collection)
temp = datacube.filter_temporal(extent=["2018-06-06T00:00:00Z", "2018-06-22T00:00:00Z"])
# Map features of the dataset to variables (e.g. the red and near infrared band)
red = temp.band('B04')
nir = temp.band("B8A")
nir = temp.band("B08")
# Perform operation using feature variables (e.g. calculation of NDVI (normalized difference vegetation index))
datacube = (nir - red) / (nir + red)
# Reduce on temporal dimension with max operator
Expand Down
11 changes: 4 additions & 7 deletions examples/notebooks/openEO_Python_Sentinel2_EURAC.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,15 @@
"outputs": [],
"source": [
"# load a specific dataset\n",
"datacube = con.load_collection(collection_id=\"S2_L2A_T32TPS_20M\", bands=['AOT', 'B02', 'B03', 'B04',\n",
" 'B05', 'B06', 'B07', 'B8A',\n",
" 'B11', 'B12', 'SCL', 'VIS',\n",
" 'WVP', 'CLD', 'SNW'])\n",
"datacube = con.load_collection(collection_id=\"openEO_S2_32632_10m_L2A_D22\", bands=['B02', 'B03', 'B04', 'B08'])\n",
"# perform spatial subsetting (e.g around the city of Bolzano)\n",
"datacube = datacube.filter_bbox(west=11.279182434082033, south=46.464349400461145, \n",
" east=11.406898498535158, north=46.522729291844286, crs=\"EPSG:32632\")\n",
"# perform temporal subsetting (e.g. for the month of august in 2017)\n",
"temp = datacube.filter_temporal(extent=[\"2017-08-01T00:00:00Z\", \"2017-08-31T00:00:00Z\"])\n",
"# perform temporal subsetting (e.g. for the month of june in 2018, only this data available in this collection)\n",
"temp = datacube.filter_temporal(extent=[\"2018-06-06T00:00:00Z\", \"2018-06-22T00:00:00Z\"])\n",
"# map features of the dataset to variables (e.g. the red and near infrared band)\n",
"red = temp.band('B04')\n",
"nir = temp.band(\"B8A\")\n",
"nir = temp.band(\"B08\")\n",
"# perform operation using feature variables (e.g. calculation of NDVI (normalized difference vegetation index))\n",
"datacube = (nir - red) / (nir + red)\n",
"# reduce on temporal dimension with max operator\n",
Expand Down

0 comments on commit 8a28458

Please sign in to comment.