WSL/SLF GitLab Repository

Commit 0478acfa authored by Mathias Bavay's avatar Mathias Bavay
Browse files

the key BUFF_CHUNK_SIZE has been renamed as BUFFER_SIZE for more clarity and...

the key BUFF_CHUNK_SIZE has been renamed as BUFFER_SIZE for more clarity and its default value is now 370 (which makes more sense for most applications). Some documentation about it has been written.
parent 3c821b0e
#include <meteoio/MeteoIO.h>
#include <cstdio>
using namespace std;
using namespace mio; //The MeteoIO namespace is called mio
......
[General]
BUFF_CHUNK_SIZE = 370
BUFFER_SIZE = 370
BUFF_BEFORE = 1.5
;BUFF_GRIDS = 0
......
......@@ -153,6 +153,10 @@ namespace mio {
* <tr><td>\subpage snowpack "SNOWPACK"</td><td>meteo</td><td>original SNOWPACK meteo files</td><td></td></tr>
* </table></center>
*
* In order to optimize the data retrieval, the raw data is buffered. This means that up to BUFFER_SIZE days of data will be read at once by the plugin
* so subsequent reads will not have to get back to the data source (this key is in the [General] section). It is usually a good idea to configure BUFFER_SIZE
* to the intended duration of the simulation (in days).
*
* @section data_manipulations Raw data editing
* Before any filters, resampling algorithms or data generators are applied, it is possible to edit the original data:
* - rename certain parameters for all stations
......@@ -221,7 +225,7 @@ namespace mio {
*
* @note One limitation when handling "extra" parameters (ie parameters that are not in the default \ref meteoparam) is that these extra
* parameters must be known from the begining. 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::BUFF_CHUNK_SIZE at least to the number of days from
* 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)
*
* @subsection data_move Data renaming
......@@ -590,7 +594,7 @@ void IOHandler::merge_stations(STATIONS_SET& vecStation) const
}
}
if (!found)
throw InvalidArgumentException("Station ID '"+fromStationID+"' not found when merging toward station '"+toStationID+"'. Consider increasing BUFF_CHUNK_SIZE!", AT);
throw InvalidArgumentException("Station ID '"+fromStationID+"' not found when merging toward station '"+toStationID+"'. Consider increasing BUFFER_SIZE!", AT);
}
}
......
......@@ -36,8 +36,8 @@ TimeSeriesManager::TimeSeriesManager(IOHandler& in_iohandler, const Config& in_c
void TimeSeriesManager::setDfltBufferProperties()
{
double chunk_size_days = 15.; //default chunk size value
cfg.getValue("BUFF_CHUNK_SIZE", "General", chunk_size_days, IOUtils::nothrow); //in days
double chunk_size_days = 370.; //default chunk size value
cfg.getValue("BUFFER_SIZE", "General", chunk_size_days, IOUtils::nothrow); //in days
chunk_size = Duration(chunk_size_days, 0);
//get buffer centering options
......
......@@ -86,6 +86,7 @@ namespace mio {
* [Input]
* METEO = OSHD
* METEOPATH = /local/LATEST_03h_RUN
* METEOPATH_RECURSIVE = true
* METAFILE = STAT_LIST.mat ;another possibility could be /local/metadata/STAT_LIST.mat
* STATION1 = ATT2
* STATION2 = WFJ2
......
[General]
BUFF_CHUNK_SIZE = 30
BUFFER_SIZE = 30
BUFF_BEFORE = 1.5
[Input]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment