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;
00110 boost::shared_ptr<boost::posix_time::ptime> getUniqueReferenceTime() const;
00112 int getNX() const;
00114 int getNY() const;
00116 boost::shared_ptr<MetNoFimex::Data> getXData() const throw(Felt_File_Error);
00118 boost::shared_ptr<MetNoFimex::Data> getYData() const throw(Felt_File_Error);
00119
00123 int getGridType() const throw(Felt_File_Error);
00125 boost::shared_ptr<felt::FeltGridDefinition> getGridDefinition() const throw(Felt_File_Error);
00126
00127 private:
00128 std::string filename_;
00129 boost::shared_ptr<felt::FeltFile> feltFile_;
00130 std::map<std::string, boost::shared_ptr<Felt_Array2> > feltArrayMap_;
00131 FeltParameters feltParameters;
00132 std::map<LevelPair, int> hybridLevels_;
00133 boost::array<float, 6> gridParameterDelta_;
00134
00135 bool findOrCreateFeltArray(const boost::shared_ptr<felt::FeltField>);
00137 void init(const std::map<std::string, std::string>& options) throw(Felt_File_Error);
00139 void setOptions(const std::map<std::string, std::string>& options);
00140
00141
00142 };
00143
00144
00145 }
00146 #endif