MeteoIODoc 20241005.2ccf54a9
Configuration file

Since MeteoIO is a library, you, as an end user, will not be directly exposed to it: the library is called by the program that you are using, not directly by yourself. You will basically have to set some parameters in a configuration file that defines how MeteoIO has to behave. This configuration file is often named "io.ini" and follows the INI file format standard.

It is highly recommended that you first understand the general structure of MeteoIO before moving forward. We will then show the configuration file syntax and then the configuration file structure.

Configuration file syntax

The configuration inputs/outputs file is divided in sections. Each section name is enclosed in brackets.

[My_section]
bla bla bla

Within each section, you might have comments and/or key/value pairs. The comments start with a "#" or a ";" sign and run until the end of the line. A whole line might be commented out, or only a fraction of it. A key/value pair is a keyword, followed by a "=" sign, followed by the value to associate with this key.

#This is a commented out line
PI = 3.14159 #key/value pair and a comment
static const double PI
Definition: Meteoconst.h:73

A valid value can be an integer, a float, or string, a list of keywords, a mixed list of keywords and numbers...

TA::algorithms = IDW_LAPSE CST_LAPSE

A value can also be an environment variable, another key or an arithmetic expression (see the Config class documentation for more details):

USERNAME = ${env:LOGNAME}
FIRST_NAME = John
FULL_NAME = ${FIRST_NAME}_${USERNAME}
AGE = ${{3*20-18+pi/18}}

Configuration file structure

MeteoIO imposes a minimum structure to the configuration file: It must contain the [General], [Input] and [Output] sections. If any filter is to be used, a [Filters] section has to be present and if any spatial interpolation is to be used, an [Interpolations2D] section has to be present. A minimal set of keys has to be there, and potentially a number of optional keys. Moreover, the program that you are using might also impose you some specific keys or sections. The keys and their location in the configuration file (ie: to which section they belong) depends on the module that is actually using them. The optional keys depend on the specific options handled by each specific module (or plugin, or algorithm). Therefore, we can draw the following skeleton:

[General]
[Input]
COORDSYS = CH1903 #mandatory: which coordinate system is used for the geographic coordinates
COORDPARAM = -999 #extra arguments for the chosen coordinate system (often, none)
TIME_ZONE = +1 #default time zone for inputs
DEM = ARC #plugin to use for reading DEM information
#this might be followed by any number of arguments that are specific to this plugin
METEO = A3D #plugin to use for reading meteorological data
#this might be followed by any number of arguments that are specific to this plugin
[Output]
COORDSYS = CH1903
GRID2D = ARC #plugin to use for writing 2D grids
[Filters]
TA::filter1 = min_max #first filter to use on the parameter TA
TA::arg1::min = 230 #arguments for this first filter
TA::arg1::max = 330 #arguments for this first filter
TA::filter2 = rate #second filter to use (in chronological order)
TA::arg2::max = 0.01 #arguments for this second filter
#add any extra filter that you want to use. They will be applied serially
[Interpolations2D]
TA::algorithms = IDW_LAPSE CST_LAPSE #list of algorithms to consider for use for spatially interpolating parameter TA
TA::cst_lapse::rate = -0.008 #parameter for a specific interpolation algorithm for parameter TA

It is also possible (for advanced use) to import another configuration file, see in the Config class documentation.

Where to find the proper documentation

As can be seen from the previous example, each plugin, each filter or each interpolation algorithm might have its own parameters. Therefore, this is the documentation of each specific plugin/filter/algorithm that has to be used in order to figure out what can be configured when it is used (see the next sections in the welcome page).