MeteoIODoc  MeteoIODoc-2.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ALPUG.h
Go to the documentation of this file.
1 /***********************************************************************************/
2 /* Copyright 2015 WSL Institute for Snow and Avalanche Research SLF-DAVOS */
3 /***********************************************************************************/
4 /* This file is part of MeteoIO.
5  MeteoIO is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  MeteoIO is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with MeteoIO. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef ALPUG_H
19 #define ALPUG_H
20 
21 #include <meteoio/IOInterface.h>
22 
23 #include <string>
24 #include <deque>
25 
26 namespace mio {
27 
36 class ALPUG : public IOInterface {
37  public:
38  ALPUG(const std::string& configfile);
39  ALPUG(const ALPUG&);
40  ALPUG(const Config& cfgreader);
41  ~ALPUG() throw() {}
42 
43  virtual void readStationData(const Date& date, std::vector<StationData>& vecStation);
44  virtual void readMeteoData(const Date& dateStart, const Date& dateEnd,
45  std::vector< std::vector<MeteoData> >& vecMeteo);
46 
47  private:
48  void parseInputOutputSection();
49  void readMetaData();
50  bool isDuplicate(const std::string& line) ;
51  Date parseDINDate(const std::string& datum) const;
52  bool parseLine(const std::string& filename, const size_t& nr_of_data_fields, const Date& dateStart, const Date& dateEnd, const std::string& line, MeteoData &md, bool &isValid) const;
53  void readMetoFile(const size_t& station_index, const Date& dateStart, const Date& dateEnd,
54  std::vector<MeteoData>& vecM);
55 
56  const Config cfg;
57  std::vector<StationData> vecMeta;
58  std::deque<std::string> LinesBuffer;
59  std::vector<std::string> vecIDs, vecFields;
60  std::string coordin, coordinparam, coordout, coordoutparam; //projection parameters
61  std::string inpath, outpath;
62  double in_dflt_TZ, out_dflt_TZ;
63  unsigned short wrap_month;
64 
65  static const double plugin_nodata; //plugin specific nodata value, e.g. -999
66  static const size_t max_buffered_lines; //how many lines to keep in buffer to check for duplicates?
67  static const char* dflt_extension;
68 };
69 
70 } //namespace
71 #endif
A class representing the IO Layer of the software Alpine3D. For each type of IO (File, DB, Webservice, etc) a derived class is to be created that holds the specific implementation of the appropriate virtual methods. The IOHandler class is a wrapper class that is able to deal with all above implementations of the IOInterface abstract base class.
Definition: IOInterface.h:43
A class that reads a key/value file. These files (typically named *.ini) follow the INI file format s...
Definition: Config.h:58
~ALPUG()
Definition: ALPUG.h:41
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: ALPUG.cc:353
ALPUG(const std::string &configfile)
Definition: ALPUG.cc:81
This plugin reads data as they come out of ALPUG stations, in ASCII.
Definition: ALPUG.h:36
A class to handle timestamps. This class handles conversion between different time display formats (I...
Definition: Date.h:79
virtual void readStationData(const Date &date, std::vector< StationData > &vecStation)
Fill vecStation with StationData objects for a certain date of interest.
Definition: ALPUG.cc:209
A class to represent a singular measurement received from one station at a certain time (represented ...
Definition: MeteoData.h:101