MeteoIODoc  MeteoIODoc-2.9.0
Raw Data Editing

Before any filters, resampling algorithms or data generators are applied, it is possible to edit the original data (in the following order):

  1. rename certain parameters for all stations;
  2. exclude/keep certain parameters on a per station basis;
  3. merge stations together;
  4. make a copy of a certain parameter under a new parameter name for all stations;
  5. create certain parameters based on some parametrizations.
Note
Please note that the processing order is the following: the MOVE directives are processed first, then the EXCLUDE directives, then the KEEP directives, then the MERGE directives and finally the COPY directives. The CREATE directives only come after all the raw data has been edited.

1. Data renaming (MOVE)

It is possible to rename a meteorological parameter thanks to the MOVE key. This key can take multiple source names that will be processed in the order of declaration. The syntax is new_name::MOVE = {space delimited list of original names}. Original names that are not found in the current dataset will silently be ignored, so it is safe to provide a list that contain many possible names:

TA::MOVE = air_temp air_temperature temperature_air

This can be used to rename non-standard parameter names into standard ones. In this example, if TA already had some values, it will keep those and only points not having a value will be filled by either air_temp or air_temperature or temperature_air (the first one in the list to have a value has the priority).

2. Data exclusion (EXCLUDE/KEEP)

It is possible to exclude specific parameters from given stations (on a per station basis). This is either done by using the station ID (or the '*' wildcard) followed by "::exclude" as key with a space delimited list of meteorological parameters to exclude for the station as key. Another possibility is to provide a file containing one station ID per line followed by a space delimited list of meteorological parameters to exclude for the station (the path to the file can be a relative path and will be properly resolved).

The exact opposite can also be done, excluding ALL parameters except the ones declared with the "::keep" statement (or a file containing one station ID per line followed by a space delimited list of meteorological parameters to keep for the station).

WFJ2::EXCLUDE = HS PSUM ;inline declaration of parameters exclusion
KLO3::KEEP = TA RH VW DW ;inline declaration of parameters to keep
EXCLUDE_FILE = ../input/meteo/excludes.csv ;parameters exclusions defined in a separate file
KEEP_FILE = ../input/meteo/keeps.csv ;parameters to keep defined in a separate file

In the second example (relying on a separate file), the file "../input/meteo/excludes.csv" could look like this:

WFJ2 TA RH
KLO3 HS PSUM

Another example relying on wildcards (the kept/excluded parameters lists are additive):

*::KEEP = TA RH ;all stations will keep TA and RH and reject the other parameters
WFJ2::KEEP = HS PSUM ;WFJ2 will keep TA and RH as defined above but also HS and PSUM
Note
First the exclude directives are applied and then the keep directives.

3. Data merging (MERGE)

3.1 Merging different stations (MERGE)

It is possible to merge different data sets together, with a syntax similar to the Exclude/Keep syntax. This merging occurs after any EXCLUDE/KEEP commands. This is useful, for example, to provide measurements from different stations that actually share the same measurement location or to build "composite" station from multiple real stations (in this case, using EXCLUDE and/or KEEP commands to fine tune how the composite station(s) is/are built). Please note that the order of declaration defines the priority (ie the first station that has a value for a given parameter has priority). Please also note that only common timestamps will be merged! (ie if the stations have different sampling rates, it might end up that no merge gets performed)

STATION1 = STB
STATION2 = WFJ2
STATION3 = WFJ1
STATION4 = DAV1
[...]
STB::EXCLUDE = ILWR PSUM
WFJ2::KEEP = PSUM ILWR RSWR
STB::MERGE = WFJ2 WFJ1
DAV1::MERGE = WFJ2

In order to avoid circular dependencies, a station can NOT receive data from a station AND contribute data to another station. Otherwise, a station can be merged into multiple other stations. Moreover, the merging strategy can be controlled by setting the MERGE_STRATEGY key in the [Input] section (by default it is "EXPAND_MERGE", see MeteoData::Merge_Type).

Note
One limitation when handling "extra" parameters (ie parameters that are not in the default meteoparam) is that these extra parameters must be known from the beginning. So if station2 appears later in time with extra parameters, make sure that the buffer size is large enough to reach all the way to this new station (by setting General::BUFFER_SIZE at least to the number of days from the start of the first station to the start of the second station)

3.2 Automerge

If the key AUTOMERGE is set to true in the Input section, all stations that have identical IDs will be merged together. The first station to come (usually, the first that was defined in the plugin) has the priority over the next ones.

4. Data copy (COPY)

It is also possible to duplicate a meteorological parameter as another meteorological parameter. This is done by specifying a COPY key, following the syntax new_name::COPY = existing_parameter. For example:

VW_avg::COPY = VW

This creates a new parameter VW_avg that starts as an exact copy of the raw data of VW, for each station. This newly created parameter is then processed as any other meteorological parameter (thus going through filtering, generic processing, spatial interpolations). This only current limitation is that the parameter providing the raw data must be defined for all stations (even if filled with nodata, this is good enough).

5. Data creation (CREATE)

Finally, it is possible to create new data based on some parametrizations. If the requested parameter does not exists, it will be created. Otherwise, any pre-existing data is kept and only missing values in the original data set are filled with the generated values, keeping the original sampling rate. As with all raw data editing, this takes place before any filtering/resampling/data generators. As the available algorithms are the same as for the data generators, they are listed in the data generators section (but the data creators must be declared in the [Input] section).

[Input]
P::create = STD_PRESS #the pressure is filled with STD_PRESS if no measured values are available
ISWR_POT::create = clearSky_SW #a new parameter "ISWR_POT" is created and filled with Clear Sky values