1.1.1.1.4. tds2stac.analysers.recognizer module#

class tds2stac.analysers.recognizer.Recognizer(main_catalog_url: str, nested_check: bool = False, logger_properties: dict = {}, requests_properties: dict = {})[source]#

Bases: object

A class for recognizing nine different and possible scenarios in management of TDS datasets. We will explain each scenario in the following.

First scenario: Just catalogRef tags are located directly under the dataset element tag.

tag https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/era5/sfc/single/catalog.xml (nested)

Second senarion: CatalogRefs are not under a dataset element tag and directly come below the catalog.

https://thredds.imk-ifu.kit.edu/thredds/catalog/catalogues/sensor_catalog_ext.xml (nested)

Third scenario: One single dataset tag is located next to CatalogRef tags. All are under a dataset tag.

https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/chirps/catalog.xml (nested)

Fourth scenario: An empty datasets.

https://thredds.imk-ifu.kit.edu/thredds/catalog/catalogues/bio_geo_chem_catalog_ext.xml or https://thredds.atmohub.kit.edu/thredds/catalog/snowfogs/catalog.xml

Fifth scenario: There is no CatalogRef tag and all are dataset tag. All of them are under a dataset tag.

https://thredds.imk-ifu.kit.edu/thredds/catalog/climate/raster/global/chelsa/v1.2/catalog.html

Sixth scenario: A single dataset

https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/era5/sfc/single/catalog.xml?dataset=regclim/raster/global/era5/sfc/single/era5_sfc_20210101.nc

Seventh scenario: An aggregated dataset

https://thredds.imk-ifu.kit.edu/thredds/catalog/catalogues/swabian_moses_2021.xml?dataset=swabian_moses_aggregation

Eighth scenario: A combination of caralogRef and dataset tags that is not under a dataset tag.It’s similar to second scenario but with datasets

https://thredds.imk-ifu.kit.edu/thredds/catalog/catalogues/transfer.xml

Ninth scenario: When we have a bunch of single dataset tags next to catalogref. It’s similar to third scenario but with more datasets.

https://thredds.imk-ifu.kit.edu/thredds/catalog/regclim/raster/global/hydrogfd/v3.0/catalog.xml (nested)

Parameters:
  • main_catalog_url – TDS Catalog url to start harvesting

  • nested_check – An option for checking nested datasets in TDS (True or False)

  • auth – Authentication for TDS catalog e.g.(‘user’, ‘password’)

  • logger_properties – A dictionary for logger properties.

  • requests_properties – A dictionary for requests properties.

all_dirs: list#
all_dirs_extensions: list#
all_href: list#
logger_properties: dict#

A dictionary for logger properties. For more information see Logger

main_catalog_url: str#

TDS Catalog url to start harvesting (*)

nested_check: bool#

An option for checking nested datasets in TDS (True or False) (optional)

nested_checker(url: str)[source]#

A function for returning the depth of nested datasets in TDS for scenarios 1, 3, ,and 9

nested_checker_exceptions(url: str)[source]#

A function for returning the depth of nested datasets in TDS for scenarios 2 and 8

nested_num: int#
nested_num_temp: int#
recognition_function(url: str, xml_content)[source]#

A function for recognizing number of scenarios in TDS

requests_properties: dict#

To obtain additional information on this topic, refer to the requests_properties. The default value is an empty dictionary.

status: str | None#