15#include "HDFSPArrayMissField.h"
19#include <libdap/debug.h>
22#include <libdap/InternalErr.h>
30HDFSPArrayMissGeoField::read ()
33 BESDEBUG(
"h4",
"Coming to HDFSPArrayMissGeoField read "<<endl);
46 int nelms = format_constraint(offset.data(),step.data(),count.data());
54 if (nelms == tnumelm) {
55 for (
int i = 0; i < nelms; i++)
57 set_value ((dods_int32 *) val.data(), nelms);
61 throw InternalErr (__FILE__, __LINE__,
62 "Currently the rank of the missing field should be 1");
64 for (
int i = 0; i < count[0]; i++)
65 val[i] = offset[0] + step[0] * i;
66 set_value ((dods_int32 *) val.data(), nelms);
75HDFSPArrayMissGeoField::format_constraint (
int *offset,
int *step,
int *count)
81 Dim_iter p = dim_begin ();
82 while (p != dim_end ()) {
84 int start = dimension_start (p,
true);
85 int stride = dimension_stride (p,
true);
86 int stop = dimension_stop (p,
true);
91 oss <<
"Array/Grid hyperslab start point "<< start <<
92 " is greater than stop point " << stop <<
".";
93 throw Error(malformed_expr, oss.str());
98 count[id] = ((stop - start) / stride) + 1;
102 "=format_constraint():"
103 <<
"id=" <<
id <<
" offset=" << offset[
id]
104 <<
" step=" << step[
id]
105 <<
" count=" << count[
id]