OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
output_daymode_data_to_scan.c
Go to the documentation of this file.
1 #include "L1A_prototype.h"
2 #include "hdfi.h"
3 #include "PH_pkt_hdr.h"
4 #include "SC_scan.h"
5 
6 
8  uint16 *pkt_contents,
9  SC_SCAN_DATA_t *L1A_scan)
10 
11 /*
12 !C************************************************************************
13 
14 !Description: This routine determines whether the packet is an Earth View or
15  Callibration type daymode packet and then calls the appropiate
16  routines to output the packet's data to the scan's structure.
17 
18 !Input Parameters:
19  PH_PACKET_HEADER_t *pkt_header ** Buffer that contains pkt **
20  ** header info of the pckt **
21 
22  uint16 *pkt_contents ** The structure containing **
23  ** the current packet's **
24  ** unpacked contents **
25 
26 !Output Parameters:
27  SC_SCAN_DATA_t *L1A_scan ** The MODIS scan structure **
28  ** currently being built **
29 
30 Return Values: NONE
31 
32 Externally Defined:
33  uint16 (hdfi.h)
34  PH_PACKET_HEADER_t (PH_pkt_hdr.h)
35  PH_MOD_SOURCE_ID_TYPE_FLAG_EARTH (PH_pkt_hdr.h)
36  PH_MOD_SOURCE_ID_TYPE_FLAG_CAL (PH_pkt_hdr.h)
37  PH_MOD_SOURCE_ID_CAL_TYPE_SOLAR_DIFFUSER_SOURCE (PH_pkt_hdr.h)
38  PH_MOD_SOURCE_ID_CAL_TYPE_SRCA_CAL_SOURCE (PH_pkt_hdr.h)
39  PH_MOD_SOURCE_ID_CAL_TYPE_BLACKBODY_SOURCE (PH_pkt_hdr.h)
40  PH_MOD_SOURCE_ID_CAL_TYPE_SPACE_SOURCE (PH_pkt_hdr.h)
41  SC_SCAN_DATA_t (SC_scan.h)
42 
43 Called By:
44  put_pkt_cont_in_scan
45 
46 Routines Called:
47  put_cal_data_in_scan
48  put_earth_data_in_scan
49 
50 !Revision History:
51  Revision 2.0 1997/09/09 11:33 EDT
52  Timi Adelekan/SAIC/GSC (adelekan@ltpmail.gsfc.nasa.gov)
53  Originated Code for version 2.
54 
55  Revision 1.1 1997/08/27 9:35
56  Tom Johnson (johnson@ltpmail.gsfc.nasa.gov)
57  Incorporate PDL walkthru comments
58 
59  Revision 1.0 1997/06/18 16:40 EDT
60  Timi Adelekan/SAIC/GSC (adelekan@ltpmail.gsfc.nasa.gov)
61  Baseline from Version 1.
62 
63 !Team-unique Header:
64  This software is developed by the MODIS Science
65  Data Support Team (SDST) for the National Aeronautics
66  and Space Administration (NASA), Goddard Space Flight
67  Center (GSFC), under contract NAS5-32373.
68 
69 !References and Credits:
70  None
71 
72 !Design Notes:
73  The CODE below was developed in C language.
74 
75  This routine was designed totally under the assumption that
76  the packet header has been previously validated and there
77  is no need to test for error conditions.
78 
79 !END*************************************************************************
80 */
81 
82  {
83  /**************************************************************************/
84  /* Figure out whether this packet is an Earth View packet or a */
85  /* Calibration packet, and then figure out which Cal Sector this packet */
86  /* is in. */
87  /* */
88  /**************************************************************************/
89  /* IF PH_PACKET_HEADER_t.source_ID_type_flag equals */
90  /* PH_MOD_SOURCE_ID_TYPE_FLAG_EARTH */
91  /* THEN */
92  /* CALL put_earth_data_in_scan to output the packet's Earth View */
93  /* Sector data to the scan structure */
94  /* INPUTS: PH_PACKET_HEADER_t, pkt_contents, SC_SCAN_DATA_t.EV_250m,*/
95  /* SC_SCAN_DATA_t.EV_500m, SC_SCAN_DATA_t.EV_1km_day, */
96  /* SC_SCAN_DATA_t.EV_1km_night */
97  /* OUTPUTS: SC_SCAN_DATA_t.EV_250m, SC_SCAN_DATA_t.EV_500m, */
98  /* SC_SCAN_DATA_t.EV_1km_day, SC_SCAN_DATA_t.EV_1km_night */
99  /* RETURN: NONE */
100  /* */
101  /**************************************************************************/
102 
104  put_earth_data_in_scan (pkt_header, pkt_contents,
105  L1A_scan->EV_250m,
106  L1A_scan->EV_500m,
107  L1A_scan->EV_1km_day,
108  L1A_scan->EV_1km_night);
109  }
110 
111  /**************************************************************************/
112  /* ELSE */
113  /* SWITCH (PH_PACKET_HEADER_t.cal_type) */
114  /* CASE PH_MOD_SOURCE_ID_CAL_TYPE_SOLAR_DIFFUSER_SOURCE */
115  /* CALL put_cal_data_in_scan to output the packet's Solar */
116  /* Diffuser Sector data to the scan structure */
117  /* INPUTS: PH_PACKET_HEADER_t, pkt_contents, */
118  /* SC_SCAN_DATA_t.SD_250m, SC_SCAN_DATA_t.SD_500m */
119  /* SC_SCAN_DATA_t.SD_1km_day, */
120  /* SC_SCAN_DATA_t.SD_1km_night */
121  /* OUTPUTS: SC_SCAN_DATA_t.SD_250m, SC_SCAN_DATA_t.SD_500m, */
122  /* SC_SCAN_DATA_t.SD_1km_day, */
123  /* SC_SCAN_DATA_t.SD_1km_night */
124  /* RETURN: NONE */
125  /* */
126  /**************************************************************************/
127 
128  else {
129  switch (pkt_header->cal_type) {
131  put_cal_data_in_scan (pkt_header, pkt_contents,
132  L1A_scan->SD_250m,
133  L1A_scan->SD_500m,
134  L1A_scan->SD_1km_day,
135  L1A_scan->SD_1km_night);
136 
137  break;
138 
139 
140  /**************************************************************************/
141  /* CASE PH_MOD_SOURCE_ID_CAL_TYPE_SRCA_CAL_SOURCE */
142  /* CALL put_cal_data_in_scan to output the packet's SRCA */
143  /* Sector data to the scan structure */
144  /* INPUTS: PH_PACKET_HEADER_t, pkt_contents, */
145  /* SC_SCAN_DATA_t.SRCA_250m, SC_SCAN_DATA_t.SRCA_500m */
146  /* SC_SCAN_DATA_t.SRCA_1km_day, */
147  /* SC_SCAN_DATA_t.SRCA_1km_night */
148  /* OUTPUTS: SC_SCAN_DATA_t.SRCA_250m, SC_SCAN_DATA_t.SRCA_500m,*/
149  /* SC_SCAN_DATA_t.SRCA_1km_day, */
150  /* SC_SCAN_DATA_t.SRCA_1km_night */
151  /* RETURN: NONE */
152  /* */
153  /**************************************************************************/
154 
156  put_cal_data_in_scan (pkt_header, pkt_contents,
157  L1A_scan->SRCA_250m,
158  L1A_scan->SRCA_500m,
159  L1A_scan->SRCA_1km_day,
160  L1A_scan->SRCA_1km_night);
161 
162  break;
163 
164 
165 
166  /**************************************************************************/
167  /* CASE PH_MOD_SOURCE_ID_CAL_TYPE_BLACKBODY_SOURCE */
168  /* CALL put_cal_data_in_scan to output the packet's BlackBody */
169  /* Sector data to the scan structure */
170  /* INPUTS: PH_PACKET_HEADER_t, pkt_contents, */
171  /* SC_SCAN_DATA_t.BB_250m, SC_SCAN_DATA_t.BB_500m, */
172  /* SC_SCAN_DATA_t.BB_1km_day, */
173  /* SC_SCAN_DATA_t.BB_1km_night */
174  /* OUTPUTS: SC_SCAN_DATA_t.BB_250m, SC_SCAN_DATA_t.BB_500m, */
175  /* SC_SCAN_DATA_t.BB_1km_day, */
176  /* SC_SCAN_DATA_t.BB_1km_night */
177  /* RETURN: NONE */
178  /* */
179  /**************************************************************************/
180 
182  put_cal_data_in_scan (pkt_header, pkt_contents,
183  L1A_scan->BB_250m,
184  L1A_scan->BB_500m,
185  L1A_scan->BB_1km_day,
186  L1A_scan->BB_1km_night);
187 
188  break;
189 
190 
191 
192  /**************************************************************************/
193  /* CASE PH_MOD_SOURCE_ID_CAL_TYPE_SPACE_SOURCE */
194  /* CALL put_cal_data_in_scan to output the packet's Space */
195  /* View Sector data to the scan structure */
196  /* INPUTS: PH_PACKET_HEADER_t, pkt_contents, */
197  /* SC_SCAN_DATA_t.SV_250m, SC_SCAN_DATA_t.SV_500m, */
198  /* SC_SCAN_DATA_t.SV_1km_day, */
199  /* SC_SCAN_DATA_t.SV_1km_night */
200  /* OUTPUTS: SC_SCAN_DATA_t.SV_250m, SC_SCAN_DATA_t.SV_500m, */
201  /* SC_SCAN_DATA_t.SV_1km_day, */
202  /* SC_SCAN_DATA_t.SV_1km_night */
203  /* RETURN: NONE */
204  /* END_SWITCH */
205  /* ENDIF */
206  /* */
207  /**************************************************************************/
208 
210  put_cal_data_in_scan (pkt_header, pkt_contents,
211  L1A_scan->SV_250m,
212  L1A_scan->SV_500m,
213  L1A_scan->SV_1km_day,
214  L1A_scan->SV_1km_night);
215 
216  break;
217 
218  } /* end_switch */
219  } /* endif */
220 
221  } /* End of routine output_daymode_data_to_scan */
SC_CAL_1KM_NIGHT SRCA_1km_night
Definition: SC_scan.h:216
SC_CAL_500M SRCA_500m
Definition: SC_scan.h:214
void put_earth_data_in_scan(PH_PACKET_HEADER_t *pkt_header, uint16 *pkt_cont, SC_EV_250M SC_250m, SC_EV_500M SC_500m, SC_EV_1KM_DAY SC_1km_day, SC_EV_1KM_NIGHT SC_1km_night)
SC_CAL_1KM_DAY SD_1km_day
Definition: SC_scan.h:209
#define PH_MOD_SOURCE_ID_CAL_TYPE_BLACKBODY_SOURCE
Definition: PH_pkt_hdr.h:202
SC_CAL_1KM_NIGHT SV_1km_night
Definition: SC_scan.h:228
#define PH_MOD_SOURCE_ID_CAL_TYPE_SOLAR_DIFFUSER_SOURCE
Definition: PH_pkt_hdr.h:200
SC_EV_500M EV_500m
Definition: SC_scan.h:232
#define PH_MOD_SOURCE_ID_CAL_TYPE_SPACE_SOURCE
Definition: PH_pkt_hdr.h:203
SC_CAL_1KM_NIGHT SD_1km_night
Definition: SC_scan.h:210
SC_EV_1KM_DAY EV_1km_day
Definition: SC_scan.h:233
#define PH_MOD_SOURCE_ID_TYPE_FLAG_EARTH
Definition: PH_pkt_hdr.h:188
void output_daymode_data_to_scan(PH_PACKET_HEADER_t *pkt_header, uint16 *pkt_contents, SC_SCAN_DATA_t *L1A_scan)
SC_CAL_1KM_NIGHT BB_1km_night
Definition: SC_scan.h:222
void put_cal_data_in_scan(PH_PACKET_HEADER_t *pkt_header, uint16 *pkt_cont, SC_CAL_250M SC_250m, SC_CAL_500M SC_500m, SC_CAL_1KM_DAY SC_1km_day, SC_CAL_1KM_NIGHT SC_1km_night)
SC_CAL_1KM_DAY BB_1km_day
Definition: SC_scan.h:221
SC_CAL_250M SD_250m
Definition: SC_scan.h:207
SC_CAL_250M SRCA_250m
Definition: SC_scan.h:213
#define PH_MOD_SOURCE_ID_CAL_TYPE_SRCA_CAL_SOURCE
Definition: PH_pkt_hdr.h:201
SC_CAL_1KM_DAY SV_1km_day
Definition: SC_scan.h:227
SC_CAL_500M SV_500m
Definition: SC_scan.h:226
SC_CAL_1KM_DAY SRCA_1km_day
Definition: SC_scan.h:215
SC_CAL_500M SD_500m
Definition: SC_scan.h:208
SC_CAL_500M BB_500m
Definition: SC_scan.h:220
SC_CAL_250M BB_250m
Definition: SC_scan.h:219
SC_EV_1KM_NIGHT EV_1km_night
Definition: SC_scan.h:234
SC_CAL_250M SV_250m
Definition: SC_scan.h:225
SC_EV_250M EV_250m
Definition: SC_scan.h:231