MISR Toolkit  1.5.1
Functions
MtkFileBlockMetaFieldRead.c File Reference
#include "MisrFileQuery.h"
#include "MisrUtil.h"
#include "MisrError.h"
#include <hdf.h>

Go to the source code of this file.

Functions

MTKt_status MtkFileBlockMetaFieldRead (const char *filename, const char *blockmetaname, const char *fieldname, MTKt_DataBuffer *blockmetabuf)
 Read a block metadata field. More...
 
MTKt_status MtkFileBlockMetaFieldReadFid (int32 file_id, const char *blockmetaname, const char *fieldname, MTKt_DataBuffer *blockmetabuf)
 Version of MtkFileBlockMetaFileRead that takes an HDF file identifier rather than a filename. More...
 

Function Documentation

◆ MtkFileBlockMetaFieldRead()

MTKt_status MtkFileBlockMetaFieldRead ( const char *  filename,
const char *  blockmetaname,
const char *  fieldname,
MTKt_DataBuffer blockmetabuf 
)

Read a block metadata field.

Returns
MTK_SUCCESS if successful.
Example:
In this example, we read the field lock_coor_ulc_som_meter.x from the PerBlockMetadataCommon block metadata structure in the file MISR_AM1_GRP_TERRAIN_GM_P161_O012115_DF_F03_0021.hdf
status = MtkFileBlockMetaFieldRead("MISR_AM1_GRP_TERRAIN_GM_P161_O012115_DF_F03_0021.hdf", "PerBlockMetadataCommon", "lock_coor_ulc_som_meter.x", &blockmetabuf);
Note
The caller is responsible for using MtkDataBufferFree() to free the memory used by blockmetabuf
When reading the transform.ref_time field in the PerBlockMetadataRad structure the two strings are concatenated, and there is no terminating NULL.
Parameters
[in]filenameFilename
[in]blockmetanameBlock metadata structure name
[in]fieldnameField name
[out]blockmetabufBlock metadata values

Definition at line 40 of file MtkFileBlockMetaFieldRead.c.

◆ MtkFileBlockMetaFieldReadFid()

MTKt_status MtkFileBlockMetaFieldReadFid ( int32  file_id,
const char *  blockmetaname,
const char *  fieldname,
MTKt_DataBuffer blockmetabuf 
)

Version of MtkFileBlockMetaFileRead that takes an HDF file identifier rather than a filename.

Returns
MTK_SUCCESS if successful.
Parameters
[in]file_idHDF file identifier
[in]blockmetanameBlock metadata structure name
[in]fieldnameField name
[out]blockmetabufBlock metadata values

Definition at line 84 of file MtkFileBlockMetaFieldRead.c.


MISR Toolkit - Copyright © 2005 - 2020 Jet Propulsion Laboratory
Generated on Fri Jun 19 2020 22:49:53