22 #include <HdfEosDef.h> 45 const char *fieldname )
58 const char *fieldname )
93 const char *fieldname )
100 if (filename == NULL)
105 if (hdfstatus ==
FAIL)
114 if (hdfstatus ==
FAIL)
133 const char *gridname,
134 const char *fieldname )
139 char **fieldlist = NULL;
141 char *basefield = NULL;
143 int *extradims = NULL;
144 char **dimlist = NULL;
148 if (gridname == NULL || fieldname == NULL)
168 for (i = 0; i < nfields; i++) {
169 if (strncmp(basefield, fieldlist[i], strlen(fieldlist[i])) == 0)
183 &dimcnt, &dimlist, &dimsize);
186 if (nextradims < dimcnt) {
190 }
else if (nextradims > dimcnt) {
195 for (i = 0; i < nextradims; i++) {
196 if ( extradims[i] < 0 || extradims[i] >= dimsize[i] ) {
210 if (basefield != NULL) free(basefield);
211 if (extradims != NULL) free(extradims);
213 if (dimsize != NULL) free(dimsize);
219 const char *gridname,
220 const char *fieldname )
225 char **fieldlist = NULL;
227 char *basefield = NULL;
229 int *extradims = NULL;
230 char **dimlist = NULL;
234 if (gridname == NULL || fieldname == NULL)
245 for (i = 0; i < nfields; i++) {
246 if (strncmp(basefield, fieldlist[i], strlen(fieldlist[i])) == 0)
255 &dimcnt, &dimlist, &dimsize);
258 if (nextradims < dimcnt) {
262 }
else if (nextradims > dimcnt) {
267 for (i = 0; i < nextradims; i++) {
268 if ( extradims[i] < 0 || extradims[i] >= dimsize[i] ) {
282 if (basefield != NULL) free(basefield);
283 if (extradims != NULL) free(extradims);
285 if (dimsize != NULL) free(dimsize);
MTKt_status MtkStringListFree(int strcnt, char **strlist[])
Free string list.
MTKt_status MtkFileGridFieldCheckNC(const char *filename, const char *gridname, const char *fieldname)
MTKt_status MtkFileGridFieldCheckFid(int32 Fid, const char *gridname, const char *fieldname)
Version of MtkFileGridFieldCheck that takes an HDF-EOS file identifier rather than a filename...
MTKt_status MtkFileGridFieldCheckHDF(const char *filename, const char *gridname, const char *fieldname)
MTKt_status MtkFileGridFieldToDimListFid(int32 Fid, const char *gridname, const char *fieldname, int *dimcnt, char **dimlist[], int **dimsize)
Version of MtkFileGridFieldToDimList that takes an HDF-EOS file ID rather than a filename.
MTKt_status MtkParseFieldname(const char *fieldname, char **basefieldname, int *ndim, int **dimlist)
Parses extra dimensions from fieldnames.
HDFFCLIBAPI intf * dimsize
#define MTK_ERR_CODE_JUMP(code)
MTKt_status MtkFileGridFieldCheckNcid(int ncid, const char *gridname, const char *fieldname)
MTKt_status MtkFileGridFieldCheck(const char *filename, const char *gridname, const char *fieldname)
Check if file/grid/field/dimension are valid.
MTKt_status MtkFileGridToFieldListNcid(int ncid, const char *gridname, int *nfields, char **fieldlist[])
MTKt_status MtkFileGridToFieldListFid(int32 Fid, const char *gridname, int *nfields, char **fieldlist[])
Version of MtkFileGridToFieldList that takes an HDF-EOS file identifier rather than a filename...
#define MTK_ERR_COND_JUMP(code)
int32 GDopen(char *, intn)
EXTERNL int nc_close(int ncid)
EXTERNL int nc_open(const char *path, int mode, int *ncidp)
MTKt_status MtkFileGridFieldToDimListNcid(int ncid, const char *gridname, const char *fieldname, int *dimcnt, char **dimlist[], int **dimsize)