Appendix A — Homework Exercise 1: Discover Sentinel 1 data using the EODC STAC catalog

In the previous notebook, you have learnt how to access Sentinel-1 data from EODC using the STAC API. Your task now is to find and plot a Sentinel-1 acquisition of your latest holiday destination. To successfully finish the exercise, you need to perform the following tasks:

To help you to get started, we already imported all required packages and provided some code blocks. Your task is now to fill in the missing code cells indicated with # YOUR CODE HERE.

import pystac_client
from odc import stac as odc_stac

A.1 List all collection names and select one

eodc_catalog = pystac_client.Client.open("https://stac.eodc.eu/api/v1")

colllection_id = ...  # YOUR CODE HERE

collection = eodc_catalog.get_collection(colllection_id)
collection

A.2 Define spatial and temporal extent and use client to load the metadata

# Define the area of interest by providing coordinates that cover your latest
# holiday destination (can be a city, state, country, etc.)
latmin, latmax = ...  # YOUR CODE HERE
lonmin, lonmax = ...  # YOUR CODE HERE
bounds = (lonmin, latmin, lonmax, latmax)

# Define the time range. This can either be the data of your actual holiday or
# any other time range between 2016 and 2023
time_range = ...  # YOUR CODE HERE

items = ...  # YOUR CODE HERE

print(len(items), "scenes found.")

A.3 Find necessary metadata, like bands, resolution, coordinate reference system

# Pick one item from items using indexing get the relative orbit from the item
# properties
relative_orbit = ...  # YOUR CODE HERE
print(f"The relative orbit number of the item is {relative_orbit}")

A.4 Lazily load the data into an Xarray

Take care that your dataset is not to big by limiting the bounds and time range!

bands = ...  # YOUR CODE HERE
chunks = {"time": 1, "x": 1000, "y": 1000}

sig0_dc = odc_stac.load(
    items,
    bands=bands,
    bbox=bounds,
    chunks=chunks,
)

A.5 Define the nodata value and scale factor and decode the data

nodata = ...  # YOUR CODE HERE
scale = ...  # YOUR CODE HERE

sig0_dc = ...  # YOUR CODE HERE

A.6 Plot the loaded data

...  # YOUR CODE HERE