MeteoIODoc  2.10.0
Goes.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: LGPL-3.0-or-later
2 /***********************************************************************************/
3 /* Copyright 2019 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 GOES_H
20 #define GOES_H
21 
22 #include <meteoio/IOInterface.h>
23 
24 namespace mio {
25 
26 class GoesStation {
27  public:
28  GoesStation();
29  GoesStation(const std::string& goesID, const Config& metaCfg, const float& in_nodata, const double& in_TZ, const std::string& coordin, const std::string& coordinparam);
30  Date parseDate(const std::vector<float>& raw_data) const;
31  MeteoData parseDataLine(const Date& dt, const std::vector<float>& raw_data) const;
32  StationData getStationData() const {return md_template.meta;}
33  size_t getNElems() const {return nElems;}
34  bool isValid() const {return validStation;}
35 
36  size_t meteoIdx;
37  private:
38  void parseFieldsSpecs(const std::vector<std::string>& fieldsNames, MeteoData &meteo_template, std::vector<size_t> &idx);
39 
40  std::vector<size_t> fields_idx;
41  std::vector<double> units_offset, units_multiplier, units_multiplier_neg;
42  MeteoData md_template;
43  double TZ;
44  float nodata;
45  size_t stationID_idx, year_idx, hour_idx, jdn_idx, nElems;
46  bool validStation;
47 };
48 
60 class GoesIO : public IOInterface {
61  public:
62  GoesIO(const std::string& configfile);
63  GoesIO(const GoesIO&);
64  GoesIO(const Config& cfgreader);
65 
66  virtual void readStationData(const Date& date, std::vector<StationData>& vecStation);
67 
68  virtual void readMeteoData(const Date& dateStart, const Date& dateEnd,
69  std::vector< std::vector<MeteoData> >& vecMeteo);
70 
71  private:
72  void parseInputOutputSection(const Config& cfgreader);
73  void readRaw(const std::string& file_and_path, const Date& dateStart, const Date& dateEnd, std::vector< std::vector<MeteoData> >& vecMeteo);
74  void addStation(const std::string& goesID);
75 
76  std::vector<std::string> vecFilenames;
77 
78  std::map<std::string, GoesStation> stations;
79  Config metaCfg;
80  std::string meteopath;
81  std::string coordin, coordinparam; //projection parameters
82  double in_TZ;
83  float in_nodata;
84  bool debug, OnlyFromPast;
85 };
86 
87 } //namespace
88 #endif
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 timestamps. This class handles conversion between different time display formats (I...
Definition: Date.h:87
This plugin deals with data that has been transmitted through the GOES satellites (see also https://w...
Definition: Goes.h:60
GoesIO(const std::string &configfile)
Definition: Goes.cc:101
GoesIO(const GoesIO &)
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: Goes.cc:155
virtual void readStationData(const Date &date, std::vector< StationData > &vecStation)
Fill vecStation with StationData objects for a certain date of interest.
Definition: Goes.cc:139
Definition: Goes.h:26
size_t getNElems() const
Definition: Goes.h:33
StationData getStationData() const
Definition: Goes.h:32
GoesStation()
Definition: Goes.cc:298
bool isValid() const
Definition: Goes.h:34
size_t meteoIdx
index within vecMeteo
Definition: Goes.h:36
Date parseDate(const std::vector< float > &raw_data) const
Definition: Goes.cc:379
MeteoData parseDataLine(const Date &dt, const std::vector< float > &raw_data) const
Definition: Goes.cc:386
A class representing the IO Layer of the software Alpine3D. For each type of IO (File,...
Definition: IOInterface.h:98
A class to represent a singular measurement received from one station at a certain time (represented ...
Definition: MeteoData.h:107
StationData meta
The meta data of the measurement.
Definition: MeteoData.h:385
A class to represent meteo stations with attributes like longitude, latitude, etc.
Definition: StationData.h:41
Definition: Config.cc:30