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_FILE2_H_
00025 #define FELT_FILE2_H_
00026
00027 #include <map>
00028 #include <vector>
00029 #include <string>
00030 #include <boost/shared_ptr.hpp>
00031 #include <boost/shared_array.hpp>
00032 #include "fimex/Data.h"
00033 #include "fimex/Felt_Types.h"
00034 #include "fimex/Felt_File_Error.h"
00035 #include "fimex/FeltParameters.h"
00036 #include "fimex/Logger.h"
00037 #include "felt/FeltTypes.h"
00038
00039 namespace MetNoFelt {
00040
00041 class Felt_Array2;
00042
00044
00049 class Felt_File2
00050 {
00051 public:
00053
00056 Felt_File2() {}
00061 explicit Felt_File2(const std::string& filename) throw(Felt_File_Error);
00068 explicit Felt_File2(const std::string& filename, const std::vector<std::string>& dianaParamList, const std::map<std::string, std::string>& options) throw(Felt_File_Error);
00069 virtual ~Felt_File2();
00070
00071
00073
00076 const boost::shared_ptr<Felt_Array2> getFeltArray(const std::string& compName) const throw(Felt_File_Error);
00078
00085 boost::shared_ptr<MetNoFimex::Data> getScaledDataSlice(boost::shared_ptr<Felt_Array2> feltArray, const boost::posix_time::ptime time, const LevelPair level) throw(Felt_File_Error);
00086
00090 std::vector<boost::shared_ptr<Felt_Array2> > listFeltArrays() const;
00091
00096
00101 std::map<short, std::vector<LevelPair> > getFeltLevelPairs() const;
00102 const std::map<LevelPair, int>& getHybridLevels() const {return hybridLevels_;}
00104 std::vector<boost::posix_time::ptime> getFeltTimes() const;
00106 int getNX() const;
00108 int getNY() const;
00110 boost::shared_ptr<MetNoFimex::Data> getXData() const throw(Felt_File_Error);
00112 boost::shared_ptr<MetNoFimex::Data> getYData() const throw(Felt_File_Error);
00113
00117 int getGridType() const throw(Felt_File_Error);
00119 boost::shared_ptr<felt::FeltGridDefinition> getGridDefinition() const throw(Felt_File_Error);
00120
00121 private:
00122 std::string filename_;
00123 boost::shared_ptr<felt::FeltFile> feltFile_;
00124 std::map<std::string, boost::shared_ptr<Felt_Array2> > feltArrayMap_;
00125 FeltParameters feltParameters;
00126 std::map<LevelPair, int> hybridLevels_;
00127 boost::array<float, 6> gridParameterDelta_;
00128
00129 bool findOrCreateFeltArray(const boost::shared_ptr<felt::FeltField>);
00131 void init(const std::map<std::string, std::string>& options) throw(Felt_File_Error);
00133 void setOptions(const std::map<std::string, std::string>& options);
00134
00135
00136 };
00137
00138
00139 }
00140 #endif