OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
cdl_object.h
Go to the documentation of this file.
1 /*
2 
3 $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 $
4 $Log: cdl_object.h,v $
5 Revision 4.12 1995/02/24 15:34:52 seawifsd
6 added support of new object DFANObj.
7 
8 Revision 4.11 1995/02/21 16:46:08 seawifsd
9 implemented CAL_OFFSET feature.
10 
11 Revision 4.10 1995/01/17 19:58:15 seawifsd
12 Jan. 17, 1994, V4.10
13 
14 Revision 4.1 1995/01/17 14:14:31 seawifsd
15 Jan. 9, 1994, 4.0
16 
17 Revision 3.4 1994/12/23 19:00:17 seawifsd
18 commented out un-used header file cdl_attr.h.
19 deleted commented out #ifdef/#endif that was calling compiling errors in
20 some unknown situations when -cckr was used. No problem for -ansi.
21 
22 Revision 3.3 1994/11/08 18:46:36 seawifsd
23 Nov. 8, 1994, 3.3a3
24 
25 Revision 3.3 1994/11/08 15:04:34 seawifsd
26 Nov. 8, 1994, 3.3a2
27 
28 Revision 1.1.1.2 1994/10/04 15:51:20 frank
29 added code to support MFSD_MINMAX feature for future use.
30 added code to support REC_FLAG and NSAMP_DIMS features in the future so
31 that generic read routine can find out whether the SDS is a 'record'
32 variable or contains 'nsamp' dimension.
33 
34 Revision 1.1.1.1 1994/05/23 14:52:04 frank
35 changed 'int' to 'int32' on MFSDObjStruct so that compiling with ANSI
36 will be correct.
37 
38 Revision 1.2 1994/05/10 18:49:16 seawifst
39 May 6, 1994 version 1.2
40 
41 Revision 1.1 1994/04/19 13:33:00 seawifst
42 Initial revision
43 
44 
45  */
46 
47 
48 #ifndef _CDL_OBJECT_H_
49 #define _CDL_OBJECT_H_
50 /*
51 #include "cdl_attr.h"
52  */
53 #ifndef MAXDIMS
54 #define MAXDIMS 3
55 #endif
56 
57 #define WIFSATTRTYPE 1
58 #define WIFSVGRPTYPE 2
59 #define WIFSMFSDTYPE 3
60 #define WIFSSFSDTYPE 4
61 #define WIFSVSETTYPE 5
62 #define WIFSDFANTYPE 6
63 #define WIFSATTRTYPESTR "Attribute"
64 #define WIFSVGRPTYPESTR "Vgroup"
65 #define WIFSMFSDTYPESTR "MF_SDS"
66 #define WIFSSFSDTYPESTR "SF_SDS"
67 #define WIFSVSETTYPESTR "Vset"
68 #define WIFSDFANTYPESTR "DFAN"
69 
70 /* this structure must match the beginning part of the SeaWiFS data */
71 
72 /* file structure. For example: level_1a_gac_datStruct */
73 typedef struct cdl_hdrStruct {
74  int n; /* total number of records */
75  int fid; /* HDF file id for SD routines */
76  /* return by SDstart() */
77  int fid2; /* HDF file id for all other routines */
78  /* return by Hopen() */
79  char *fname; /* HDF data file name */
80  int ngattr; /* number of global attributes */
81  int nvgrp; /* number of VGRP object */
82  int nmfsd; /* number of MFSD object */
83  int nsfsd; /* number of SFSD object */
84  int nvset; /* number of VSET object */
85  int ndfan; /* number of DFAN object */
86 } cdl_hdrType;
87 
88 /* CDL variable attribute Object_type = "Attribute" */
89 /* this type will be implemented as HDF multifile SDS global attribute */
90 /* Also, the attributes for MFSD variables will also be implemented in */
91 
92 /* this structure. */
93 typedef struct ATTRObjStruct {
94  int idx; /* HDF Attribute index */
95  char *name; /* CDL variable name, not in HDF data */
96  int DFNT; /* HDF global attribute data type */
97  int count; /* dimension, number of data item */
98  char *label; /* name of HDF global attribute, CDL attribute */
99  /* 'long_name' */
100  void *data; /* value of HDF global attribute */
101 } ATTRObjType;
102 
103 typedef struct SFSDObjStruct {
104  int ref;
105 } SFSDObjType;
106 
107 typedef struct MFSDObjStruct {
108  int32 sid; /* SDS id */
109  int ref; /* SDS reference number */
110  int idx; /* HDF SDS index */
111  char *name; /* name of the SDS */
112  int DFNT; /* data type */
113  int32 rank; /* rank */
114  int32 dims[MAXDIMS]; /* dimension */
115  char *dimname[MAXDIMS]; /* name of each dimension */
116  int32 dimid[MAXDIMS]; /* dimension id */
117  void *data; /* data pointer */
118  char *label; /* label(long_name) of SDS */
119  /* redundant of attr 'long_name'*/
120  unsigned char rec_flag; /* whether it's record var T/F */
121  int32 nsamp_dims[MAXDIMS]; /* link-list pointed to the */
122  /* dimension that is 'nsamp' */
123  void *valid_max;
124  void *valid_min;
125  void *max;
126  void *min;
127 
128 #ifndef NO_CAL_OFFSET
129  /* the relationship between the actual value 'y' and the value */
130  /* 'x' that is stored in a data set is defined as: */
131  /* */
132  /* y = cal*(x - cal_offset) */
133  /* */
134  /* which is not the same as slope/intercept defined in SeaWiFS: */
135  /* */
136  /* y = slope * x + intercept */
137  /* */
138  /* Thus */
139  /* */
140  /* cal = slope ; cal_offset = -(intercept/slope) */
141  /* */
142  /* if uncal_num_type is defined as DFNT_NONE, it means that */
143  /* there is no slope/intercept(cal/cal_offset) been defined */
144  /* for this SDS */
145  int32 uncal_num_type; /* number type of uncalibrated data */
146  float64 cal; /* calibration factor */
147  float64 cal_err; /* calibration error */
148  float64 cal_offset; /* uncalibrated offset */
149  float64 cal_offset_err; /* uncalibrated offset error */
150 #endif /* !NO_CAL_OFFSET */
151 
152  char *group; /* group name for this SDS */
153  /* value from corresponding VGRP*/
154  char *class; /* class name for this SDS */
155  /* value from corresponding VGRP*/
156  int nattr; /* total number of attributes */
157  ATTRObjType *attrs; /* list of attribute pointers */
158 } MFSDObjType;
159 
160 
161 /* CDL variable attribute Object_type = "Vgroup" */
162 
163 /* this will be implemented in HDF Vgroup */
164 typedef struct VGRPObjStruct {
165  int gid; /* Vgroup ID */
166  char *name; /* variable name, not in HDF */
167  char *group; /* Vgroup name */
168  char *class; /* Vgroup class */
169 } VGRPObjType;
170 
171 typedef struct VSETObjStruct {
172  int ref;
173 } VSETObjType;
174 
175 typedef struct DFANObjStruct {
176  int dfantype; /* DFTAG_FID,DFTAG_FD,DFTAG_DIL,DFTAG_DIA*/
177  int32 tag; /* target tag(DFTAG_DIL,DFTAG_DIA) */
178  int32 ref; /* target ref(DFTAG_DIL,DFTAG_DIA) */
179  int seq; /* sequence number(DFTAG_FID,DFTAG_FD) */
180  char *data;
181  int len; /* data size(DFTAG_FD,DFTAG_DIA) */
182 } DFANObjType;
183 
184 typedef MFSDObjType MFSDObj;
185 typedef ATTRObjType ATTRObj;
186 typedef VGRPObjType VGRPObj;
187 typedef SFSDObjType SFSDObj;
188 typedef VSETObjType VSETObj;
189 typedef DFANObjType DFANObj;
190 
191 typedef struct ObjIndexStruct {
192  int objtype; /* HDF Object type,WIFSATTRTYPE,... */
193  int objindex; /* 0,1,2,... */
194 } ObjIndexType;
195 
196 typedef ObjIndexType Objidx;
197 
198 
199 //#include "usrhdr.h"
200 //#include "usrmac.h"
201 #include "cdl_object_proto.h"
202 #endif /* _CDL_OBJECT_H_ */
SFSDObjType SFSDObj
Definition: cdl_object.h:187
ATTRObjType ATTRObj
Definition: cdl_object.h:185
ObjIndexType Objidx
Definition: cdl_object.h:196
#define MAXDIMS
Definition: cdl_object.h:54
unsigned char rec_flag
Definition: cdl_object.h:120
void * valid_max
Definition: cdl_object.h:123
int32 nsamp_dims[MAXDIMS]
Definition: cdl_object.h:121
char * group
Definition: cdl_object.h:167
float64 cal_offset
Definition: cdl_object.h:148
float64 cal_err
Definition: cdl_object.h:147
float64 cal
Definition: cdl_object.h:146
int32 dimid[MAXDIMS]
Definition: cdl_object.h:116
VGRPObjType VGRPObj
Definition: cdl_object.h:186
char * label
Definition: cdl_object.h:98
ATTRObjType * attrs
Definition: cdl_object.h:157
void * valid_min
Definition: cdl_object.h:124
char * name
Definition: cdl_object.h:95
char * group
Definition: cdl_object.h:152
MFSDObjType MFSDObj
Definition: cdl_object.h:184
int32 uncal_num_type
Definition: cdl_object.h:145
char * label
Definition: cdl_object.h:118
int32 dims[MAXDIMS]
Definition: cdl_object.h:114
float64 cal_offset_err
Definition: cdl_object.h:149
VSETObjType VSETObj
Definition: cdl_object.h:188
char * fname
Definition: cdl_object.h:79
DFANObjType DFANObj
Definition: cdl_object.h:189
char * dimname[MAXDIMS]
Definition: cdl_object.h:115