Hint

You can run this notebook in a live session with Binder Helmholtz.

  • it is important to acknowledge that the utilization of the Helmholtz is restricted to individuals who possess the necessary credentials as Helmholtz users. It is highly recommended to utilize the Python scipy option when constructing the environment in order to mitigate the occurrence of a 404 Bad request error.

Nested Collection#

This class focuses on obtaining specific information from nested scenarios, such as those labeled as first, second, third, eighth, and ninth, based on the desired depth layer. The default depth layer is set to zero. The resulting output will consist of a collection of data elements, including the Collection-ID, Collection-Title, and the accompanying URLs. These data elements are associated with a nested numbering system that is assumed to originate from the Recognizer class in the TDS.

Here, we present several illustrative examples showcasing the utilization of this particular function.

[ ]:
from tds2stac import NestedCollectionInspector

# First scenario, depth 0
first_case_0 = NestedCollectionInspector(
    "https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/era5/sfc/single/catalog.html",
    nested_number=0,
)

# First scenario, depth greater than zero
first_case_gt_0 = NestedCollectionInspector(
    "https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/era5/sfc/single/catalog.html",
    nested_number=1,
)

# Second scenario, depth zero
second_case_0 = NestedCollectionInspector(
    "https://thredds.imk-ifu.kit.edu/thredds/catalog/catalogues/sensor_catalog_ext.html",
    nested_number=0,
)

# Second scenario, depth greater than zero
second_case_gt_0 = NestedCollectionInspector(
    "https://thredds.imk-ifu.kit.edu/thredds/catalog/catalogues/sensor_catalog_ext.html",
    nested_number=1,
)

# Third scenario, depth zero
third_case_0 = NestedCollectionInspector(
    "https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/catalog.html",
    nested_number=0,
)

# Third scenario, depth greater than zero
third_case_gt_0 = NestedCollectionInspector(
    "https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/catalog.html",
    nested_number=1,
)

# Eighth scenario, depth zero
eighth_case_0 = NestedCollectionInspector(
    "https://thredds.imk-ifu.kit.edu/thredds/catalog/catalogues/transfer.html",
    nested_number=0,
)

# Eighth scenario, depth greater than zero
eighth_case_gt_0 = NestedCollectionInspector(
    "https://thredds.imk-ifu.kit.edu/thredds/catalog/catalogues/transfer.html",
    nested_number=1,
)

# Ninth scenario, depth zero
ninth_case_0 = NestedCollectionInspector(
    "https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/hydrogfd/v3.0/catalog.html",
    nested_number=0,
)

