11 #ifdef USE_HDFEOS2_LIB
12 #ifndef HDFEOS2ARRAYSWATHDIMMAPFIELD_H
13 #define HDFEOS2ARRAYSWATHDIMMAPFIELD_H
18 #include "HDFCFUtil.h"
19 #include "HdfEosDef.h"
21 #include "HDFEOS2EnumType.h"
23 class HDFEOS2ArraySwathDimMapField:
public Array
26 HDFEOS2ArraySwathDimMapField (
int rank,
const std::string & filename,
bool isgeofile,
const int sdfd,
const int swathfd,
const std::string & gridname,
const std::string & swathname,
const std::string & fieldname,
const std::vector < struct dimmap_entry >&dimmaps, SOType sotype,
const string & n =
"", BaseType * v = 0):
34 swathname (swathname),
35 fieldname (fieldname),
39 virtual ~ HDFEOS2ArraySwathDimMapField ()
44 int format_constraint (
int *cor,
int *step,
int *edg);
48 template <
class T >
int GetFieldValue (int32,
const std::string &,std::vector < struct dimmap_entry >&, std::vector < T > &, std::vector<int32>&);
51 template <
class T >
int _expand_dimmap_field (std::vector < T > *pvals, int32 rank, int32 dimsa[],
int dimindex, int32 ddimsize, int32 offset, int32 inc);
54 template <
class T >
bool FieldSubset (T * outlatlon, std::vector<int32>&newdims, T * latlon, int32 * offset, int32 * count, int32 * step);
56 template <
class T >
bool Field1DSubset (T * outlatlon,
int majordim, T * latlon, int32 * offset, int32 * count, int32 * step);
59 template <
class T >
bool Field2DSubset (T * outlatlon,
int majordim,
int minordim, T * latlon, int32 * offset, int32 * count, int32 * step);
61 template <
class T >
bool Field3DSubset (T * outlatlon, std::vector<int32>& newdims, T * latlon, int32 * offset, int32 * count, int32 * step);
64 BaseType *ptr_duplicate ()
66 return new HDFEOS2ArraySwathDimMapField (*
this);
90 std::string swathname;
93 std::string fieldname;
96 std::vector < struct dimmap_entry >dimmaps;
103 int write_dap_data_scale_comp(int32 swid,
const int nelms, std::vector<int32> &offset32, std::vector<int32> &count32, std::vector<int32> &step32);
104 int write_dap_data_disable_scale_comp(int32 swid,
const int nelms, std::vector<int32> &offset32,std::vector<int32> &count32,std::vector<int32> &step32);
106 template <
class T >
int GetFieldValue (int32,
const std::string &,std::vector < struct dimmap_entry >&, std::vector < T > &, std::vector<int32>&);
109 template <
class T >
int _expand_dimmap_field (std::vector < T > *pvals, int32 rank, int32 dimsa[],
int dimindex, int32 ddimsize, int32 offset, int32 inc);
112 template <
class T >
bool FieldSubset (T * outlatlon,
const std::vector<int32>&newdims, T * latlon, int32 * offset, int32 * count, int32 * step);
114 template <
class T >
bool Field1DSubset (T * outlatlon,
const int majordim, T * latlon, int32 * offset, int32 * count, int32 * step);
117 template <
class T >
bool Field2DSubset (T * outlatlon,
const int majordim,
const int minordim, T * latlon, int32 * offset, int32 * count, int32 * step);
119 template <
class T >
bool Field3DSubset (T * outlatlon,
const std::vector<int32>& newdims, T * latlon, int32 * offset, int32 * count, int32 * step);
126 bool check_num_elems_constraint(
const int num_elems,
const std::vector<int32>&newdims);