66 #define chk(x) checkHDFerr(x,__FILE__,__LINE__)
69 fprintf(stderr,
"HDF I/O Error in (%s:%d)\n",
80 int32 sd_id = SDstart(filename, DFACC_READ);
81 if (sd_id==-1)
return "Couldn't open HDF input file!";
85 for (i=0;i<3;i++) sds_id[i]=
chk(SDselect(sd_id,5+4*i));
99 int32
rank, size[3], data_type, n_attrs;
100 chk(SDgetinfo(sds_id[0], name, &rank, size, &data_type, &n_attrs));
110 double *
coord=
new double[nLocs];
113 int32 start[3]={0,0,0};
115 for (d=0;d<3;d++) edges[d]=dim[2-d];
116 chk(SDreaddata(sds_id[i], start, NULL, edges, coord));
118 for (
int l=0;l<nLocs;l++) locs[l][i]=coord[l];
127 for (i=0;i<3;i++)
chk(SDendaccess(sds_id[i]));
int coord[NPANE][NROW *NCOL][3]
const char * read_hdf(const char *hdfName, blockConsumer &dest)
void int int int REAL REAL REAL const char * fName
virtual vector3d * allocateBlock(blockDim &dim)
virtual void freeBlock(vector3d *blk)
virtual const char * consume(const blockDim &dim, vector3d *locs)=0
static int checkHDFerr(int errCode, const char *fName, int lineNo)