OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
ffm.h
Go to the documentation of this file.
1 /*
2 
3 $Header: /app/shared/RCS/irix-5.2/seawifsd/src/hdfio/Shared.V4.5/L012_Util/util/data/ffm.h,v 4.13 1995/12/07 15:51:28 seawifsd Exp seawifsd $
4 $Log: ffm.h,v $
5 Revision 4.13 1995/12/07 15:51:28 seawifsd
6 added macro definitions about on-board recorder sizes used with
7 new MOPS command scheduling. The values are not completely settled
8 because different sets of values were shown up in MOPS schedule files.
9 
10 Revision 4.12 1995/08/03 20:46:04 seawifsd
11 added definition of FFM_RAW_LEN.
12 
13 Revision 4.11 1995/05/04 15:10:17 seawifsd
14 changed the way to set macros PCT_MSEC_ERR, GAC_MSEC_ERR, and
15 LAC_MSEC_ERR so that it can be set in the compiling time without
16 edit the file.
17 
18 Revision 4.10 1995/01/17 19:57:55 seawifsd
19 Jan. 17, 1994, V4.10
20 
21 Revision 4.1 1995/01/17 14:14:13 seawifsd
22 Jan. 9, 1994, 4.0
23 
24 Revision 3.3 1994/11/08 18:46:20 seawifsd
25 Nov. 8, 1994, 3.3a3
26 
27 Revision 3.3 1994/11/08 15:04:18 seawifsd
28 Nov. 8, 1994, 3.3a2
29 
30 Revision 1.1.1.3 1994/11/03 19:42:07 frank
31 changed FFM_GAP_MAX from 150 to 30(minorframes). Original 150 is using the
32 unit of 'GAC scan line'.
33 changed typo on 'LAC_FFM_GAP_MAX'(from LAC_FFM_GAC_MAX)
34 
35 Revision 1.1.1.2 1994/11/03 19:39:37 frank
36 defined GAC_FFM_MSEC_INC, LAC_FFM_MSEC_INC, PCT_MSEC_ERR, GAC_MSEC_ERR
37 LAC_MSEC_ERR, FFM_GAC_MAX, GAC_FFM_GAP_MAX, LAC_FFM_GAP_MAX, G
38 GAC_MSEC_GAP_MAX and LAC_MSEC_GAP_MAX.
39 
40 Revision 1.1.1.1 1994/10/04 15:21:18 frank
41 added definition of GAC_PIX_START,GAC_PIX_SUB, LAC_PIX_START, and LAC_PIX_SUB
42 added DARK_OFF and used the macro in the definition of LAC_DARK_OFF and GAC_DARK_OFF.
43 
44 Revision 1.2 1994/05/10 18:47:25 seawifst
45 May 6, 1994 version 1.2
46 
47 Revision 1.1 1994/04/19 13:29:55 seawifst
48 Initial revision
49 
50 
51  */
52 
53 
54 #ifndef FFM_
55 #define FFM_
56 
57 #define byte unsigned char
58 
59 /* short integer, number of synch bits used for error rate */
60 #define QF1_OFF 0
61 #define QF1_LEN 2
62 #define QF1_SCALE_FACTOR 1/5
63 /* byte, number of bit errors in synch bits */
64 #define QF2_OFF 2
65 #define QF2_LEN 1
66 
67 #define ID_OFF 3
68 #define ID_LEN 4
69 #define TAG_OFF 7
70 #define TAG_LEN 8
71 #define SOH_OFF 15
72 #define SOH_LEN 775
73 #define TLM_LEN 88
74 #define TDI_LEN 16
75 #define START_LEN 16
76 #define DARK_LEN 16
77 #define STOP_LEN 16
78 
79 #define DARK_OFF 32
80 /* LAC */
81 #define LAC_TLM_OFF 790
82 #define LAC_TLM_LEN TLM_LEN
83 #define LAC_OFF 878
84 #define LAC_LEN 20624
85 #define LAC_TDI_OFF 0
86 #define LAC_TDI_LEN TDI_LEN
87 #define LAC_START_OFF 16
88 #define LAC_START_LEN START_LEN
89 #define LAC_DARK_OFF DARK_OFF
90 #define LAC_DARK_LEN DARK_LEN
91 #define LAC_IMAGE_OFF 48
92 #define LAC_IMAGE_LEN 20560
93 #define LAC_STOP_OFF 20608
94 #define LAC_STOP_LEN STOP_LEN
95 /* END LAC */
96 
97 /* GAC */
98 #define GAC_OFF 790
99 #define GAC_LEN 4032
100 #define GAC_TDI_OFF 0
101 #define GAC_TDI_LEN TDI_LEN
102 #define GAC_START_OFF 16
103 #define GAC_START_LEN START_LEN
104 #define GAC_DARK_OFF DARK_OFF
105 #define GAC_DARK_LEN DARK_LEN
106 #define GAC_IMAGE_OFF 48
107 #define GAC_IMAGE_LEN 3968
108 #define GAC_STOP_OFF 4016
109 #define GAC_STOP_LEN STOP_LEN
110 
111 #define GAC_TLM_OFF 20950
112 #define GAC_TLM_LEN TLM_LEN
113 /*
114  For each GAC minorframe, following equations show how to access
115  each GAC image and the corresponding Inst/Anc Telemetry.
116  for(i=0; i < 5 ; i++) {
117  memcpy(image,&rec[GAC_OFF+i*GAC_LEN+GAC_IMAGE_OFF],GAC_IMAGE_LEN);
118  memcpy(tlm,&rec[GAC_TLM_OFF+i*GAC_TLM_LEN],GAC_TLM_LEN);
119  }
120  */
121 
122 #define GAC_SPR_OFF 21390
123 #define GAC_SPR_LEN 112
124 
125 /* END GAC */
126 #define SPR_OFF 21502
127 #define SPR_LEN 2
128 /* total length */
129 #define FFM_LEN 21504
130 #define FFMRECLEN FFM_LEN
131 #define FFM_RAW_LEN 13860
132 
133 /* RECORDER_SIZE was changed from 62500 to 65536 because the 62500 is */
134 /* using MB unit instead of million bytes used in other places */
135 /* 65536 = 62500 * 1.024 * 1.024 */
136 #define RECORDER_SIZE 65536
137 #define RECORDER2_LIMIT 59990
138 #define RECORDER_TLM_SIZE (RECORDER_SIZE - RECORDER2_LIMIT)
139 #define ALLOCATE_GAC_SIZE(x) ((x * FFM_RAW_LEN + 500) / 1000 - RECORDER_SIZE)
140 #define ALLOCATE_LAC_SIZE(x) ((x * FFM_RAW_LEN + 500) / 1000)
141 
142 /* FFM header block size */
143 #define FFMHDRLEN 512
144 /* Frame formatter missing frames */
145 #define FF_MISSING_FRAMES 1
146 
147 #define GAC_PER_FFM 5
148 
149 #define BANDS 8
150 
151 #define PIXEL_BLEN BANDS*2
152 #define PIXEL_WLEN BANDS
153 /*
154  define byte offset from the beginning offset of each gac/lac segment
155  which is equal to the size for START_SYNC and DARK_RESTORE and should
156  be equal to 32 bytes.
157  */
158 #define SCI_DATA_BOFF 2*PIXEL_BLEN
159 #define SCI_DATA_WOFF 2*PIXEL_WLEN
160 #define START_SYNC_OFF 0
161 #define DARK_RESTORE_OFF 1
162 #define GAC_PIXEL_NUM 248
163 #define LAC_PIXEL_NUM 1285
164 #define MAX_PIXEL_VALUE 1023
165 #define MIN_PIXEL_VALUE 0
166 #define SATURATED_VALUE 1023
167 
168 #define LAC_PIX_START 1
169 #define GAC_PIX_START 147
170 #define LAC_PIX_SUB 1
171 #define GAC_PIX_SUB 4
172 
173 typedef struct ffm_hdr_Struc {
175 } ffm_hdr_Type;
176 
177 typedef union ffm_rec_Struc {
179 } ffm_rec_Type;
180 
181 #define MSEC_PER_DAY 86400000
182 #define GAC_MSEC_INC (1000.0 * 4.0/6.0)
183 #define LAC_MSEC_INC (1000.0/6.0)
184 #define GAC_FFM_MSEC_INC ((GAC_MSEC_INC) * (GAC_PER_FFM))
185 #define LAC_FFM_MSEC_INC (LAC_MSEC_INC)
186 /*
187  Might not using the percentage tolerance. 1% is 1.667 msec for LAC
188  and 6.667 msec for GAC.
189  */
190 #ifndef PCT_MSEC_ERR
191 #define PCT_MSEC_ERR 1
192 #endif /* !PCT_MSEC_ERR */
193 #ifndef GAC_MSEC_ERR
194 #define GAC_MSEC_ERR 1
195 #endif /* !GAC_MSEC_ERR */
196 #ifndef LAC_MSEC_ERR
197 #define LAC_MSEC_ERR 1
198 #endif /* !LAC_MSEC_ERR */
199 /*
200  Maximum number of minorframe gap are the same(for now) for both GAC
201  and LAC. But they can be set to different number.
202  */
203 #define FFM_GAP_MAX 30
204 #define GAC_FFM_GAP_MAX FFM_GAP_MAX
205 #define LAC_FFM_GAP_MAX FFM_GAP_MAX
206 #define GAC_MSEC_GAP_MAX ((GAC_FFM_GAP_MAX) * (GAC_FFM_MSEC_INC))
207 #define LAC_MSEC_GAP_MAX ((LAC_FFM_GAP_MAX) * (LAC_FFM_MSEC_INC))
208 
209 #define REVERSE_MSEC_GAP 1.0
210 #ifndef ERR_UTIME
211 #define ERR_UTIME REVERSE_MSEC_GAP
212 #endif /* !ERR_UTIME */
213 
214 /*
215  this value is used to be filled into the 2 spare byte at the end of
216  each minorframe. OFFSET = SPR_OFF
217  Value 89(59h) has bit pattern of 01011001
218  */
219 #define FILL_FRAME_PAT 89
220 #define REAL_FRAME_PAT 0
221 
222 #define GOOD_FFM 0
223 #define FILL_FFM 1
224 
225 /*
226  define sub-item within each FFM block
227  */
228 
229 typedef struct ffmStruct {
231  short int TLM1[44];
232  short int TLM2[44];
233  short int TLM3[44];
234  short int TLM4[44];
235  short int TLM5[44];
236  char buf2[114];
237 } gacffmType;
238 #endif /* FFM_ */
short int TLM2[44]
Definition: ffm.h:232
byte hdr_byte[FFMHDRLEN]
Definition: ffm.h:174
#define GAC_TLM_OFF
Definition: ffm.h:111
char buf2[114]
Definition: ffm.h:236
#define FFMHDRLEN
Definition: ffm.h:143
short int TLM3[44]
Definition: ffm.h:233
#define FFMRECLEN
Definition: ffm.h:130
short int TLM5[44]
Definition: ffm.h:235
short int TLM4[44]
Definition: ffm.h:234
char buf1[GAC_TLM_OFF]
Definition: ffm.h:230
short int TLM1[44]
Definition: ffm.h:231
byte rec_byte[FFMRECLEN]
Definition: ffm.h:178
Definition: ffm.h:229