MI - Fimex
CDMTimeInterpolator.h
Go to the documentation of this file.
1 /*
2  * Fimex, CDMTimeInterpolator.h
3  *
4  * (C) Copyright 2008, 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: Dec 3, 2008
24  * Author: heikok
25  */
26 
27 #ifndef CDMTIMEINTERPOLATOR_H_
28 #define CDMTIMEINTERPOLATOR_H_
29 
30 
31 #include "CDMReader.h"
32 #include <map>
33 #include <vector>
35 
36 namespace MetNoFimex
37 {
38 
43 {
44 public:
45  CDMTimeInterpolator(boost::shared_ptr<CDMReader> dataReader);
46  virtual ~CDMTimeInterpolator();
54  virtual DataPtr getDataSlice(const std::string& varName, size_t unLimDimPos = 0);
61  virtual void changeTimeAxis(std::string timeSpec);
62 
63 private:
64  boost::shared_ptr<CDMReader> dataReader_;
65  // map each new time-position to the closest time-positions in the old times
67  TimeChangeMap timeChangeMap_;
69  // store the datareaders times as doubles of the new units
70  std::map<std::string, std::vector<double> > dataReaderTimesInNewUnits_;
71 };
72 
73 } /* MetNoFimex */
74 
75 
76 #endif /* CDMTIMEINTERPOLATOR_H_ */
basic_string< char > string
boost::shared_ptr< Data > DataPtr
Definition: DataDecl.h:39
virtual DataPtr getDataSlice(const std::string &varName, size_t unLimDimPos=0)
retrieve data from the underlying dataReader and interpolate the values due to the current projection...
STL class.
STL class.
virtual DataPtr getDataSlice(const std::string &varName, size_t unLimDimPos)=0
data-reading function to be called from the CDMWriter
CDMTimeInterpolator(boost::shared_ptr< CDMReader > dataReader)
Definition: CDMTimeInterpolator.h:42
Definition: C_CDMReader.h:35
Basic interface for CDM reading and manipulation classes.
Definition: CDMReader.h:53
virtual void changeTimeAxis(std::string timeSpec)