ocssw  1.0
Classes | Defines | Functions
/disk01/web/ocssw/build/inc/utils/hdf_utils.h File Reference

(r8084/r7883)

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "hdf.h"
#include "mfhdf.h"
#include "passthebuck.h"

Go to the source code of this file.

Classes

struct  idDS

Defines

#define READ_GLBL_ATTR(nam, ptr)
#define READ_GLBL_ATTR_E(nam, ptr)
#define READ_SDS(nam, ptr, s0, s1, s2, e0, e1, e2)
#define READ_SDS_E(nam, ptr, s0, s1, s2, e0, e1, e2)
#define READ_SDS_ID(sd_id, nam, ptr, s0, s1, s2, s3, e0, e1, e2, e3)
#define READ_SDS_ID_E(sd_id, nam, ptr, s0, s1, s2, s3, e0, e1, e2, e3)

Functions

int32 hdf_sizeof (int32 dtype)
 return the sizeof dtype in bytes
char * GetFileDesc (char *filename)
int SetChrGA (idDS ds_id, char *, char *)
int SetF32GA (idDS ds_id, char *, float32)
int SetF64GA (idDS ds_id, char *name, float64 value)
int SetI8GA (idDS ds_id, char *, uint8)
int SetI16GA (idDS ds_id, char *, int16)
int SetI32GA (idDS ds_id, char *, int32)
int CreateSDS (int32 sd_id, char *sname, char *lname, char *standard_name, char *units, double low, double high, float slope, float offset, int32 nt, int32 rank, int32 d0, int32 d1, int32 d2, char *dn0, char *dn1, char *dn2)
int sd_create (int32, char *, int32, int32, int32, int32, int32, int32 *)
int sd_select (int32, char *, int32 *)
int sd_endaccess (int32)
int sd_setdimnames (int32, char *, char *, char *)
int sd_setdimname (int32, int32, char *)
int sd_setattr (int32, char *, int32, int32, VOIDP)
int sd_writedata (int32 sd_id, char *, VOIDP, int32, int32, int32, int32, int32, int32)
int AddSdsToVgroup (int32 sd_id, int32 v_id, char *name)
int v_attach (int32 h_id, int32 *v_id)
int getDims (int32 fileID, char sdsname[], int32 dims[])
int getDimsDS (idDS ds_id, char sdsname[], int32 dims[])
int get_type (int32 fileID, char sdsname[], int32 *dtype)
int getTypeDS (idDS ds_id, char sdsname[H4_MAX_NC_NAME], int32 *dtype)
int rdSDS (int32 fileID, char sdsname[], int32 start1, int32 start2, int32 edges1, int32 edges2, VOIDP array_data)
int getHDFattr (int32 fileID, char attrname[], char sdsname[], VOIDP data)
int32 read_SDS (int32 sdfid, char *sds_name, void *buffer)
intn attach_vdata (int32 fid, char *sname)
intn rdvdata (int32 vskey, char *fields, int32 start, int32 nelt, unsigned char *databuf)
void check_err (const int stat, const int line, const char *file)
int setAttr (idDS ds_id, char *nam, int32 typ, int32 cnt, VOIDP data)
int8_t findAttr (idDS ds_id, char *nam)
int readAttr (idDS ds_id, char *nam, VOIDP data)
int infoAttr (idDS ds_id, char *nam, int32 *dtype, int32 *count)
int createDS (idDS ds_id, char *sname, char *lname, char *standard_name, char *units, double low, double high, float slope, float offset, int32 nt, int32 rank, int32 d0, int32 d1, int32 d2, char *dn0, char *dn1, char *dn2)
int32 selectDS (idDS ds_id, char *l2_prod_names)
int32 checkDS (idDS ds_id, char *l2_prod_name)
int writeDS (idDS ds_id, char *name, VOIDP data, int32 s0, int32 s1, int32 s2, int32 e0, int32 e1, int32 e2)
int readDS (idDS ds_id, char *name, int32 *start, int32 *stride, int32 *count, VOIDP data)
idDS startDS (char *filename, int32 format, int32 accessmode)
int endaccessDS (idDS ds_id)
int endDS (idDS ds_id)
int getProdlist (char *fname, char **prodlist, int32 *l2_flags_type)
int CreateNCDF (int32_t nc_id, char *sname, char *lname, char *standard_name, char *units, double low, double high, float slope, float offset, int32_t nt, int32_t rank, int32_t dimids[3])
int writeBinList_nc (int32_t grpid, int32_t nbins_to_write, void *data)
int writeBinData_nc (int32_t grpid, int32_t nbins_to_write, int32_t iprod, char *prodname, void *data)
int writeBinIndex_nc (int32_t grpid, int32_t nbins_to_write, void *data)

