Obsparsers (obsparser)

Available Obsparsers (obsparser)

The following obsparsers are implemented in pyCIF so far:

Description

The obsparser (Observation Parser) class parses and formats raw observation files into the standard pyCIF observations format (see here for details).

obsparser objects are called by the standard/std measurement object.

Required parameters, dependencies and functions

do_parse

pycif.plugins.obsparsers.template.do_parse(self, obs_file, **kwargs)[source]

Parse function for a file from template observations

Parameters:

obs_file (str) – Path to input file

Returns:

Dataframe from input file df[parameter][station]

Return type:

pandas.DataFrame

parse_multiple_files (optional)

The parse_multiple_files is defined by default in the ObsParser class. It loops on files fitting a path pattern and parses them individually by calling the function do_parse.

If files cannot be processed individually, the function parse_multiple_files should be implemented in the corresponding obsparser plugin.

It should return the dataframe with all required observations.

class pycif.utils.classes.obsparsers.ObsParser(plg_orig=None, orig_name='', **kwargs)[source]

Class for handling time series parsing from different data providers and data file formats.

parse_multiple_files(**kwargs)[source]

Parses multiple files specified by a glob pattern and stores the content into a datastore.

Parameters:

self – the plugin with its describing arguments (in particular dir_obs)

Returns:

{obs_file} = df[obssite_id, parameter]

Return type:

dict

Note

By default, the function calls self.parse_file, which filters out NaNs and check that all required columns are available.