# Ninth scenario, depth greater than zero
ninth_case_gt_0 = NestedCollectionInspector(
    "https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/hydrogfd/v3.0/catalog.html",
    nested_number=1,
)
Output: [('https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/era5/sfc/single/catalog.xml', 'catalog_regclim_raster_global_era5_sfc_single', 'Catalog Regclim Raster Global Era5 Sfc Single', ['https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/era5/sfc/single/aggregated/catalog.xml', 'https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/era5/sfc/single/climatology/catalog.xml', 'https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/era5/sfc/single/daily/catalog.xml', 'https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/era5/sfc/single/monthly/catalog.xml', 'https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/era5/sfc/single/static/catalog.xml'])] [('https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/era5/sfc/single/aggregated/catalog.xml', 'catalog_regclim_raster_global_era5_sfc_single_aggregated', 'Catalog Regclim Raster Global Era5 Sfc Single Aggregated', []), ('https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/era5/sfc/single/climatology/catalog.xml', 'catalog_regclim_raster_global_era5_sfc_single_climatology', 'Catalog Regclim Raster Global Era5 Sfc Single Climatology', []), ('https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/era5/sfc/single/daily/catalog.xml', 'catalog_regclim_raster_global_era5_sfc_single_daily', 'Catalog Regclim Raster Global Era5 Sfc Single Daily', []), ('https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/era5/sfc/single/monthly/catalog.xml', 'catalog_regclim_raster_global_era5_sfc_single_monthly', 'Catalog Regclim Raster Global Era5 Sfc Single Monthly', []), ('https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/era5/sfc/single/static/catalog.xml', 'catalog_regclim_raster_global_era5_sfc_single_static', 'Catalog Regclim Raster Global Era5 Sfc Single Static', [])] [('https://thredds.imk-ifu.kit.edu/thredds/catalog/catalogues/sensor_catalog_ext.xml', 'catalog_catalogues_sensor_catalog_ext', 'Catalog Catalogues Sensor Catalog Ext', ['https://thredds.imk-ifu.kit.edu/thredds/catalog/MOSES/Swabian_MOSES/single_files/catalog.xml', 'https://thredds.imk-ifu.kit.edu/thredds/catalog/catalogues/swabian_moses_2021.xml?dataset=swabian_moses_aggregation', 'https://thredds.imk-ifu.kit.edu/thredds/catalog/fendt/ec/single_files/catalog.xml', 'https://thredds.imk-ifu.kit.edu/thredds/catalog/catalogues/fendt_site_data.xml?dataset=fendt_ec_aggregation', 'https://thredds.imk-ifu.kit.edu/thredds/catalog/graswang/ec/single_files/catalog.xml', 'https://thredds.imk-ifu.kit.edu/thredds/catalog/catalogues/graswang_site_data.xml?dataset=graswang_ec_aggregation'])] [('https://thredds.imk-ifu.kit.edu/thredds/catalog/catalogues/swabian_moses_2021.xml', 'catalog_catalogues_swabian_moses_2021', 'Catalog Catalogues Swabian Moses 2021', ['https://thredds.imk-ifu.kit.edu/thredds/catalog/MOSES/Swabian_MOSES/single_files/catalog.xml', 'https://thredds.imk-ifu.kit.edu/thredds/catalog/catalogues/swabian_moses_2021.xml?dataset=swabian_moses_aggregation']), ('https://thredds.imk-ifu.kit.edu/thredds/catalog/catalogues/fendt_site_data.xml', 'catalog_catalogues_fendt_site_data', 'Catalog Catalogues Fendt Site Data', ['https://thredds.imk-ifu.kit.edu/thredds/catalog/fendt/ec/single_files/catalog.xml', 'https://thredds.imk-ifu.kit.edu/thredds/catalog/catalogues/fendt_site_data.xml?dataset=fendt_ec_aggregation']), ('https://thredds.imk-ifu.kit.edu/thredds/catalog/catalogues/graswang_site_data.xml', 'catalog_catalogues_graswang_site_data', 'Catalog Catalogues Graswang Site Data', ['https://thredds.imk-ifu.kit.edu/thredds/catalog/graswang/ec/single_files/catalog.xml', 'https://thredds.imk-ifu.kit.edu/thredds/catalog/catalogues/graswang_site_data.xml?dataset=graswang_ec_aggregation'])] [('https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/catalog.xml', 'catalog_regclim_raster_global_chirps', 'Catalog Regclim Raster Global Chirps', ['https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/climatology/0.05/catalog.xml', 'https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/climatology/0.1/catalog.xml', 'https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/daily/0.05/catalog.xml', 'https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/daily/0.1/catalog.xml', 'https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/monthly/0.05/catalog.xml', 'https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/catalog.xml?dataset=chirps_v1.0/chirps-v2.0.monthly.nc'])] [('https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/climatology/catalog.xml', 'catalog_regclim_raster_global_chirps_climatology', 'Catalog Regclim Raster Global Chirps Climatology', ['https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/climatology/0.05/catalog.xml', 'https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/climatology/0.1/catalog.xml']), ('https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/daily/catalog.xml', 'catalog_regclim_raster_global_chirps_daily', 'Catalog Regclim Raster Global Chirps Daily', ['https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/daily/0.05/catalog.xml', 'https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/daily/0.1/catalog.xml']), ('https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/monthly/catalog.xml', 'catalog_regclim_raster_global_chirps_monthly', 'Catalog Regclim Raster Global Chirps Monthly', ['https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/monthly/0.05/catalog.xml']), ('https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/catalog.xml?dataset=chirps_v1.0/chirps-v2.0.monthly.nc', 'catalog_regclim_raster_global_chirps_dataset_chirps_v1_0_chirps_v2_0_monthly', 'Catalog Regclim Raster Global Chirps Dataset Chirps V1 0 Chirps V2 0 Monthly', [])] [('https://thredds.imk-ifu.kit.edu/thredds/catalog/catalogues/transfer.xml', 'catalog_catalogues_transfer', 'Catalog Catalogues Transfer', ['https://thredds.imk-ifu.kit.edu/thredds/catalog/transfer/catalog.xml', 'https://thredds.imk-ifu.kit.edu/thredds/catalog/catalogues/transfer.xml?dataset=s3_test_gpcc_netcdf'])] [('https://thredds.imk-ifu.kit.edu/thredds/catalog/transfer/catalog.xml', 'catalog_transfer', 'Catalog Transfer', []), ('https://thredds.imk-ifu.kit.edu/thredds/catalog/catalogues/transfer.xml?dataset=s3_test_gpcc_netcdf', 'catalog_catalogues_transfer_dataset_s3_test_gpcc_netcdf', 'Catalog Catalogues Transfer Dataset S3 Test Gpcc Netcdf', [])] [] []