00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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
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 }
00077
00078 #endif