MI - Fimex
CDMQualityExtractor.h
Go to the documentation of this file.
1 /*
2  * Fimex, CDMQualityExtractor.h
3  *
4  * (C) Copyright 2009, met.no
5  *
6  * Project Info: https://wiki.met.no/fimex/start
7  *
8  * This library is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation; either version 2.1 of the License, or
11  * (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16  * License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
21  * USA.
22  *
23  * Created on: May 25, 2009
24  * Author: Heiko Klein
25  */
26 
27 #ifndef CDMQUALITYEXTRACTOR_H_
28 #define CDMQUALITYEXTRACTOR_H_
29 
30 #include "CDMReader.h"
31 #include <vector>
32 #include <map>
33 
34 namespace MetNoFimex
35 {
36 
58 {
59 public:
68  CDMQualityExtractor(boost::shared_ptr<CDMReader> dataReader, std::string autoConfString="", std::string configFile="");
69  virtual ~CDMQualityExtractor() {};
74  virtual DataPtr getDataSlice(const std::string& varName, size_t unLimDimPos = 0);
78  const std::map<std::string, std::string>& getStatusVariable() const {return statusVariable;}
82  const std::map<std::string, std::string>& getVariableFlags() const {return variableFlags;}
86  const std::map<std::string, std::vector<double> >& getVariableValues() const {return variableValues;}
87 private:
88  const boost::shared_ptr<CDMReader> dataReader;
89  /* map of variableName to the variable which contains the flags */
91  /*
92  * map of the variableName to the flags, which should be valid in the statusVariable, i.e. highest,lowest,all.
93  * statusVariable needs to be set!
94  */
96  /*
97  * fillValue for each variable (default = _FillValue, or set per variable in config)
98  */
99  std::map<std::string, double> variableFill;
100  /*
101  * map of the variableName to the valid values in the statusVariable.
102  * statusVariable needs to be set!
103  */
105  /*
106  * map of the variableName to the reader used for getting values of the statusVariable.
107  */
109 };
110 
111 }
112 
113 #endif /* CDMQUALITYEXTRACTOR_H_ */
basic_string< char > string
boost::shared_ptr< Data > DataPtr
Definition: DataDecl.h:39
const std::map< std::string, std::string > & getVariableFlags() const
Definition: CDMQualityExtractor.h:82
Extract data with defined quality status.
Definition: CDMQualityExtractor.h:57
virtual DataPtr getDataSlice(const std::string &varName, size_t unLimDimPos)=0
data-reading function to be called from the CDMWriter
virtual DataPtr getDataSlice(const std::string &varName, size_t unLimDimPos=0)
const std::map< std::string, std::vector< double > > & getVariableValues() const
Definition: CDMQualityExtractor.h:86
Definition: C_CDMReader.h:35
Basic interface for CDM reading and manipulation classes.
Definition: CDMReader.h:53
CDMQualityExtractor(boost::shared_ptr< CDMReader > dataReader, std::string autoConfString="", std::string configFile="")
virtual ~CDMQualityExtractor()
Definition: CDMQualityExtractor.h:69
const std::map< std::string, std::string > & getStatusVariable() const
Definition: CDMQualityExtractor.h:78