disdrodb.issue package#

Submodules#

disdrodb.issue.checks module#

Checks for issue YAML files.

disdrodb.issue.checks.check_issue_compliance(data_source, campaign_name, station_name, base_dir=None)[source]#

Check DISDRODB issue compliance.

disdrodb.issue.checks.check_issue_dict(issue_dict)[source]#

Check validity of the issue dictionary.

disdrodb.issue.checks.check_time_periods(time_periods)[source]#

Check time_periods validity.

disdrodb.issue.checks.check_timesteps(timesteps)[source]#

Check timesteps validity.

It expects timesteps string in YYYY-mm-dd HH:MM:SS format with second accuracy. If timesteps is None, return None.

disdrodb.issue.reader module#

Issue YAML File Reader.

class disdrodb.issue.reader.NoDatesSafeLoader(stream)[source]#

Bases: SafeLoader

A YAML loader that does not parse dates.

classmethod remove_implicit_resolver(tag_to_remove)[source]#

Remove implicit resolvers for a particular tag.

Takes care not to modify resolvers in super classes.

We want to load datetimes as strings, not dates.

disdrodb.issue.reader.read_issue(filepath: str) dict[source]#

Read YAML issue file.

Parameters

filepath (str) – Filepath of the issue YAML.

Returns

Issue dictionary.

Return type

dict

disdrodb.issue.reader.read_station_issue(data_source, campaign_name, station_name, base_dir=None)[source]#

Open the station issue YAML file into a dictionary.

Parameters
  • data_source (str) – The name of the institution (for campaigns spanning multiple countries) or the name of the country (for campaigns or sensor networks within a single country). Must be provided in UPPER CASE.

  • campaign_name (str) – The name of the campaign. Must be provided in UPPER CASE.

  • station_name (str) – The name of the station.

  • base_dir (str, optional) – The base directory of DISDRODB, expected in the format <...>/DISDRODB. If not specified, the base_dir path specified in the DISDRODB active configuration will be used.

Returns

issue_dict – The station issue dictionary

Return type

dictionary

disdrodb.issue.writer module#

Issue YAML File Writer.

disdrodb.issue.writer.create_station_issue(data_source, campaign_name, station_name, base_dir=None)[source]#

Write an empty YAML issue YAML file for a DISDRODB station.

An error is raised if the file already exists !

Parameters
  • data_source (str) – The name of the institution (for campaigns spanning multiple countries) or the name of the country (for campaigns or sensor networks within a single country). Must be provided in UPPER CASE.

  • campaign_name (str) – The name of the campaign. Must be provided in UPPER CASE.

  • station_name (str) – The name of the station.

  • base_dir (str, optional) – The base directory of DISDRODB, expected in the format <...>/DISDRODB. If not specified, the base_dir path specified in the DISDRODB active configuration will be used.

disdrodb.issue.writer.write_issue(filepath: str, timesteps: Optional[list] = None, time_periods: Optional[list] = None) None[source]#

Write the issue YAML file.

Parameters
  • filepath (str) – Filepath of the issue YAML to write.

  • timesteps (list, optional) – List of timesteps (to be dropped in L0 processing). The default is None..

  • time_periods (list, optional) – A list of time periods (to be dropped in L0 processing). The default is None..

Module contents#

Created on Sat Nov 11 01:12:40 2023.

@author: ghiggi

disdrodb.issue.read_station_issue(data_source, campaign_name, station_name, base_dir=None)[source]#

Open the station issue YAML file into a dictionary.

Parameters
  • data_source (str) – The name of the institution (for campaigns spanning multiple countries) or the name of the country (for campaigns or sensor networks within a single country). Must be provided in UPPER CASE.

  • campaign_name (str) – The name of the campaign. Must be provided in UPPER CASE.

  • station_name (str) – The name of the station.

  • base_dir (str, optional) – The base directory of DISDRODB, expected in the format <...>/DISDRODB. If not specified, the base_dir path specified in the DISDRODB active configuration will be used.

Returns

issue_dict – The station issue dictionary

Return type

dictionary