disdrodb.issue package#
Submodules#
disdrodb.issue.checks module#
Checks for issue YAML files.
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.
- 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, thebase_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, thebase_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, thebase_dir
path specified in the DISDRODB active configuration will be used.
- Returns
issue_dict – The station issue dictionary
- Return type
dictionary