#include "MisrFileQuery.h"
#include "MisrUtil.h"
#include "MisrError.h"
#include <mfhdf.h>
#include <HdfEosDef.h>
Go to the source code of this file.
|
MTKt_status | MtkFieldAttrGet (const char *filename, const char *fieldname, const char *attrname, MTKt_DataBuffer *attrbuf) |
| Get a file attribute. More...
|
|
MTKt_status | MtkFieldAttrGetNC (const char *filename, const char *fieldname, const char *attrname, MTKt_DataBuffer *attrbuf) |
|
MTKt_status | MtkFieldAttrGetHDF (const char *filename, 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. More...
|
|
MTKt_status | MtkFieldAttrGetNcid (int ncid, const char *fieldname, const char *attrname, MTKt_DataBuffer *attrbuf) |
|
◆ MtkFieldAttrGet()
Get a file attribute.
- Returns
- MTK_SUCCESS if successful.
- Example:
- In this example, we get the
_FillValue
attribute from the CloudMotionCrossTrack field in the file MISR_AM1_GRP_TERRAIN_GM_P161_O012115_DF_F03_0021.hdf
status =
MtkFieldAttrGet(
"MISR_AM1_TC_CLOUD_P110_O074017_F01_0001.hdf",
"CloudMotionCrossTrack",
"_FillValue", &attrbuf);
- Note
- The caller is responsible for using MtkDataBufferFree() to free the memory used by
attrbuf
- Parameters
-
[in] | filename | File name |
[in] | fieldname | Field name |
[in] | attrname | Attribute name |
[out] | attrbuf | Attribute value |
Definition at line 38 of file MtkFieldAttrGet.c.
◆ MtkFieldAttrGetFid()
Version of MtkFieldAttrGet that takes an HDF SD file identifier rather than a filename.
- Returns
- MTK_SUCCESS if successful.
- Parameters
-
[in] | fid | HDF-EOS File ID |
[in] | fieldname | Field name |
[in] | attrname | Attribute name |
[out] | attrbuf | Attribute value |
Definition at line 123 of file MtkFieldAttrGet.c.
◆ MtkFieldAttrGetHDF()
- Parameters
-
[in] | filename | File name |
[in] | fieldname | Field name |
[in] | attrname | Attribute name |
[out] | attrbuf | Attribute value |
Definition at line 88 of file MtkFieldAttrGet.c.
◆ MtkFieldAttrGetNC()
- Parameters
-
[in] | filename | File name |
[in] | fieldname | Field name |
[in] | attrname | Attribute name |
[out] | attrbuf | Attribute value |
Definition at line 52 of file MtkFieldAttrGet.c.
◆ MtkFieldAttrGetNcid()
- Parameters
-
[in] | ncid | netCDF File ID |
[in] | fieldname | Field name |
[in] | attrname | Attribute name |
[out] | attrbuf | Attribute value |
Definition at line 188 of file MtkFieldAttrGet.c.