30 #pragma warning(disable:4512)
44 SMETIO(
const std::string& configfile);
50 std::vector< std::vector<MeteoData> >& vecMeteo);
52 virtual void writeMeteoData(
const std::vector< std::vector<MeteoData> >& vecMeteo,
53 const std::string& name=
"");
55 virtual void readPOI(std::vector<Coords>& pts);
59 typedef struct PLOT_ATTR {
60 PLOT_ATTR() : units(), description(), color(), min(IOUtils::
nodata), max(IOUtils::
nodata) {}
61 PLOT_ATTR(
const std::string& i_units,
const std::string& i_description,
const std::string& i_color) : units(i_units), description(i_description), color(i_color), min(IOUtils::
nodata), max(IOUtils::
nodata) {}
62 PLOT_ATTR(
const std::string& i_units,
const std::string& i_description,
const std::string& i_color,
const double& i_min,
const double& i_max) : units(i_units), description(i_description), color(i_color), min(i_min), max(i_max) {}
63 PLOT_ATTR(
const size_t& parindex,
const std::string& i_color,
const double& i_min,
const double& i_max) : units(MeteoGrids::
getParameterUnits(parindex)), description(MeteoGrids::
getParameterDescription(parindex, false)), color(i_color), min(i_min), max(i_max) {}
66 std::string description;
72 typedef enum VERSIONING_TYPE {
80 static std::map<std::string, plot_attr> initPlotParams();
81 static double getSnowpackSlope(
const std::string&
id);
83 void identify_fields(
const std::vector<std::string>& fields, std::vector<size_t>& indexes,
84 bool& julian_present, MeteoData& md);
85 void populateMeteo(
const smet::SMETReader& myreader,
const std::vector<std::string>& timestamps,
86 const std::vector<double>& mydata, std::vector<MeteoData>& vecMeteo);
88 void parseInputOutputSection();
89 bool checkConsistency(
const std::vector<MeteoData>& vecMeteo, StationData& sd);
90 size_t getNrOfParameters(
const std::string& stationname,
const std::vector<MeteoData>& vecMeteo);
91 bool getPlotProperties(std::string param, std::ostringstream &plot_units, std::ostringstream &plot_description, std::ostringstream &plot_color, std::ostringstream &plot_min, std::ostringstream &plot_max)
const;
92 void getFormatting(
const std::string& parname,
int& prec,
int& width)
const;
93 std::string buildVersionString(
const std::vector< std::vector<MeteoData> >& vecMeteo,
const double& smet_timezone)
const;
94 double olwr_to_tss(
const double& olwr);
95 void generateHeaderInfo(
const StationData& sd,
const bool& i_outputIsAscii,
const bool& isConsistent,
96 const double& smet_timezone,
const std::set<std::string>& paramInUse,
smet::SMETWriter& mywriter);
98 static const char* dflt_extension;
99 static const double snVirtualSlopeAngle;
102 std::map<std::string, plot_attr> plot_ppt;
103 std::string coordin, coordinparam, coordout, coordoutparam;
104 std::vector<smet::SMETReader> vec_smet_reader;
105 std::vector<std::string> vecFiles;
108 double plugin_nodata;
109 int default_prec, default_width;
110 char output_separator;
111 VersioningType outputVersioning;
112 bool outputCommentedHeaders;
113 bool outputIsAscii, outputPlotHeaders, randomColors, allowAppend, allowOverwrite, snowpack_slopes;
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
A class representing the IO Layer of the software Alpine3D. For each type of IO (File,...
Definition: IOInterface.h:98
Reads meteo data in the SMET ASCII or binary format.
Definition: SMETIO.h:42
SMETIO(const std::string &configfile)
Definition: SMETIO.cc:117
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: SMETIO.cc:507
virtual void writeMeteoData(const std::vector< std::vector< MeteoData > > &vecMeteo, const std::string &name="")
Write vecMeteo time series to a certain destination.
Definition: SMETIO.cc:574
virtual void readStationData(const Date &date, std::vector< StationData > &vecStation)
Fill vecStation with StationData objects for a certain date of interest.
Definition: SMETIO.cc:264
virtual void readPOI(std::vector< Coords > &pts)
Read a list of points by their grid coordinates This allows for example to get a list of points where...
Definition: SMETIO.cc:905
The SMETReader class enables to read a SMET formatted file. Data and header info can be extracted thr...
Definition: libsmet.h:221
The SMETWriter class that enables to write a SMET formatted file. The user constructs a SMETWriter cl...
Definition: libsmet.h:99
const double nodata
This is the internal nodata value.
Definition: IOUtils.h:75
std::string getParameterDescription(const size_t ¶m)
Definition: libncpp.cc:649
std::string getParameterUnits(const size_t ¶m)
Definition: libncpp.cc:655