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 FELT_ARRAY2_H_
00025 #define FELT_ARRAY2_H_
00026 #include <string>
00027 #include <set>
00028 #include <vector>
00029 #include <map>
00030 #include <boost/array.hpp>
00031 #include <boost/date_time/posix_time/posix_time_types.hpp>
00032
00033 #include <fimex/Felt_Types.h>
00034 #include "fimex/Felt_File_Error.h"
00035
00036 #include "felt/FeltTypes.h"
00037
00038 namespace MetNoFelt {
00039 using namespace std;
00040
00041
00043
00047 class Felt_Array2
00048 {
00049 private:
00050
00051 typedef map<LevelPair, boost::shared_ptr<felt::FeltField>, LevelPairLess> LevelFieldMap;
00052
00053 typedef map<boost::posix_time::ptime, LevelFieldMap > TimeLevelFieldMap;
00054 string feltArrayName_;
00055 const boost::shared_ptr<felt::FeltField> defaultField_;
00056 string dataType_;
00057 double fillValue_;
00058 TimeLevelFieldMap feltFields_;
00060 Felt_Array2();
00061 void addField_(const boost::shared_ptr<felt::FeltField> field);
00062 public:
00070 explicit Felt_Array2(const string name, const boost::shared_ptr<felt::FeltField> feltField, const string& dataType, double fillValue);
00071 virtual ~Felt_Array2();
00076 void addInformationByField(boost::shared_ptr<felt::FeltField> field) throw(Felt_File_Error);
00077
00079
00080
00082 const string& getName() const;
00084 const string& getDatatype() const {return dataType_;}
00093 int getGrid(boost::posix_time::ptime time, LevelPair levelPair, vector<short>& gridOut) throw(Felt_File_Error);
00098 int getGridAllowDelta(boost::posix_time::ptime time, LevelPair levelPair, vector<short>& gridOut, const boost::array<float, 6>& gridParameterDelta) throw(Felt_File_Error);
00100 int getLevelType() const;
00102 double getFillValue() const {return fillValue_;}
00103
00105 vector<boost::posix_time::ptime> getTimes() const;
00109 vector<LevelPair> getLevelPairs() const;
00114 int getIdent19(boost::posix_time::ptime time, LevelPair levelPair) const throw(Felt_File_Error);
00115
00117 int getX() const;
00119 int getY() const;
00121 int scaleFactor() const;
00123 double getScalingFactor() const;
00124 boost::shared_ptr<felt::FeltGridDefinition> getGridDefinition() const;
00125 int getGridType() const;
00126 const boost::shared_ptr<felt::FeltField> getField(boost::posix_time::ptime time, LevelPair levelPair) const throw(Felt_File_Error);
00127 };
00128
00129 }
00130 #endif