MeteoIODoc 20241017.2ccf54a9
BUFRIO.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2/***********************************************************************************/
3/* Copyright 2009 WSL Institute for Snow and Avalanche Research SLF-DAVOS */
4/***********************************************************************************/
5/* This file is part of MeteoIO.
6 MeteoIO is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 MeteoIO is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with MeteoIO. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef BUFRIO_H
20#define BUFRIO_H
21
22#include "BUFRFile.h"
23
24#include <string>
25
26namespace mio {
27
35class BUFRIO : public IOInterface {
36 public:
37 BUFRIO(const std::string& configfile);
38 BUFRIO(const Config& cfgreader);
39
40 virtual void readStationData(const Date &date, std::vector<StationData> &vecStation);
41 virtual void readMeteoData(const Date &dateStart, const Date &dateEnd, std::vector<std::vector<MeteoData>> &vecMeteo);
42
43 virtual void writeMeteoData(const std::vector<std::vector<MeteoData>> &vecMeteo, const std::string &name = "");
44
45 private:
46 const Config cfg;
47 std::string coordin, coordinparam, coordout, coordoutparam; //projection parameters
48
49 std::vector<BUFRFile> station_files;
50 std::vector<std::string> additional_params;
51
52 std::string outpath;
53 bool separate_stations;
54 bool verbose_out;
55
56 // Cryo Station specific
57 bool write_cryo;
58 long wigos_id_series, wigos_issuer, wigos_issue_no, station_type, surface_type, snow_depth_method;
59 std::string wigos_local_id;
60
61 static const std::string template_filename;
62 static const double plugin_nodata; //plugin specific nodata value, e.g. -999
63
64 void parseInputSection();
65 void parseOutputSection();
66 void setStationData(CodesHandlePtr &message, const StationData &station, const Coords &position, const std::string &subset_prefix);
67 void setWIGOSId(CodesHandlePtr &message, const std::string &subset_prefix);
68
69
70};
71
72} //namespace
73#endif
Definition: BUFRIO.h:35
BUFRIO(const std::string &configfile)
Definition: BUFRIO.cc:181
virtual void readStationData(const Date &date, std::vector< StationData > &vecStation)
Fill vecStation with StationData objects for a certain date of interest.
Definition: BUFRIO.cc:264
virtual void writeMeteoData(const std::vector< std::vector< MeteoData > > &vecMeteo, const std::string &name="")
Write vecMeteo time series to a certain destination.
Definition: BUFRIO.cc:521
virtual void readMeteoData(const Date &dateStart, const Date &dateEnd, std::vector< std::vector< MeteoData > > &vecMeteo)
Fill vecMeteo with a time series of objects corresponding to the interval indicated by dateStart and ...
Definition: BUFRIO.cc:252
A class that reads a key/value file. These files (typically named *.ini) follow the INI file format s...
Definition: Config.h:79
A class to handle geographic coordinate systems. This class offers an easy way to transparently conve...
Definition: Coords.h:83
A class to handle timestamps. This class handles conversion between different time display formats (I...
Definition: Date.h:87
A class representing the IO Layer of the software Alpine3D. For each type of IO (File,...
Definition: IOInterface.h:98
A class to represent meteo stations with attributes like longitude, latitude, etc.
Definition: StationData.h:41
std::unique_ptr< codes_handle, HandleDeleter > CodesHandlePtr
Definition: libcodes.h:51
Definition: Config.cc:31