21 #include <HdfEosDef.h> 40 const char *fieldname,
54 const char *fieldname,
90 const char *fieldname,
125 const char *fieldname,
137 char attr_name_tmp[
MAXSTR];
139 int32 sdInterfaceID =
FAIL;
143 if (fieldname == NULL || attrname == NULL || attrbuf == NULL)
147 EHidinfo(fid, &HDFfid, &sdInterfaceID);
150 sd_id =
SDselect(sdInterfaceID,sds_index);
153 hdf_status = attr_index =
SDfindattr(sd_id, attrname);
154 if (hdf_status ==
FAIL)
158 hdf_status =
SDattrinfo(sd_id, attr_index, attr_name_tmp, &hdf_datatype, &count);
159 if (hdf_status ==
FAIL)
174 if (hdf_status ==
FAIL)
177 *attrbuf = attrbuf_tmp;
190 const char *fieldname,
200 if (fieldname == NULL || attrname == NULL || attrbuf == NULL)
209 int nc_status =
nc_inq_grps(ncid, &number_group, NULL);
212 gids = (
int *)calloc(number_group,
sizeof(
int));
215 nc_status =
nc_inq_grps(ncid, &number_group, gids);
218 for (
int i = 0 ; i < number_group ; i++) {
252 *attrbuf = attrbuf_tmp;
HDFLIBAPI int32 SDnametoindex(int32 fid, const char *name)
HDFFCLIBAPI intf intf intf * count
MTKt_status MtkFieldAttrGet(const char *filename, const char *fieldname, const char *attrname, MTKt_DataBuffer *attrbuf)
Get a file attribute.
MTKt_status MtkNcToMtkDataTypeConvert(nc_type nc_datatype, MTKt_DataType *datatype)
EXTERNL int nc_inq_atttype(int ncid, int varid, const char *name, nc_type *xtypep)
MTKt_status MtkDataBufferAllocate(int nline, int nsample, MTKt_DataType datatype, MTKt_DataBuffer *databuf)
Allocate Data Buffer.
HDFFCLIBAPI _fcd _fcd intf intf * datatype
EXTERNL int nc_get_att(int ncid, int varid, const char *name, void *ip)
#define MTK_ERR_CODE_JUMP(code)
2-dimensional Data Buffer
HDFFCLIBAPI intf intf _fcd attrname
MTKt_status MtkHdfToMtkDataTypeConvert(int32 hdf_datatype, MTKt_DataType *datatype)
Convert HDF data type to MISR Toolkit data type.
MTKt_status MtkFieldAttrGetNcid(int ncid, const char *fieldname, const char *attrname, MTKt_DataBuffer *attrbuf)
MTKt_status MtkFieldAttrGetFid(int32 fid, const char *fieldname, const char *attrname, MTKt_DataBuffer *attrbuf)
Version of MtkFieldAttrGet that takes an HDF SD file identifier rather than a filename.
HDFLIBAPI intn SDreadattr(int32 id, int32 idx, void *buf)
#define MTKT_DATABUFFER_INIT
MTKt_status MtkDataBufferFree(MTKt_DataBuffer *databuf)
Free data buffer.
MTKt_status MtkFieldAttrGetNC(const char *filename, const char *fieldname, const char *attrname, MTKt_DataBuffer *attrbuf)
EXTERNL int nc_inq_grps(int ncid, int *numgrps, int *ncids)
HDFLIBAPI int32 SDselect(int32 fid, int32 idx)
HDFLIBAPI int32 SDfindattr(int32 id, const char *attrname)
intn EHidinfo(int32, int32 *, int32 *)
HDFLIBAPI intn SDattrinfo(int32 id, int32 idx, char *name, int32 *nt, int32 *count)
#define MTK_ERR_COND_JUMP(code)
int32 GDopen(char *, intn)
EXTERNL int nc_close(int ncid)
MTKt_status MtkNCVarId(int Ncid, const char *Name, MTKt_ncvarid *Var)
MTKt_status MtkFieldAttrGetHDF(const char *filename, const char *fieldname, const char *attrname, MTKt_DataBuffer *attrbuf)
EXTERNL int nc_open(const char *path, int mode, int *ncidp)