pycif.plugins.obsparsers.wdcgg — API reference#
Configuration reference: wdcgg plugin
- pycif.plugins.obsparsers.wdcgg.headers.get_header(obs_file, maxlen)[source]#
Extract the header from a WDCGG File
- Parameters:
obs_file (str) – path to input file
maxlen (int) – abort after this amount of lines when reading header. Default 300
- Returns:
List with all Lines of the Header
- Return type:
List[str]
- pycif.plugins.obsparsers.wdcgg.headers.parse_header(header, spec, list_extract, default_unit='ppm', default_tz='utc')[source]#
Extract information from the header
- Parameters:
header (list[str]) – extracted header
spec (str) – species to extract
list_extract (list[str]) – list of parameters to return ‘flag’ to extract flag ‘error’ to extract observation error any other parameter appearing in the columns
default_unit (str) – default unit generally used to report this species
default_tz (str) – default time zone for this file
- Returns:
- a 4-element tuple containing
names (list[str]): list of columns names to extract
columns (list[int]): list of column index to extract
date_ids (list[int]): list of column ids for date information
- extra (dict): extra information contained in the header and not
in the body of the file, e.g., altitude, coordinates, unit, etc.
- pycif.plugins.obsparsers.wdcgg.utils.remap_head(s)[source]#
Adapts names to extract values in WDCGG header
- pycif.plugins.obsparsers.wdcgg.utils.find_header(id_extract, header)[source]#
Finds the value of a constant parameter (e.g., latitude, altitude, etc.) in the header of a file
- pycif.plugins.obsparsers.wdcgg.utils.rescale(obs_file, header)[source]#
Finds out on what scale the measurement was reported and returns the corresponding scaling factor.
Notes
If the scale is not in the list of recognized scales, then returns a NaN to kill the data
- pycif.plugins.obsparsers.wdcgg.utils.parse_file_name(obs_file, **kwargs)[source]#
Parses WDCGG file name and extract corresponding information.
This is based on WDCGG standard naming format as detailed in: http://ds.data.jma.go.jp/gmd/wdcgg/pub/data/WDCGG_filename_format.pdf
- pycif.plugins.obsparsers.wdcgg.utils.convert_unit(df, params, unit='ppm', default_unit='ppm')[source]#
Converts between ppb, ppm, ppt. Default is conversion to ppm