Why use pyeodh over pystac?¶
Description & purpose: This notebook introduces how pyeodh can simplify Python acccess to our EODH STAC catalogue. If you are normally a pystac user, this guide should help to familiarise you with our custom Python API client, pyeodh.
Set-up¶
%pip install pystac_client # install required package
# import both required packages
from pystac_client import Client
import pyeodh
pystac¶
Understand the EODH STAC catalogue structure¶
Start by accessing the main EODH catalog root.
cat_tac_api_root_endpoint = "https://eodatahub.org.uk/api/catalogue/stac/" #root starting point
main_cat = Client.open(url=cat_tac_api_root_endpoint) # calls the selected url
main_cat
📂 Within the root catalog, search for sub catalogs at this level.
# Check for Sub-Catalogs first
print("Searching for Sub-Catalogs...")
for link in main_cat.get_links():
if link.rel == 'child':
print(f"Found Sub-Catalog: {link.href}")
Searching for Sub-Catalogs... Found Sub-Catalog: https://eodatahub.org.uk/api/catalogue/stac/catalogs/commercial Found Sub-Catalog: https://eodatahub.org.uk/api/catalogue/stac/catalogs/public Found Sub-Catalog: https://eodatahub.org.uk/api/catalogue/stac/catalogs/supported-datasets Found Sub-Catalog: https://eodatahub.org.uk/api/catalogue/stac/catalogs/user
We find a number of sub catalogs nested within the root catalog. To help us understand where our data collection can be found, lets first print out a visual diagram of the directory structure for the EODH STAC catalogue.
# We see whats inside and get the STAC metadata collection IDs
def find_collections(catalog, depth=0):
indent = " " * depth
# Try to get collections in this specific catalog
try:
cols = list(catalog.get_collections())
for c in cols:
print(f"{indent}✅ Collection Found: {c.id}")
except Exception:
pass
# Look into children (Sub-Catalogs)
for child_link in catalog.get_children():
print(f"{indent}📂 Entering Sub-Catalog: {child_link.id}")
find_collections(child_link, depth + 1)
find_collections(main_cat)
✅ Collection Found: ukcp
✅ Collection Found: sentinel2_ard
✅ Collection Found: sentinel1_ard
✅ Collection Found: sentinel1
✅ Collection Found: qa_radiometric
✅ Collection Found: qa_radiometric
✅ Collection Found: qa_radiometric
✅ Collection Found: qa_documentation
✅ Collection Found: qa_documentation
✅ Collection Found: qa_documentation
✅ Collection Found: land_cover
✅ Collection Found: era5_repack
✅ Collection Found: eocis-sst-cdrv3
✅ Collection Found: eocis-soil-moisture-africa
✅ Collection Found: eocis-lst-s3b-night
✅ Collection Found: eocis-lst-s3b-day
✅ Collection Found: eocis-lst-s3a-night
✅ Collection Found: eocis-lst-s3a-day
✅ Collection Found: eocis-chuk-land-vegetation-lai
✅ Collection Found: eocis-chuk-land-vegetation-fapar
✅ Collection Found: eocis-chuk-geospatial-landcover
✅ Collection Found: eocis-chuk-geospatial-landclass
✅ Collection Found: eocis-chuk-geospatial-elevation
✅ Collection Found: eocis-chuk-geospatial-builtarea
✅ Collection Found: eocis-chuk-geospatial
✅ Collection Found: eocis-arctic-sea-ice-thickness-monthly
✅ Collection Found: eocis-aerosol-slstr-monthly-s3b
✅ Collection Found: eocis-aerosol-slstr-monthly-s3a
✅ Collection Found: eocis-aerosol-slstr-daily-s3b
✅ Collection Found: eocis-aerosol-slstr-daily-s3a
✅ Collection Found: cordex
✅ Collection Found: col_d9a70328-35a4-11f0-987a-56fda0cd4f2f
✅ Collection Found: col_b450a80a-361b-11f0-b489-56fda0cd4f2f
✅ Collection Found: col_b2f5128e-3585-11f0-9dd8-56fda0cd4f2f
✅ Collection Found: col_b24c51c0-35ae-11f0-9d79-56fda0cd4f2f
✅ Collection Found: col_a57fd9e4-3617-11f0-b5ae-56fda0cd4f2f
✅ Collection Found: col_9e19775a-35ae-11f0-afca-56fda0cd4f2f
✅ Collection Found: col_98c2dbc0-35ae-11f0-8b31-56fda0cd4f2f
✅ Collection Found: col_94cebf98-35ae-11f0-804c-56fda0cd4f2f
✅ Collection Found: col_8dc36848-35ae-11f0-83cf-56fda0cd4f2f
✅ Collection Found: col_89a7ee64-35ae-11f0-95e4-56fda0cd4f2f
✅ Collection Found: col_7d6a51aa-35ae-11f0-b19f-56fda0cd4f2f
✅ Collection Found: col_7515fa40-35ae-11f0-bfbc-56fda0cd4f2f
✅ Collection Found: col_6f001b68-35ae-11f0-9b1b-56fda0cd4f2f
✅ Collection Found: col_63f132f2-35ae-11f0-a3ab-56fda0cd4f2f
✅ Collection Found: col_5d9e0ca4-35ae-11f0-939e-56fda0cd4f2f
✅ Collection Found: col_5d702cbe-3624-11f0-8158-56fda0cd4f2f
✅ Collection Found: col_5c8c1646-3615-11f0-88b3-56fda0cd4f2f
✅ Collection Found: col_2d9f3edc-35a5-11f0-b30b-56fda0cd4f2f
✅ Collection Found: col_286e4d36-35a5-11f0-bbdd-56fda0cd4f2f
✅ Collection Found: cmip6
✅ Collection Found: ceda_flights
✅ Collection Found: airbus_spot_data
✅ Collection Found: airbus_sar_data
✅ Collection Found: airbus_pneo_data
✅ Collection Found: airbus_phr_data
✅ Collection Found: SkySatCollect
✅ Collection Found: PSScene
📂 Entering Sub-Catalog: commercial
✅ Collection Found: airbus_spot_data
✅ Collection Found: airbus_sar_data
✅ Collection Found: airbus_pneo_data
✅ Collection Found: airbus_phr_data
✅ Collection Found: SkySatCollect
✅ Collection Found: PSScene
📂 Entering Sub-Catalog: airbus
✅ Collection Found: airbus_spot_data
✅ Collection Found: airbus_sar_data
✅ Collection Found: airbus_pneo_data
✅ Collection Found: airbus_phr_data
📂 Entering Sub-Catalog: airbus_phr_data
📂 Entering Sub-Catalog: airbus_pneo_data
📂 Entering Sub-Catalog: airbus_sar_data
📂 Entering Sub-Catalog: airbus_spot_data
📂 Entering Sub-Catalog: planet
✅ Collection Found: SkySatCollect
✅ Collection Found: PSScene
📂 Entering Sub-Catalog: PSScene
📂 Entering Sub-Catalog: SkySatCollect
📂 Entering Sub-Catalog: public
✅ Collection Found: ukcp
✅ Collection Found: sentinel2_ard
✅ Collection Found: sentinel1_ard
✅ Collection Found: sentinel1
✅ Collection Found: land_cover
✅ Collection Found: era5_repack
✅ Collection Found: eocis-sst-cdrv3
✅ Collection Found: eocis-soil-moisture-africa
✅ Collection Found: eocis-lst-s3b-night
✅ Collection Found: eocis-lst-s3b-day
✅ Collection Found: eocis-lst-s3a-night
✅ Collection Found: eocis-lst-s3a-day
✅ Collection Found: eocis-chuk-land-vegetation-lai
✅ Collection Found: eocis-chuk-land-vegetation-fapar
✅ Collection Found: eocis-chuk-geospatial-landcover
✅ Collection Found: eocis-chuk-geospatial-landclass
✅ Collection Found: eocis-chuk-geospatial-elevation
✅ Collection Found: eocis-chuk-geospatial-builtarea
✅ Collection Found: eocis-chuk-geospatial
✅ Collection Found: eocis-arctic-sea-ice-thickness-monthly
✅ Collection Found: eocis-aerosol-slstr-monthly-s3b
✅ Collection Found: eocis-aerosol-slstr-monthly-s3a
✅ Collection Found: eocis-aerosol-slstr-daily-s3b
✅ Collection Found: eocis-aerosol-slstr-daily-s3a
✅ Collection Found: cordex
✅ Collection Found: cmip6
✅ Collection Found: ceda_flights
📂 Entering Sub-Catalog: ceda-stac-catalogue
✅ Collection Found: ukcp
✅ Collection Found: sentinel2_ard
✅ Collection Found: sentinel1_ard
✅ Collection Found: sentinel1
✅ Collection Found: land_cover
✅ Collection Found: era5_repack
✅ Collection Found: eocis-sst-cdrv3
✅ Collection Found: eocis-soil-moisture-africa
✅ Collection Found: eocis-lst-s3b-night
✅ Collection Found: eocis-lst-s3b-day
✅ Collection Found: eocis-lst-s3a-night
✅ Collection Found: eocis-lst-s3a-day
✅ Collection Found: eocis-chuk-land-vegetation-lai
✅ Collection Found: eocis-chuk-land-vegetation-fapar
✅ Collection Found: eocis-chuk-geospatial-landcover
✅ Collection Found: eocis-chuk-geospatial-landclass
✅ Collection Found: eocis-chuk-geospatial-elevation
✅ Collection Found: eocis-chuk-geospatial-builtarea
✅ Collection Found: eocis-chuk-geospatial
✅ Collection Found: eocis-arctic-sea-ice-thickness-monthly
✅ Collection Found: eocis-aerosol-slstr-monthly-s3b
✅ Collection Found: eocis-aerosol-slstr-monthly-s3a
✅ Collection Found: eocis-aerosol-slstr-daily-s3b
✅ Collection Found: eocis-aerosol-slstr-daily-s3a
✅ Collection Found: cordex
✅ Collection Found: cmip6
✅ Collection Found: ceda_flights
📂 Entering Sub-Catalog: ceda_flights
📂 Entering Sub-Catalog: cmip6
📂 Entering Sub-Catalog: cordex
📂 Entering Sub-Catalog: eocis-aerosol-slstr-daily-s3a
📂 Entering Sub-Catalog: eocis-aerosol-slstr-daily-s3b
📂 Entering Sub-Catalog: eocis-aerosol-slstr-monthly-s3a
📂 Entering Sub-Catalog: eocis-aerosol-slstr-monthly-s3b
📂 Entering Sub-Catalog: eocis-arctic-sea-ice-thickness-monthly
📂 Entering Sub-Catalog: eocis-chuk-geospatial
📂 Entering Sub-Catalog: eocis-chuk-geospatial-builtarea
📂 Entering Sub-Catalog: eocis-chuk-geospatial-elevation
📂 Entering Sub-Catalog: eocis-chuk-geospatial-landclass
📂 Entering Sub-Catalog: eocis-chuk-geospatial-landcover
📂 Entering Sub-Catalog: eocis-chuk-land-vegetation-fapar
📂 Entering Sub-Catalog: eocis-chuk-land-vegetation-lai
📂 Entering Sub-Catalog: eocis-lst-s3a-day
📂 Entering Sub-Catalog: eocis-lst-s3a-night
📂 Entering Sub-Catalog: eocis-lst-s3b-day
📂 Entering Sub-Catalog: eocis-lst-s3b-night
📂 Entering Sub-Catalog: eocis-soil-moisture-africa
📂 Entering Sub-Catalog: eocis-sst-cdrv3
📂 Entering Sub-Catalog: era5_repack
📂 Entering Sub-Catalog: land_cover
📂 Entering Sub-Catalog: sentinel1
📂 Entering Sub-Catalog: sentinel1_ard
📂 Entering Sub-Catalog: sentinel2_ard
📂 Entering Sub-Catalog: ukcp
📂 Entering Sub-Catalog: supported-datasets
📂 Entering Sub-Catalog: user
✅ Collection Found: qa_radiometric
✅ Collection Found: qa_radiometric
✅ Collection Found: qa_radiometric
✅ Collection Found: qa_documentation
✅ Collection Found: qa_documentation
✅ Collection Found: qa_documentation
✅ Collection Found: col_d9a70328-35a4-11f0-987a-56fda0cd4f2f
✅ Collection Found: col_b450a80a-361b-11f0-b489-56fda0cd4f2f
✅ Collection Found: col_b2f5128e-3585-11f0-9dd8-56fda0cd4f2f
✅ Collection Found: col_b24c51c0-35ae-11f0-9d79-56fda0cd4f2f
✅ Collection Found: col_a57fd9e4-3617-11f0-b5ae-56fda0cd4f2f
✅ Collection Found: col_9e19775a-35ae-11f0-afca-56fda0cd4f2f
✅ Collection Found: col_98c2dbc0-35ae-11f0-8b31-56fda0cd4f2f
✅ Collection Found: col_94cebf98-35ae-11f0-804c-56fda0cd4f2f
✅ Collection Found: col_8dc36848-35ae-11f0-83cf-56fda0cd4f2f
✅ Collection Found: col_89a7ee64-35ae-11f0-95e4-56fda0cd4f2f
✅ Collection Found: col_7d6a51aa-35ae-11f0-b19f-56fda0cd4f2f
✅ Collection Found: col_7515fa40-35ae-11f0-bfbc-56fda0cd4f2f
✅ Collection Found: col_6f001b68-35ae-11f0-9b1b-56fda0cd4f2f
✅ Collection Found: col_63f132f2-35ae-11f0-a3ab-56fda0cd4f2f
✅ Collection Found: col_5d9e0ca4-35ae-11f0-939e-56fda0cd4f2f
✅ Collection Found: col_5d702cbe-3624-11f0-8158-56fda0cd4f2f
✅ Collection Found: col_5c8c1646-3615-11f0-88b3-56fda0cd4f2f
✅ Collection Found: col_2d9f3edc-35a5-11f0-b30b-56fda0cd4f2f
✅ Collection Found: col_286e4d36-35a5-11f0-bbdd-56fda0cd4f2f
📂 Entering Sub-Catalog: npl
✅ Collection Found: qa_radiometric
✅ Collection Found: qa_radiometric
✅ Collection Found: qa_radiometric
✅ Collection Found: qa_documentation
✅ Collection Found: qa_documentation
✅ Collection Found: qa_documentation
📂 Entering Sub-Catalog: processing-results
✅ Collection Found: qa_radiometric
✅ Collection Found: qa_radiometric
✅ Collection Found: qa_radiometric
✅ Collection Found: qa_documentation
✅ Collection Found: qa_documentation
✅ Collection Found: qa_documentation
📂 Entering Sub-Catalog: qa-workflow
✅ Collection Found: qa_radiometric
✅ Collection Found: qa_radiometric
✅ Collection Found: qa_radiometric
✅ Collection Found: qa_documentation
✅ Collection Found: qa_documentation
✅ Collection Found: qa_documentation
📂 Entering Sub-Catalog: airbus_phr_qa
✅ Collection Found: qa_radiometric
✅ Collection Found: qa_documentation
📂 Entering Sub-Catalog: qa_documentation
📂 Entering Sub-Catalog: qa_radiometric
📂 Entering Sub-Catalog: planet_psscene_qa
✅ Collection Found: qa_radiometric
✅ Collection Found: qa_documentation
📂 Entering Sub-Catalog: qa_documentation
📂 Entering Sub-Catalog: qa_radiometric
📂 Entering Sub-Catalog: sentinel-2_l1c_qa
✅ Collection Found: qa_radiometric
✅ Collection Found: qa_documentation
📂 Entering Sub-Catalog: qa_documentation
📂 Entering Sub-Catalog: qa_radiometric
📂 Entering Sub-Catalog: tjellicoetpzuk
✅ Collection Found: col_d9a70328-35a4-11f0-987a-56fda0cd4f2f
✅ Collection Found: col_b450a80a-361b-11f0-b489-56fda0cd4f2f
✅ Collection Found: col_b2f5128e-3585-11f0-9dd8-56fda0cd4f2f
✅ Collection Found: col_b24c51c0-35ae-11f0-9d79-56fda0cd4f2f
✅ Collection Found: col_a57fd9e4-3617-11f0-b5ae-56fda0cd4f2f
✅ Collection Found: col_9e19775a-35ae-11f0-afca-56fda0cd4f2f
✅ Collection Found: col_98c2dbc0-35ae-11f0-8b31-56fda0cd4f2f
✅ Collection Found: col_94cebf98-35ae-11f0-804c-56fda0cd4f2f
✅ Collection Found: col_8dc36848-35ae-11f0-83cf-56fda0cd4f2f
✅ Collection Found: col_89a7ee64-35ae-11f0-95e4-56fda0cd4f2f
✅ Collection Found: col_7d6a51aa-35ae-11f0-b19f-56fda0cd4f2f
✅ Collection Found: col_7515fa40-35ae-11f0-bfbc-56fda0cd4f2f
✅ Collection Found: col_6f001b68-35ae-11f0-9b1b-56fda0cd4f2f
✅ Collection Found: col_63f132f2-35ae-11f0-a3ab-56fda0cd4f2f
✅ Collection Found: col_5d9e0ca4-35ae-11f0-939e-56fda0cd4f2f
✅ Collection Found: col_5d702cbe-3624-11f0-8158-56fda0cd4f2f
✅ Collection Found: col_5c8c1646-3615-11f0-88b3-56fda0cd4f2f
✅ Collection Found: col_2d9f3edc-35a5-11f0-b30b-56fda0cd4f2f
✅ Collection Found: col_286e4d36-35a5-11f0-bbdd-56fda0cd4f2f
📂 Entering Sub-Catalog: processing-results
✅ Collection Found: col_d9a70328-35a4-11f0-987a-56fda0cd4f2f
✅ Collection Found: col_b450a80a-361b-11f0-b489-56fda0cd4f2f
✅ Collection Found: col_b2f5128e-3585-11f0-9dd8-56fda0cd4f2f
✅ Collection Found: col_b24c51c0-35ae-11f0-9d79-56fda0cd4f2f
✅ Collection Found: col_a57fd9e4-3617-11f0-b5ae-56fda0cd4f2f
✅ Collection Found: col_9e19775a-35ae-11f0-afca-56fda0cd4f2f
✅ Collection Found: col_98c2dbc0-35ae-11f0-8b31-56fda0cd4f2f
✅ Collection Found: col_94cebf98-35ae-11f0-804c-56fda0cd4f2f
✅ Collection Found: col_8dc36848-35ae-11f0-83cf-56fda0cd4f2f
✅ Collection Found: col_89a7ee64-35ae-11f0-95e4-56fda0cd4f2f
✅ Collection Found: col_7d6a51aa-35ae-11f0-b19f-56fda0cd4f2f
✅ Collection Found: col_7515fa40-35ae-11f0-bfbc-56fda0cd4f2f
✅ Collection Found: col_6f001b68-35ae-11f0-9b1b-56fda0cd4f2f
✅ Collection Found: col_63f132f2-35ae-11f0-a3ab-56fda0cd4f2f
✅ Collection Found: col_5d9e0ca4-35ae-11f0-939e-56fda0cd4f2f
✅ Collection Found: col_5d702cbe-3624-11f0-8158-56fda0cd4f2f
✅ Collection Found: col_5c8c1646-3615-11f0-88b3-56fda0cd4f2f
✅ Collection Found: col_2d9f3edc-35a5-11f0-b30b-56fda0cd4f2f
✅ Collection Found: col_286e4d36-35a5-11f0-bbdd-56fda0cd4f2f
📂 Entering Sub-Catalog: snuggs
✅ Collection Found: col_d9a70328-35a4-11f0-987a-56fda0cd4f2f
✅ Collection Found: col_b450a80a-361b-11f0-b489-56fda0cd4f2f
✅ Collection Found: col_b2f5128e-3585-11f0-9dd8-56fda0cd4f2f
✅ Collection Found: col_b24c51c0-35ae-11f0-9d79-56fda0cd4f2f
✅ Collection Found: col_a57fd9e4-3617-11f0-b5ae-56fda0cd4f2f
✅ Collection Found: col_9e19775a-35ae-11f0-afca-56fda0cd4f2f
✅ Collection Found: col_98c2dbc0-35ae-11f0-8b31-56fda0cd4f2f
✅ Collection Found: col_94cebf98-35ae-11f0-804c-56fda0cd4f2f
✅ Collection Found: col_8dc36848-35ae-11f0-83cf-56fda0cd4f2f
✅ Collection Found: col_89a7ee64-35ae-11f0-95e4-56fda0cd4f2f
✅ Collection Found: col_7d6a51aa-35ae-11f0-b19f-56fda0cd4f2f
✅ Collection Found: col_7515fa40-35ae-11f0-bfbc-56fda0cd4f2f
✅ Collection Found: col_6f001b68-35ae-11f0-9b1b-56fda0cd4f2f
✅ Collection Found: col_63f132f2-35ae-11f0-a3ab-56fda0cd4f2f
✅ Collection Found: col_5d9e0ca4-35ae-11f0-939e-56fda0cd4f2f
✅ Collection Found: col_5d702cbe-3624-11f0-8158-56fda0cd4f2f
✅ Collection Found: col_5c8c1646-3615-11f0-88b3-56fda0cd4f2f
✅ Collection Found: col_2d9f3edc-35a5-11f0-b30b-56fda0cd4f2f
✅ Collection Found: col_286e4d36-35a5-11f0-bbdd-56fda0cd4f2f
📂 Entering Sub-Catalog: catalog
✅ Collection Found: col_d9a70328-35a4-11f0-987a-56fda0cd4f2f
✅ Collection Found: col_b450a80a-361b-11f0-b489-56fda0cd4f2f
✅ Collection Found: col_b2f5128e-3585-11f0-9dd8-56fda0cd4f2f
✅ Collection Found: col_b24c51c0-35ae-11f0-9d79-56fda0cd4f2f
✅ Collection Found: col_a57fd9e4-3617-11f0-b5ae-56fda0cd4f2f
✅ Collection Found: col_9e19775a-35ae-11f0-afca-56fda0cd4f2f
✅ Collection Found: col_98c2dbc0-35ae-11f0-8b31-56fda0cd4f2f
✅ Collection Found: col_94cebf98-35ae-11f0-804c-56fda0cd4f2f
✅ Collection Found: col_8dc36848-35ae-11f0-83cf-56fda0cd4f2f
✅ Collection Found: col_89a7ee64-35ae-11f0-95e4-56fda0cd4f2f
✅ Collection Found: col_7d6a51aa-35ae-11f0-b19f-56fda0cd4f2f
✅ Collection Found: col_7515fa40-35ae-11f0-bfbc-56fda0cd4f2f
✅ Collection Found: col_6f001b68-35ae-11f0-9b1b-56fda0cd4f2f
✅ Collection Found: col_63f132f2-35ae-11f0-a3ab-56fda0cd4f2f
✅ Collection Found: col_5d9e0ca4-35ae-11f0-939e-56fda0cd4f2f
✅ Collection Found: col_5d702cbe-3624-11f0-8158-56fda0cd4f2f
✅ Collection Found: col_5c8c1646-3615-11f0-88b3-56fda0cd4f2f
✅ Collection Found: col_2d9f3edc-35a5-11f0-b30b-56fda0cd4f2f
✅ Collection Found: col_286e4d36-35a5-11f0-bbdd-56fda0cd4f2f
📂 Entering Sub-Catalog: col_286e4d36-35a5-11f0-bbdd-56fda0cd4f2f
📂 Entering Sub-Catalog: col_2d9f3edc-35a5-11f0-b30b-56fda0cd4f2f
📂 Entering Sub-Catalog: col_5c8c1646-3615-11f0-88b3-56fda0cd4f2f
📂 Entering Sub-Catalog: col_5d702cbe-3624-11f0-8158-56fda0cd4f2f
📂 Entering Sub-Catalog: col_5d9e0ca4-35ae-11f0-939e-56fda0cd4f2f
📂 Entering Sub-Catalog: col_63f132f2-35ae-11f0-a3ab-56fda0cd4f2f
📂 Entering Sub-Catalog: col_6f001b68-35ae-11f0-9b1b-56fda0cd4f2f
📂 Entering Sub-Catalog: col_7515fa40-35ae-11f0-bfbc-56fda0cd4f2f
📂 Entering Sub-Catalog: col_7d6a51aa-35ae-11f0-b19f-56fda0cd4f2f
📂 Entering Sub-Catalog: col_89a7ee64-35ae-11f0-95e4-56fda0cd4f2f
📂 Entering Sub-Catalog: col_8dc36848-35ae-11f0-83cf-56fda0cd4f2f
📂 Entering Sub-Catalog: col_94cebf98-35ae-11f0-804c-56fda0cd4f2f
📂 Entering Sub-Catalog: col_98c2dbc0-35ae-11f0-8b31-56fda0cd4f2f
📂 Entering Sub-Catalog: col_9e19775a-35ae-11f0-afca-56fda0cd4f2f
📂 Entering Sub-Catalog: col_a57fd9e4-3617-11f0-b5ae-56fda0cd4f2f
📂 Entering Sub-Catalog: col_b24c51c0-35ae-11f0-9d79-56fda0cd4f2f
📂 Entering Sub-Catalog: col_b2f5128e-3585-11f0-9dd8-56fda0cd4f2f
📂 Entering Sub-Catalog: col_b450a80a-361b-11f0-b489-56fda0cd4f2f
📂 Entering Sub-Catalog: col_d9a70328-35a4-11f0-987a-56fda0cd4f2f
Access a data collection with pystac¶
To find the sentinel2_ard data collection, we should look inside the sub catalogs. Sentinel 2 ARD can be found within the sub catalog called public, according to our directory structure.
cat_pub_root_endpoint = "https://eodatahub.org.uk/api/catalogue/stac/catalogs/public/" #root starting point
public_cat = Client.open(url=cat_pub_root_endpoint) # calls the selected url
public_cat
Similar to entering a folder, we use get_child to look inside that public catalog.
sub2 = main_cat.get_child('public')
sub2
🔎 Going one level deeper into the directory structure, we find...
sub3 = sub2.get_child('ceda-stac-catalogue')
sub3
We try looking for our collection here, inside the ceda-stac-catalogue
sentinel_coll = sub3.get_collection('sentinel2_ard')
sentinel_coll
We have found the sentinel2_ard collection! We can also reach the data collection using the get_child arguement too.
sub4 = sub3.get_child('sentinel2_ard')
sub4
- Using pystac to access the EODH STAC catalogue was quite difficult, and required many lines of code!
- Now, let's understand why using pyeodh is a better choice that makes accessing the data collection much simpler
pyeodh¶
🔌 First, we reach the data Hub by connecting via the Python client.
client = pyeodh.Client(
base_url="https://eodatahub.org.uk"
).get_catalog_service()
Access a data collection with pyeodh¶
Using inbuild functions of the pyeodh package, we can quickly fetch the catalog and the collection we are looking for. Based on our printed directory structure, we already know the filepath.
s2ard = client.get_catalog("public/catalogs/ceda-stac-catalogue").get_collection('sentinel2_ard')
s2ard
<pyeodh.resource_catalog.Collection at 0x7f5a1b07bb90>
Immediately we can print some items, so we know that we have successfully found our data collection!
items = s2ard.get_items()
# Warning: without the limit to 10 items this will take a long time for large catalogues such as s2ard
for item in items[:10]:
print(item.id)
neodc.sentinel_ard.data.sentinel_2.2026.02.12.S2A_20260212_latn608lonw0002_T30VXN_ORB037_20260212145709_utm30n_osgb neodc.sentinel_ard.data.sentinel_2.2026.02.12.S2B_20260212_latn608lonw0002_T30VXN_ORB037_20260212145332_utm30n_osgb neodc.sentinel_ard.data.sentinel_2.2026.02.12.S2B_20260212_latn599lonw0020_T30VWM_ORB037_20260212145332_utm30n_osgb neodc.sentinel_ard.data.sentinel_2.2026.02.12.S2B_20260212_latn599lonw0002_T30VXM_ORB037_20260212145332_utm30n_osgb neodc.sentinel_ard.data.sentinel_2.2026.02.12.S2B_20260212_latn590lonw0020_T30VWL_ORB037_20260212145332_utm30n_osgb neodc.sentinel_ard.data.sentinel_2.2026.02.12.S2B_20260212_latn572lonw0037_T30VVJ_ORB037_20260212145332_utm30n_osgb neodc.sentinel_ard.data.sentinel_2.2026.02.12.S2B_20260212_latn510lonw0036_T30UVB_ORB037_20260212145332_utm30n_osgb neodc.sentinel_ard.data.sentinel_2.2026.02.11.S2C_20260211_latn509lonw0008_T30UXB_ORB094_20260211125907_utm30n_osgb neodc.sentinel_ard.data.sentinel_2.2026.02.11.S2C_20260211_latn509lone0009_T31UCS_ORB094_20260211125907_utm31n_osgb neodc.sentinel_ard.data.sentinel_2.2026.02.11.S2C_20260211_latn509lone0006_T30UYB_ORB094_20260211125907_utm30n_osgb
Author(s): Gemma Newbold, Gisela Romero Candanedo, Alastair Graham
Date created: 2026-02-18
Date last modified: 2026-03-16
Licence: This notebook is licensed under Creative Commons Attribution-ShareAlike 4.0 International. The code is released using the BSD-2-Clause license.
Copyright © - All rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.