Define Documentation

#define READ_GLBL_ATTR (   nam,
  ptr 
)
Value:
{                                       \
  if(SDreadattr(sd_id,SDfindattr(sd_id,(nam)),(VOIDP)(ptr))){           \
    fprintf(stderr,                                                     \
    "-E- %s line %d: Could not get global attribute, %s.\n",            \
    __FILE__,__LINE__,(nam));                                           \
  }                                                                     \
}

Definition at line 70 of file hdf_utils.h.

#define READ_GLBL_ATTR_E (   nam,
  ptr 
)
Value:
{                                     \
    if(SDreadattr(sd_id,SDfindattr(sd_id,(nam)),(VOIDP)(ptr))){         \
    fprintf(stderr,                                                     \
    "-E- %s line %d: Could not get global attribute, %s.\n",            \
    __FILE__,__LINE__,(nam));                                           \
    exit(1);                                                            \
  }                                                                     \
}

Definition at line 78 of file hdf_utils.h.

#define READ_SDS (   nam,
  ptr,
  s0,
  s1,
  s2,
  e0,
  e1,
  e2 
)
Value:
{                           \
  int32 start[3];                                                       \
  int32 edge[3];                                                        \
  edge[0]=(e0); edge[1]=(e1); edge[2]=(e2);                             \
  start[0]=(s0); start[1]=(s1); start[2]=(s2);                          \
  if(SDreaddata(SDselect(sd_id, SDnametoindex(sd_id, (nam))),           \
  start, NULL, edge, (VOIDP)(ptr)) == FAIL){                            \
    fprintf(stderr,"-E- %s line %d: Could not read SDS, %s.\n",         \
    __FILE__,__LINE__,(nam));                                           \
  }                                                                     \
}

Definition at line 87 of file hdf_utils.h.

#define READ_SDS_E (   nam,
  ptr,
  s0,
  s1,
  s2,
  e0,
  e1,
  e2 
)
Value:
{                         \
  int32 start[3];                                                       \
  int32 edge[3];                                                        \
  edge[0]=(e0); edge[1]=(e1); edge[2]=(e2);                             \
  start[0]=(s0); start[1]=(s1); start[2]=(s2);                          \
  if(SDreaddata(SDselect(sd_id, SDnametoindex(sd_id, (nam))),           \
  start, NULL, edge, (VOIDP)(ptr)) == FAIL){                            \
    fprintf(stderr,"-E- %s line %d: Could not read SDS, %s.\n",         \
    __FILE__,__LINE__,(nam));                                           \
    exit(1);                                                            \
  }                                                                     \
}

Definition at line 99 of file hdf_utils.h.

#define READ_SDS_ID (   sd_id,
  nam,
  ptr,
  s0,
  s1,
  s2,
  s3,
  e0,
  e1,
  e2,
  e3 
)
Value:
{            \
  int32 start[4];                                                       \
  int32 edge[4];                                                        \
  edge[0]=(e0); edge[1]=(e1); edge[2]=(e2);  edge[3]=(e3);              \
  start[0]=(s0); start[1]=(s1); start[2]=(s2); start[3]=(s3);           \
  if(SDreaddata(SDselect((sd_id), SDnametoindex((sd_id), (nam))),       \
  start, NULL, edge, (VOIDP)(ptr)) == FAIL){                            \
    fprintf(stderr,"-E- %s line %d: Could not read SDS, %s.\n",         \
    __FILE__,__LINE__,(nam));                                           \
  }                                                                     \
}

