# MI - Fimex: include/fimex/FeltCDMReader.h Source File

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

# include/fimex/FeltCDMReader.h

Go to the documentation of this file.

    00001 /*
    00002  * Fimex
    00003  *
    00004  * (C) Copyright 2008, met.no
    00005  *
    00006  * Project Info:  https://wiki.met.no/fimex/start
    00007  *
    00008  * This library is free software; you can redistribute it and/or modify it
    00009  * under the terms of the GNU Lesser General Public License as published by
    00010  * the Free Software Foundation; either version 2.1 of the License, or
    00011  * (at your option) any later version.
    00012  *
    00013  * This library is distributed in the hope that it will be useful, but
    00014  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    00015  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
    00016  * License for more details.
    00017  *
    00018  * You should have received a copy of the GNU Lesser General Public
    00019  * License along with this library; if not, write to the Free Software
    00020  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
    00021  * USA.
    00022  */
    00023
    00024 #ifndef FELTCDMREADER_H_
    00025 #define FELTCDMREADER_H_
    00026
    00027 #include <string>
    00028 #include <vector>
    00029 #include <map>
    00030 #include <boost/shared_ptr.hpp>
    00031 #include "fimex/Felt_File.h"
    00032 #include "fimex/CDMReader.h"
    00033 #include "fimex/CDMDimension.h"
    00034 #include "fimex/ReplaceStringObject.h"
    00035 #include "fimex/Utils.h"
    00036 #include "fimex/deprecated.h"
    00037
    00038 namespace MetNoFimex
    00039 {
    00040 class XMLDoc; // declaration without import
    00041
    00042 class FeltCDMReader : public CDMReader
    00043 {
    00044 public:
    00048         DEPRECATED(FeltCDMReader(std::string filename, std::string configFilename) throw(CDMException));
    00049         virtual ~FeltCDMReader();
    00050
    00051         virtual boost::shared_ptr<Data> getDataSlice(const std::string& varName, size_t unLimDimPos) throw(CDMException);
    00052
    00053 private:
    00054         const std::string filename;
    00055         const std::string configFilename;
    00056         MetNoFelt::Felt_File feltFile;
    00057         CDMDimension xDim;
    00058         CDMDimension yDim;
    00059         std::map<std::string, std::string> varNameFeltIdMap;
    00060         std::vector<epoch_seconds> timeVec;
    00061         std::map<std::string, std::vector<short> > levelVecMap;
    00069         std::map<std::string, boost::shared_ptr<ReplaceStringObject> > templateReplacementAttributes;
    00070         void init() throw(MetNoFelt::Felt_File_Error, CDMException);
    00071         // the following methods are parts of the init function and should not
    00072         // be called from elsewhere
    00073         std::vector<std::string> initGetKnownFeltIdsFromXML(const XMLDoc& doc);
    00074         void initAddGlobalAttributesFromXML(const XMLDoc& doc);
    00078         std::map<std::string, std::string> initGetOptionsFromXML(const XMLDoc& doc);
    00079         CDMDimension initAddTimeDimensionFromXML(const XMLDoc& doc);
    00080         std::map<short, CDMDimension> initAddLevelDimensionsFromXML(const XMLDoc& doc);
    00088         void readAdditionalAxisVariablesFromXPath(const XMLDoc& doc, const std::string& xpathLevelString, const std::map<std::string, boost::shared_ptr<ReplaceStringObject> >& templateReplacements) throw(MetNoFelt::Felt_File_Error);
    00089         std::vector<double> readValuesFromXPath(const XMLDoc& doc, const std::string& variableXPath);
    00090         void initAddProjectionFromXML(const XMLDoc& doc, std::string& projName, std::string& coordinates);
    00091         void initAddVariablesFromXML(const XMLDoc& doc, const std::string& projName, const std::string& coordinates, const CDMDimension& timeDim, const std::map<short, CDMDimension>& levelDims);
    00092
    00093
    00094 };
    00095
    00096 }
    00097
    00098 #endif /*FELTCDMREADER_H_*/