ocssw  1.0
/disk01/web/ocssw/build/inc/swfinc/cdl_object.h (r8090/r3)
Go to the documentation of this file.
00001 /*
00002 
00003 $Header: /app/shared/RCS/irix-5.2/seawifsd/src/hdfio/Shared.V4.2/L012_Util/util/hdf/cdl_object.h,v 4.12 1995/02/24 15:34:52 seawifsd Exp seawifsd $
00004 $Log: cdl_object.h,v $
00005 Revision 4.12  1995/02/24 15:34:52  seawifsd
00006 added support of new object DFANObj.
00007 
00008 Revision 4.11  1995/02/21 16:46:08  seawifsd
00009 implemented CAL_OFFSET feature.
00010 
00011 Revision 4.10  1995/01/17 19:58:15  seawifsd
00012 Jan. 17, 1994, V4.10
00013 
00014 Revision 4.1  1995/01/17 14:14:31  seawifsd
00015 Jan. 9, 1994, 4.0
00016 
00017 Revision 3.4  1994/12/23 19:00:17  seawifsd
00018 commented out un-used header file cdl_attr.h.
00019 deleted commented out #ifdef/#endif that was calling compiling errors in
00020 some unknown situations when -cckr was used. No problem for -ansi.
00021 
00022 Revision 3.3  1994/11/08 18:46:36  seawifsd
00023 Nov. 8, 1994, 3.3a3
00024 
00025 Revision 3.3  1994/11/08 15:04:34  seawifsd
00026 Nov. 8, 1994, 3.3a2
00027 
00028 Revision 1.1.1.2  1994/10/04 15:51:20  frank
00029 added code to support MFSD_MINMAX feature for future use.
00030 added code to support REC_FLAG and NSAMP_DIMS features in the future so
00031 that generic read routine can find out whether the SDS is a 'record'
00032 variable or contains 'nsamp' dimension.
00033 
00034 Revision 1.1.1.1  1994/05/23 14:52:04  frank
00035 changed 'int' to 'int32' on MFSDObjStruct so that compiling with ANSI
00036 will be correct.
00037 
00038 Revision 1.2  1994/05/10 18:49:16  seawifst
00039 May 6, 1994 version 1.2
00040 
00041 Revision 1.1  1994/04/19 13:33:00  seawifst
00042 Initial revision
00043 
00044 
00045  */
00046 
00047 
00048 #ifndef _CDL_OBJECT_H_
00049 #define _CDL_OBJECT_H_
00050 /*
00051 #include    "cdl_attr.h"
00052 */
00053 #ifndef MAXDIMS
00054 #define MAXDIMS 3
00055 #endif
00056 
00057 #define WIFSATTRTYPE    1
00058 #define WIFSVGRPTYPE    2
00059 #define WIFSMFSDTYPE    3
00060 #define WIFSSFSDTYPE    4
00061 #define WIFSVSETTYPE    5
00062 #define WIFSDFANTYPE    6
00063 #define WIFSATTRTYPESTR "Attribute"
00064 #define WIFSVGRPTYPESTR "Vgroup"
00065 #define WIFSMFSDTYPESTR "MF_SDS"
00066 #define WIFSSFSDTYPESTR "SF_SDS"
00067 #define WIFSVSETTYPESTR "Vset"
00068 #define WIFSDFANTYPESTR "DFAN"
00069 
00070 /* this structure must match the beginning part of the SeaWiFS data */
00071 /* file structure. For example: level_1a_gac_datStruct          */
00072 typedef struct cdl_hdrStruct {
00073     int     n;      /* total number of records      */
00074     int     fid;        /* HDF file id for SD routines      */
00075                 /* return by SDstart()          */
00076     int     fid2;       /* HDF file id for all other routines   */
00077                 /* return by Hopen()            */
00078     char    *fname;     /* HDF data file name           */
00079     int     ngattr;     /* number of global attributes      */
00080     int     nvgrp;      /* number of VGRP object        */
00081     int     nmfsd;      /* number of MFSD object        */
00082     int     nsfsd;      /* number of SFSD object        */
00083     int nvset;      /* number of VSET object        */
00084     int ndfan;      /* number of DFAN object        */
00085 } cdl_hdrType;
00086 
00087 /* CDL variable attribute Object_type = "Attribute"         */
00088 /* this type will be implemented as HDF multifile SDS global attribute  */
00089 /* Also, the attributes for MFSD variables will also be implemented in  */
00090 /* this structure.                          */
00091 typedef struct ATTRObjStruct {
00092     int idx;    /* HDF Attribute index              */
00093     char    *name;  /* CDL variable name, not in HDF data       */
00094     int DFNT;   /* HDF global attribute data type       */
00095     int count;  /* dimension, number of data item       */
00096     char    *label; /* name of HDF global attribute, CDL attribute  */
00097             /* 'long_name'                  */
00098     void    *data;  /* value of HDF global attribute        */
00099 } ATTRObjType;
00100 
00101 typedef struct SFSDObjStruct {
00102     int ref;
00103 } SFSDObjType;
00104 
00105 typedef struct MFSDObjStruct {
00106     int32       sid;        /* SDS id           */
00107     int     ref;        /* SDS reference number     */
00108     int     idx;        /* HDF SDS index        */
00109     char        *name;      /* name of the SDS      */
00110     int     DFNT;       /* data type            */
00111     int32       rank;       /* rank             */
00112     int32       dims[MAXDIMS];  /* dimension            */
00113     char        *dimname[MAXDIMS];/* name of each dimension */
00114     int32       dimid[MAXDIMS]; /* dimension id         */
00115     void        *data;      /* data pointer         */
00116     char        *label;     /* label(long_name) of SDS  */
00117                     /* redundant of attr 'long_name'*/
00118     unsigned char   rec_flag;   /* whether it's record var T/F  */
00119     int32       nsamp_dims[MAXDIMS];/* link-list pointed to the */
00120                     /* dimension that is 'nsamp'    */
00121     void        *valid_max;
00122     void        *valid_min;
00123     void        *max;
00124     void        *min;
00125 
00126 #ifndef NO_CAL_OFFSET
00127     /* the relationship between the actual value 'y' and the value  */
00128     /* 'x' that is stored in a data set is defined as:      */
00129     /*                              */
00130     /* y = cal*(x - cal_offset)                 */
00131     /*                              */
00132     /* which is not the same as slope/intercept defined in SeaWiFS: */
00133     /*                              */
00134     /* y = slope * x + intercept                    */
00135     /*                              */
00136     /* Thus                             */
00137     /*                              */
00138     /*  cal = slope ; cal_offset = -(intercept/slope)       */
00139     /*                              */
00140     /* if uncal_num_type is defined as DFNT_NONE, it means that */
00141     /* there is no slope/intercept(cal/cal_offset) been defined */
00142     /* for this SDS                         */
00143     int32       uncal_num_type; /* number type of uncalibrated data */
00144     float64     cal;        /* calibration factor       */
00145     float64     cal_err;    /* calibration error        */
00146     float64     cal_offset; /* uncalibrated offset      */
00147     float64     cal_offset_err; /* uncalibrated offset error    */
00148 #endif /* !NO_CAL_OFFSET */
00149 
00150     char        *group;     /* group name for this SDS  */
00151                     /* value from corresponding VGRP*/
00152     char        *class;     /* class name for this SDS  */
00153                     /* value from corresponding VGRP*/
00154     int     nattr;      /* total number of attributes   */
00155     ATTRObjType *attrs;     /* list of attribute pointers   */
00156 } MFSDObjType;
00157 
00158 
00159 /* CDL variable attribute Object_type = "Vgroup"            */
00160 /* this will be implemented in HDF Vgroup               */
00161 typedef struct VGRPObjStruct {
00162     int gid;    /* Vgroup ID                    */
00163     char    *name;  /* variable name, not in HDF            */
00164     char    *group; /* Vgroup name                  */
00165     char    *class; /* Vgroup class                 */
00166 } VGRPObjType;
00167 
00168 typedef struct VSETObjStruct {
00169     int ref;
00170 } VSETObjType;
00171 
00172 typedef struct DFANObjStruct {
00173     int dfantype;   /* DFTAG_FID,DFTAG_FD,DFTAG_DIL,DFTAG_DIA*/
00174     int32   tag;        /* target tag(DFTAG_DIL,DFTAG_DIA)  */
00175     int32   ref;        /* target ref(DFTAG_DIL,DFTAG_DIA)  */
00176     int seq;        /* sequence number(DFTAG_FID,DFTAG_FD)  */
00177     char    *data;
00178     int len;        /* data size(DFTAG_FD,DFTAG_DIA)    */
00179 } DFANObjType;
00180 
00181 typedef MFSDObjType MFSDObj;
00182 typedef ATTRObjType ATTRObj;
00183 typedef VGRPObjType VGRPObj;
00184 typedef SFSDObjType SFSDObj;
00185 typedef VSETObjType VSETObj;
00186 typedef DFANObjType DFANObj;
00187 
00188 typedef struct ObjIndexStruct {
00189     int objtype;    /* HDF Object type,WIFSATTRTYPE,... */
00190     int objindex;   /* 0,1,2,...                */
00191 } ObjIndexType;
00192 
00193 typedef ObjIndexType    Objidx;
00194 
00195 
00196 #include "usrhdr.h"
00197 #include "usrmac.h"
00198 #include "cdl_object_proto.h"
00199 #endif /* _CDL_OBJECT_H_ */