37 #include "InternalErr.h"
53 BESDEBUG(
"h5",
"Coming to HDFEOS5CFMissLLArray read "<<endl);
60 throw InternalErr (__FILE__, __LINE__,
"The projection is not supported.");
64 throw InternalErr (__FILE__, __LINE__,
65 "The number of dimension of this variable should be greater than 0");
75 throw InternalErr (__FILE__, __LINE__,
76 "The number of elments is negative.");
101 throw InternalErr (__FILE__, __LINE__,
102 "The number of elments should be greater than 0.");
104 float lat_step = (end - start) /ydimsize;
108 for (
int i = 0; i < nelms; i++)
109 val[i] = ((
float)(offset[0]+i*step[0] + 0.5f) * lat_step + start) / 1000000.0;
112 for (
int i = 0; i < nelms; i++)
113 val[i] = ((
float)(offset[0]+i * step[0])*lat_step + start) / 1000000.0;
133 throw InternalErr (__FILE__, __LINE__,
134 "The number of elments should be greater than 0.");
135 float lon_step = (end - start) /xdimsize;
138 for (
int i = 0; i < nelms; i++)
139 val[i] = ((
float)(offset[0] + i *step[0] + 0.5f) * lon_step + start ) / 1000000.0;
142 for (
int i = 0; i < nelms; i++)
143 val[i] = ((
float)(offset[0]+i*step[0]) * lon_step + start) / 1000000.0;
149 for (
int i =0; i <nelms; i++)
150 cerr <<
"final data val "<< i <<
" is " << val[i] <<endl;
153 set_value ((dods_float32 *) &val[0], nelms);
165 Dim_iter p = dim_begin ();
167 while (p != dim_end ()) {
169 int start = dimension_start (p,
true);
170 int stride = dimension_stride (p,
true);
171 int stop = dimension_stop (p,
true);
175 if (stride < 0 || start < 0 || stop < 0 || start > stop) {
178 oss <<
"Array/Grid hyperslab indices are bad: [" << start <<
179 ":" << stride <<
":" << stop <<
"]";
180 throw Error (malformed_expr, oss.str ());
184 if (start == 0 && stop == 0 && stride == 0) {
185 start = dimension_start (p,
false);
186 stride = dimension_stride (p,
false);
187 stop = dimension_stop (p,
false);
192 count[id] = ((stop - start) / stride) + 1;
196 "=format_constraint():"
197 <<
"id=" <<
id <<
" offset=" << offset[
id]
198 <<
" step=" << step[
id]
199 <<
" count=" << count[
id]
int format_constraint(int *cor, int *step, int *edg)
This class specifies the retrieval of the missing lat/lon values for HDF-EOS5 products.
HDFEOS5CFMissLLArray(int rank, const string &filename, const hid_t fileid, const string &varfullpath, CVType cvartype, float point_lower, float point_upper, float point_left, float point_right, EOS5GridPRType eos5_pixelreg, EOS5GridOriginType eos5_origin, EOS5GridPCType eos5_projcode, int xdimsize, int ydimsize, const string &n="", BaseType *v=0)
#define BESDEBUG(x, y)
macro used to send debug information to the debug stream
virtual BaseType * ptr_duplicate()