MeteoIODoc  MeteoIODoc-2.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GeotopIO.h
Go to the documentation of this file.
1 /***********************************************************************************/
2 /* Copyright 2009 EPFL */
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 GEOTOPIO_H
19 #define GEOTOPIO_H
20 
21 #include <meteoio/IOInterface.h>
22 
23 #include <string>
24 
25 namespace mio {
26 
35 class GeotopIO : public IOInterface {
36  public:
37  GeotopIO(const std::string& configfile);
38  GeotopIO(const GeotopIO&);
39  GeotopIO(const Config&);
40 
41  virtual void readStationData(const Date& date, std::vector<StationData>& vecStation);
42  virtual void readMeteoData(const Date& dateStart, const Date& dateEnd,
43  std::vector< std::vector<MeteoData> >& vecMeteo);
44 
45  virtual void writeMeteoData(const std::vector< std::vector<MeteoData> >& vecMeteo, const std::string& name="");
46 
47  private:
48  std::string getValueForKey(const std::string& line);
49  void initParamNames(std::map<std::string, size_t>& mapParam);
50  void readMetaData(const std::string& metafile);
51  void identify_fields(const std::vector<std::string>& tmpvec, const std::string& filename,
52  std::vector<size_t>& indices, MeteoData& md);
53  void convertUnits(MeteoData& meteo);
54  void convertUnitsBack(MeteoData& meteo);
55  void parseDate(const std::string& datestring, const std::string& fileandline, Date& date);
56  void parseMetaData(const std::string& head, const std::string& datastr, std::vector<std::string>& tmpvec);
57 
58  const Config cfg;
59  double in_tz, out_tz;
60  size_t nr_of_stations;
61  std::vector< std::map <Date, std::streampos> > vec_streampos; //in order to save file pointers
62  std::vector<mio::StationData> vecStation;
63  std::map<std::string, size_t> mapColumnNames;
64  static const double plugin_nodata; //plugin specific nodata value, e.g. -999
65  std::string coordin, coordinparam, coordout, coordoutparam; //projection parameters
66  static const size_t sw_direct, sw_diffuse, cloud_factor;
67 };
68 
69 } //end namespace
70 
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
GeotopIO(const std::string &configfile)
Definition: GeotopIO.cc:61
virtual void writeMeteoData(const std::vector< std::vector< MeteoData > > &vecMeteo, const std::string &name="")
Write vecMeteo time series to a certain destination.
Definition: GeotopIO.cc:91
A class that reads a key/value file. These files (typically named *.ini) follow the INI file format s...
Definition: Config.h:58
This class enables the access meteo data in legacy Geotop format.
Definition: GeotopIO.h:35
virtual void readStationData(const Date &date, std::vector< StationData > &vecStation)
Fill vecStation with StationData objects for a certain date of interest.
Definition: GeotopIO.cc:185
A class to handle timestamps. This class handles conversion between different time display formats (I...
Definition: Date.h:79
A class to represent a singular measurement received from one station at a certain time (represented ...
Definition: MeteoData.h:101
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: GeotopIO.cc:197