Two candidate scenes to be used throughout the lesson are the following:
from pystac_client import Client
from shapely.geometry import Point
api_url = "https://earth-search.aws.element84.com/v0"
client = Client.open(api_url)
# collection: Sentinel-2, Level 2A, COGs
collection = "sentinel-s2-l2a-cogs"
# AMS, Dam square
p = Point(4.89, 52.37)
mysearch = client.search(
collections=[collection],
intersects=p,
datetime="2020-03-26/2020-03-28",
query=["eo:cloud_cover<10"]
)
items = mysearch.get_all_items()
items.save_object("search.json")
Previews:
Scene 1
Scene 2
The snippet above could be the basis for the new Episode 5 (on dataset access).
At the beginning of the following episodes, we could read in the search results as items = pystac.ItemCollection.from_file("search.json") and work with remote assets, downloading data only when needed. We would also need to link to somewhere in the setup where we describe how to modify the code if one wants to download data from Figshare and work with local files.
Episode 6 could be based on the short wave infrared band (B9) of the first scene: items[0].assets["B09"] (it has a large region with no data, and a small bright region (clouds) to test robust=True).
Episode 8 could use the true color image of the second scene: items[1].assets["visual"] (this is probably the most visually attractive to show the cropped regions).
Episode 9 could use the Red and NIR bands of the second scene: items[1].assets["B04"], items[1].assets["B8A"] (these bands are needed for computing the NDVI and the different resolution is good to show the effect of reproject_match).
Episode 10 could use the same NIR band as Episode 9 (hopefully it would show different NIR reflectance for vegetation/no vegetation areas?).
Episode 11 (on parallel raster calculations) could use the true color image and the scene classification layer of the first scene: items[0].assets["visual"], items[0].assets["SCL"] (need some clouds to mask).
Two candidate scenes to be used throughout the lesson are the following:
Previews:
Scene 1
Scene 2
The snippet above could be the basis for the new Episode 5 (on dataset access).
At the beginning of the following episodes, we could read in the search results as
items = pystac.ItemCollection.from_file("search.json")
and work with remote assets, downloading data only when needed. We would also need to link to somewhere in the setup where we describe how to modify the code if one wants to download data from Figshare and work with local files.items[0].assets["B09"]
(it has a large region with no data, and a small bright region (clouds) to testrobust=True
).items[1].assets["visual"]
(this is probably the most visually attractive to show the cropped regions).items[1].assets["B04"], items[1].assets["B8A"]
(these bands are needed for computing the NDVI and the different resolution is good to show the effect ofreproject_match
).items[0].assets["visual"], items[0].assets["SCL"]
(need some clouds to mask).