Definition at line 112 of file hdf_utils.h.

#define READ_SDS_ID_E (   sd_id,
  nam,
  ptr,
  s0,
  s1,
  s2,
  s3,
  e0,
  e1,
  e2,
  e3 
)
Value:
{          \
  int32 start[4];                                                       \
  int32 edge[4];                                                        \
  edge[0]=(e0); edge[1]=(e1); edge[2]=(e2);  edge[3]=(e3);              \
  start[0]=(s0); start[1]=(s1); start[2]=(s2); start[3]=(s3);           \
  if(SDreaddata(SDselect((sd_id), SDnametoindex((sd_id), (nam))),       \
  start, NULL, edge, (VOIDP)(ptr)) == FAIL){                            \
    fprintf(stderr,"-E- %s line %d: Could not read SDS, %s.\n",         \
    __FILE__,__LINE__,(nam));                                           \
    exit(1);                                                            \
  }                                                                     \
}

Definition at line 124 of file hdf_utils.h.


Function Documentation

int AddSdsToVgroup ( int32  sd_id,
int32  v_id,
char *  name 
)

Definition at line 352 of file hdf_utils.c.

intn attach_vdata ( int32  fid,
char *  sname 
)

Definition at line 505 of file calib_get_cal_misc.c.

void check_err ( const int  stat,
const int  line,
const char *  file 
)
int32 checkDS ( idDS  ds_id,
char *  l2_prod_name 
)

Definition at line 327 of file wrapper.c.

int createDS ( idDS  ds_id,
char *  sname,
char *  lname,
char *  standard_name,
char *  units,
double  low,
double  high,
float  slope,
float  offset,
int32  nt,
int32  rank,
int32  d0,
int32  d1,
int32  d2,
char *  dn0,
char *  dn1,
char *  dn2 
)

Definition at line 252 of file wrapper.c.

int CreateNCDF ( int32_t  nc_id,
char *  sname,
char *  lname,
char *  standard_name,
char *  units,
double  low,
double  high,
float  slope,
float  offset,
int32_t  nt,
int32_t  rank,
int32_t  dimids[3] 
)

Definition at line 24 of file ncdf_utils.c.

int CreateSDS ( int32  sd_id,
char *  sname,
char *  lname,
char *  standard_name,
char *  units,
double  low,
double  high,
float  slope,
float  offset,
int32  nt,
int32  rank,
int32  d0,
int32  d1,
int32  d2,
char *  dn0,
char *  dn1,
char *  dn2 
)

Definition at line 76 of file hdf_utils.c.

int endaccessDS ( idDS  ds_id)

Definition at line 443 of file wrapper.c.

int endDS ( idDS  ds_id)

Definition at line 450 of file wrapper.c.

int8_t findAttr ( idDS  ds_id,
char *  nam 
)

Definition at line 41 of file wrapper.c.

int get_type ( int32  fileID,
char  sdsname[],
int32 *  dtype 
)
int getDims ( int32  fileID,
char  sdsname[],
int32  dims[] 
)
int getDimsDS ( idDS  ds_id,
char  sdsname[],
int32  dims[] 
)
char* GetFileDesc ( char *  filename)

Definition at line 719 of file hdf_utils.c.

int getHDFattr ( int32  fileID,
char  attrname[],
char  sdsname[],
VOIDP  data 
)
int getProdlist ( char *  fname,
char **  prodlist,
int32 *  l2_flags_type 
)

Definition at line 516 of file wrapper.c.

int getTypeDS ( idDS  ds_id,
char  sdsname[H4_MAX_NC_NAME],
int32 *  dtype 
)

Definition at line 492 of file wrapper.c.

int32 hdf_sizeof ( int32  dtype)

return the sizeof dtype in bytes

Definition at line 27 of file hdf_utils.c.

