MISR Toolkit  1.5.1
Functions
MtkReadBlockRange.c File Reference
#include "MisrReadData.h"
#include "MisrUtil.h"
#include "MisrError.h"
#include <stdlib.h>
#include <mfhdf.h>
#include <HdfEosDef.h>

Go to the source code of this file.

Functions

MTKt_status MtkReadBlockRange (const char *filename, const char *gridname, const char *fieldname, int startblock, int endblock, MTKt_DataBuffer3D *databuf)
 Read range of blocks of data into a 3-dimensional array. More...
 
MTKt_status MtkReadBlockRangeNC (const char *filename, const char *gridname, const char *fieldname, int startblock, int endblock, MTKt_DataBuffer3D *databuf)
 
MTKt_status MtkReadBlockRangeHDF (const char *filename, const char *gridname, const char *fieldname, int startblock, int endblock, MTKt_DataBuffer3D *databuf)
 
MTKt_status MtkReadBlockRangeFid (int32 fid, const char *gridname, const char *fieldname, int startblock, int endblock, MTKt_DataBuffer3D *databuf)
 Version of MtkReadBlockRange that takes an HDF-EOS file identifier rather than a filename. More...
 
MTKt_status MtkReadBlockRangeNcid (int ncid, const char *gridname, const char *fieldname, int startblock, int endblock, MTKt_DataBuffer3D *databuf)
 

Function Documentation

◆ MtkReadBlockRange()

MTKt_status MtkReadBlockRange ( const char *  filename,
const char *  gridname,
const char *  fieldname,
int  startblock,
int  endblock,
MTKt_DataBuffer3D databuf 
)

Read range of blocks of data into a 3-dimensional array.

Returns
MTK_SUCCESS if successful.
Example:
In this example, we read blocks 26 through 40 for the field AveSceneElev in the grid Standard in the file MISR_AM1_AGP_P037_F01_24.hdf
status = MtkReadBlockRange("MISR_AM1_AGP_P037_F01_24.hdf", "Standard", "AveSceneElev", 26, 40, &databuf);
Note
The caller is responsible for using MtkDataBufferFree3D() to free the memory used by databuf
The MISR Toolkit read functions always return a 2-D data plane buffer. Some fields in the MISR data products are multi-dimensional. In order to read one of these fields, the slice to read needs to be specified. A bracket notation on the fieldname is used for this purpose. For example fieldname = "RetrAppMask[0][5]".
Additional dimensions can be determined by the routine MtkFileGridFieldToDimlist() or by the MISR Data Product Specification (DPS) Document. The actually definition of the indices are not described in the MISR product files and thus not described by the MISR Toolkit. These will have to be looked up in the MISR DPS. All indices are 0-based.
Parameters
[in]filenameFile name
[in]gridnameGrid name
[in]fieldnameField name
[in]startblockStart block number
[in]endblockStop block number
[out]databuf3-dimensional Data buffer

Definition at line 51 of file MtkReadBlockRange.c.

◆ MtkReadBlockRangeFid()

MTKt_status MtkReadBlockRangeFid ( int32  fid,
const char *  gridname,
const char *  fieldname,
int  startblock,
int  endblock,
MTKt_DataBuffer3D databuf 
)

Version of MtkReadBlockRange that takes an HDF-EOS file identifier rather than a filename.

Returns
MTK_SUCCESS if successful.
Parameters
[in]fidHDF-EOS file identifier
[in]gridnameGrid name
[in]fieldnameField name
[in]startblockStart block number
[in]endblockStop block number
[out]databuf3-dimensional Data buffer

Definition at line 146 of file MtkReadBlockRange.c.

◆ MtkReadBlockRangeHDF()

MTKt_status MtkReadBlockRangeHDF ( const char *  filename,
const char *  gridname,
const char *  fieldname,
int  startblock,
int  endblock,
MTKt_DataBuffer3D databuf 
)
Parameters
[in]filenameFile name
[in]gridnameGrid name
[in]fieldnameField name
[in]startblockStart block number
[in]endblockStop block number
[out]databuf3-dimensional Data buffer

Definition at line 106 of file MtkReadBlockRange.c.

◆ MtkReadBlockRangeNC()

MTKt_status MtkReadBlockRangeNC ( const char *  filename,
const char *  gridname,
const char *  fieldname,
int  startblock,
int  endblock,
MTKt_DataBuffer3D databuf 
)
Parameters
[in]filenameFile name
[in]gridnameGrid name
[in]fieldnameField name
[in]startblockStart block number
[in]endblockStop block number
[out]databuf3-dimensional Data buffer

Definition at line 67 of file MtkReadBlockRange.c.

◆ MtkReadBlockRangeNcid()

MTKt_status MtkReadBlockRangeNcid ( int  ncid,
const char *  gridname,
const char *  fieldname,
int  startblock,
int  endblock,
MTKt_DataBuffer3D databuf 
)
Parameters
[in]ncidnetCDF file identifier
[in]gridnameGrid name
[in]fieldnameField name
[in]startblockStart block number
[in]endblockStop block number
[out]databuf3-dimensional Data buffer

Definition at line 232 of file MtkReadBlockRange.c.


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