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

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

# include/fimex/FeltParameters.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 FELTPARAMETERS_H_
    00025 #define FELTPARAMETERS_H_
    00026
    00027 #include <map>
    00028 #include <string>
    00029 #include <vector>
    00030 #include <boost/array.hpp>
    00031 #include "fimex/Felt_File_Error.h"
    00032
    00033 namespace MetNoFelt {
    00034
    00035 class FeltParameters
    00036 {
    00037         std::map<std::string, boost::array<short,16> > parameterMap;
    00038         std::map<std::string, std::string> parameterDatatypeMap;
    00039         std::map<std::string, double> parameterFillValueMap;
    00040
    00041 public:
    00042         FeltParameters();
    00049         explicit FeltParameters(std::string filename);
    00053         explicit FeltParameters(const std::vector<std::string>& feltParams);
    00054         virtual ~FeltParameters();
    00055         const boost::array<short, 16>& getParameters(const std::string&);
    00056         const std::string& getParameterName(const boost::array<short, 16>&);
    00057         std::string getParameterDatatype(const std::string& parameterName) const;
    00058         double getParameterFillValue(const std::string& parameterName) const;
    00059         // local static objects
    00060         const static std::string& DEFAULT_CONFIG() {
    00061                 const static std::string DEFAULT_CONFIG("/metno/local/diana/etc/diana.setup-COMMON");
    00062                 return DEFAULT_CONFIG;
    00063         }
    00064 private:
    00065         void init(std::string filename=DEFAULT_CONFIG());
    00066         boost::array<short, 16> diana2feltparameters(const std::string&);
    00067 };
    00068
    00069 std::string getProjString(int gridType, const boost::array<float, 6>& gridParameters) throw(Felt_File_Error);
    00070
    00071 inline const int ANY_VALUE() { return -32767;}
    00072 const std::string& UNDEFINED();
    00073 const boost::array<short, 16>& ANY_ARRAY();
    00074 const boost::array<short, 20>& ANY_ARRAY20();
    00075
    00076 } // end namespace MetNoFelt
    00077
    00078 #endif /*FELTPARAMETERS_H_*/