int infoAttr ( idDS  ds_id,
char *  nam,
int32 *  dtype,
int32 *  count 
)

Definition at line 86 of file wrapper.c.

int rdSDS ( int32  fileID,
char  sdsname[],
int32  start1,
int32  start2,
int32  edges1,
int32  edges2,
VOIDP  array_data 
)
intn rdvdata ( int32  vskey,
char *  fields,
int32  start,
int32  nelt,
unsigned char *  databuf 
)

Definition at line 977 of file l3stat_chk.c.

int32 read_SDS ( int32  sdfid,
char *  sds_name,
void *  buffer 
)

Definition at line 640 of file calib_get_cal_misc.c.

int readAttr ( idDS  ds_id,
char *  nam,
VOIDP  data 
)

Definition at line 64 of file wrapper.c.

int readDS ( idDS  ds_id,
char *  name,
int32 *  start,
int32 *  stride,
int32 *  count,
VOIDP  data 
)

Definition at line 373 of file wrapper.c.

int sd_create ( int32  ,
char *  ,
int32  ,
int32  ,
int32  ,
int32  ,
int32  ,
int32 *   
)

Definition at line 1394 of file swl1_hdf.c.

int sd_endaccess ( int32  )

Definition at line 1422 of file swl1_hdf.c.

int sd_select ( int32  ,
char *  ,
int32 *   
)

Definition at line 1489 of file swl1_hdf.c.

int sd_setattr ( int32  ,
char *  ,
int32  ,
int32  ,
VOIDP   
)

Definition at line 1384 of file swl1_hdf.c.

int sd_setdimname ( int32  ,
int32  ,
char *   
)

Definition at line 1443 of file swl1_hdf.c.

int sd_setdimnames ( int32  ,
char *  ,
char *  ,
char *   
)

Definition at line 1432 of file swl1_hdf.c.

int sd_writedata ( int32  sd_id,
char *  ,
VOIDP  ,
int32  ,
int32  ,
int32  ,
int32  ,
int32  ,
int32   
)

Definition at line 268 of file hdf_utils.c.

int32 selectDS ( idDS  ds_id,
char *  l2_prod_names 
)

Definition at line 313 of file wrapper.c.

int setAttr ( idDS  ds_id,
char *  nam,
int32  typ,
int32  cnt,
VOIDP  data 
)

Definition at line 114 of file wrapper.c.

int SetChrGA ( idDS  ds_id,
char *  ,
char *   
)

Definition at line 131 of file wrapper.c.

int SetF32GA ( idDS  ds_id,
char *  ,
float32   
)

Definition at line 171 of file wrapper.c.

int SetF64GA ( idDS  ds_id,
char *  name,
float64  value 
)

Definition at line 151 of file wrapper.c.

int SetI16GA ( idDS  ds_id,
char *  ,
int16   
)

Definition at line 191 of file wrapper.c.

int SetI32GA ( idDS  ds_id,
char *  ,
int32   
)

Definition at line 231 of file wrapper.c.

int SetI8GA ( idDS  ds_id,
char *  ,
uint8   
)

Definition at line 211 of file wrapper.c.

idDS startDS ( char *  filename,
int32  format,
int32  accessmode 
)

Definition at line 409 of file wrapper.c.

int v_attach ( int32  h_id,
int32 *  v_id 
)

Definition at line 1510 of file swl1_hdf.c.

int writeBinData_nc ( int32_t  grpid,
int32_t  nbins_to_write,
int32_t  iprod,
char *  prodname,
void *  data 
)
int writeBinIndex_nc ( int32_t  grpid,
int32_t  nbins_to_write,
void *  data 
)
int writeBinList_nc ( int32_t  grpid,
int32_t  nbins_to_write,
void *  data 
)
int writeDS ( idDS  ds_id,
char *  name,
VOIDP  data,
int32  s0,
int32  s1,
int32  s2,
int32  e0,
int32  e1,
int32  e2 
)

Definition at line 338 of file wrapper.c.