00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef MERISFILEDATA_H
00013 #define MERISFILEDATA_H
00014
00015 #include <string.h>
00016 #include <vector>
00017 #include <map>
00018 #include "filedatareader.h"
00019 #include "Hdf_sds.hpp"
00020 #include "epr_api.h"
00021
00022 using namespace std;
00023
00027 class MerisFileData : public FileDataReader{
00028 public:
00029 MerisFileData(const string &name = string(""), const string &mode = string("r"));
00030
00031 virtual ~MerisFileData();
00032
00033 virtual void * read_data(void* data,
00034 const char* sds_name,
00035 int * start=NULL,
00036 int * stride=NULL,
00037 int *edges=NULL,
00038 int rank=-1);
00039
00040 vector<int> get_dataset_dimension(const string &sds_name);
00041
00042 void get_dataset_fill_value(const string &sds_name, void* fill_value);
00043
00044 int get_n_dataset();
00045
00046 string get_dataset_name(int i);
00047
00048 int get_dataset_data_type(string sds_name);
00049
00050 string get_values_attr_dataset(string sds_name,string attr_name);
00051
00052 bool has_attr_dataset(string sds_name,string attr_name);
00053
00054 string get_values_attr(string attr_name);
00055
00056 bool has_attr(string attr_name);
00057
00058 string get_filename(){return this->filename;};
00059
00060 string get_product(){return "meris";};
00061
00065 void close_data_file();
00066
00070 void open_data_file();
00071
00072 void get_fillValue(const string &sds_name, void *fillValue);
00073
00074 void get_scaling_type_of_raw(const string &sds_name, float64 &scale, float64 &offset, int &type);
00075
00076 protected:
00077
00078 EPR_SProductId* product_id;
00079
00080 string filename;
00081
00082 string getMonth(const string &month);
00083
00084 int width;
00085 int height;
00086
00087 void getFillValues(char8 &fillvalue);
00088 void getFillValues(uchar8 &fillvalue);
00089 void getFillValues(int16 &fillvalue);
00090 void getFillValues(uint16 &fillvalue);
00091 void getFillValues(int32 &fillvalue);
00092 void getFillValues(uint32 &fillvalue);
00093 void getFillValues(float32 &fillvalue);
00094 void getFillValues(float64 &fillvalue);
00095
00096 string epr_get_field_elem_as_str(const EPR_SField* field);
00097
00098 void get_scaling(const string &sds_name, float64 &scale, float64 &offset);
00099 };
00100 #endif