28 #include <HdfEosDef.h> 42 const char *fieldname,
81 const char *fieldname,
114 char *basefield = NULL;
116 int *extradims = NULL;
126 strncpy(fieldstr, fieldname,
MAXSTR);
127 fieldarr[0] = fieldstr;
130 if ((sp = strchr(fieldstr,
' ')) != NULL) {
133 }
else if ((sp = strchr(fieldstr,
'\0')) != NULL) {
143 if ((sp = strcasestr(fieldname,
"raw")) != NULL ||
144 (sp = strcasestr(fieldname,
"native")) != NULL) {
148 }
else if ((sp = strcasestr(fieldname,
"flag")) != NULL) {
170 strcpy(attr,
"valid_min");
174 strcpy(attr,
"valid_max");
178 strcpy(attr,
"scale_factor");
182 strcpy(attr,
"add_offset");
186 strcpy(attr,
"_FillValue");
198 status =
MtkReadRawFid(fid, gridname, field, region, &rawbuf, &map);
207 for (l = 0; l < buf.
nline; l++) {
208 for (s = 0; s < buf.
nsample; s++) {
219 for (l = 0; l < buf.
nline; l++) {
220 for (s = 0; s < buf.
nsample; s++) {
232 for (l = 0; l < buf.
nline; l++) {
233 for (s = 0; s < buf.
nsample; s++) {
242 if ((sp = strcasestr(basefield,
"ERImageContrast_WithoutWindCorrection")) != NULL ) {
243 for (l = 0; l < buf.
nline; l++) {
244 for (s = 0; s < buf.
nsample; s++) {
266 status =
MtkReadRawFid(fid, gridname, field, region, &buf, &map);
287 if (basefield != NULL) free(basefield);
288 if (extradims != NULL) free(extradims);
MTKt_status MtkDataBufferAllocate(int nline, int nsample, MTKt_DataType datatype, MTKt_DataBuffer *databuf)
Allocate Data Buffer.
#define MTKT_MAPINFO_INIT
MTKt_status MtkFieldAttrGetFid(int32 sds_id, const char *fieldname, const char *attrname, MTKt_DataBuffer *attrbuf)
Version of MtkFieldAttrGet that takes an HDF SD file identifier rather than a filename.
MTKt_status MtkParseFieldname(const char *fieldname, char **basefieldname, int *ndim, int **dimlist)
Parses extra dimensions from fieldnames.
#define MTK_ERR_CODE_JUMP(code)
2-dimensional Data Buffer
#define MTKT_DATABUFFER_INIT
MTKt_status MtkDataBufferFree(MTKt_DataBuffer *databuf)
Free data buffer.
HDFFCLIBAPI int32 float32 * max
MTKt_status MtkReadL2TCCloud(const char *filename, const char *gridname, const char *fieldname, MTKt_Region region, MTKt_DataBuffer *databuf, MTKt_MapInfo *mapinfo)
Reads, unpacks and unscales TC_CLOUD grid/fields from a MISR L2 TC_CLOUD product file.
HDFFCLIBAPI intf void * scale
MTKt_status MtkReadRawFid(int32 fid, const char *gridname, const char *fieldname, MTKt_Region region, MTKt_DataBuffer *databuf, MTKt_MapInfo *mapinfo)
Version of MtkReadRaw that takes an HDF-EOS file identifier rather than a filename.
MTKt_status MtkReadL2TCCloudFid(int32 fid, const char *gridname, const char *fieldname, MTKt_Region region, MTKt_DataBuffer *databuf, MTKt_MapInfo *mapinfo)
Version of MtkReadL2TCCloud that takes and HDF-EOS file identifier rather than a filename.
#define MTK_ERR_COND_JUMP(code)
HDFFCLIBAPI intf * offset
int32 GDopen(char *, intn)