disdrodb.api package

Submodules

disdrodb.api.checks module

disdrodb.api.checks.check_disdrodb_dir(disdrodb_dir: str)[source]

Raise an error if the path does not end with “DISDRODB”.

disdrodb.api.checks.check_path(path: str) None[source]

Check if a path exists.

Parameters

path (str) – Path to check.

Raises

FileNotFoundError – If the path does not exist.

disdrodb.api.checks.check_url(url: str) bool[source]

Check url.

Parameters

url (str) – URL to check.

Returns

True if url well formated, False if not well formated.

Return type

bool

disdrodb.api.info module

disdrodb.api.info.get_campaign_name_from_filepaths(filepaths)[source]
disdrodb.api.info.get_end_time_from_filepaths(filepaths)[source]
disdrodb.api.info.get_info_from_filepath(fpath)[source]

Retrieve file information dictionary from filepath.

disdrodb.api.info.get_key_from_filepath(fpath, key)[source]

Extract specific key information from a list of filepaths.

disdrodb.api.info.get_key_from_filepaths(fpaths, key)[source]

Extract specific key information from a list of filepaths.

disdrodb.api.info.get_product_level_from_filepaths(filepaths)[source]
disdrodb.api.info.get_start_end_time_from_filepaths(filepaths)[source]
disdrodb.api.info.get_start_time_from_filepaths(filepaths)[source]
disdrodb.api.info.get_station_name_from_filepaths(filepaths)[source]
disdrodb.api.info.get_version_from_filepaths(filepaths, integer=False)[source]

disdrodb.api.io module

disdrodb.api.io.available_campaigns(disdrodb_dir, product_level, data_sources=None, return_tuple=True)[source]

Return campaigns for which stations data are available.

disdrodb.api.io.available_data_sources(disdrodb_dir, product_level)[source]

Return data sources for which stations data are available.

disdrodb.api.io.available_stations(disdrodb_dir, product_level, data_sources=None, campaign_names=None, return_tuple=True)[source]

Return stations for which data are available.

disdrodb.api.io.check_data_sources(disdrodb_dir, product_level, data_sources)[source]

Check DISDRODB data source.

It checks only if the directory exist.

disdrodb.api.io.check_product_level(product_level)[source]

Check DISDRODB product level.

disdrodb.api.io.get_metadata_dict(disdrodb_dir, product_level, data_source, campaign_name, station_name)[source]

Get metadata of a given station.

disdrodb.api.metadata module

disdrodb.api.metadata.get_list_metadata(disdrodb_dir, data_sources=None, campaign_names=None, station_names=None, with_stations_data=True)[source]

Get the list of metadata filepaths in the DISDRODB raw archive.

Parameters
  • disdrodb_dir (str) – Base directory of DISDRODB Format: <…>/DISDRODB

  • data_sources (str or list of str) – Name of data source(s) of interest. The name(s) must be UPPER CASE. The default is None

  • campaign_names (str or list of str) – Name of the campaign(s) of interest. The name(s) must be UPPER CASE. The default is None

  • station_names (str or list of str) – Station names of interest. The default is None

  • with_stations_data (bool) – If True, only return metadata filepaths that have corresponding data in the local DISDRODB raw archive. The default is True

Returns

metadata_fpaths – List of metadata YAML file paths

Return type

list

disdrodb.api.metadata.read_station_metadata(disdrodb_dir, product_level, data_source, campaign_name, station_name)[source]

Open the station metadata YAML file into a dictionary.

Module contents