OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
put_pkt_cont_in_scan.c
Go to the documentation of this file.
1 #include "L1A_prototype.h"
2 #include "PGS_IO.h"
3 #include "PH_pkt_hdr.h"
4 #include "SC_scan.h"
5 
6 
8  PGSt_IO_L0_Packet *pkt,
9  uint16 *pkt_contents,
10  SC_SCAN_DATA_t *L1A_scan)
11 
12 /*
13 !C************************************************************************
14 
15 !Description: This routine will fill the appropriate part of the current scan
16  with the data from the current packet. Depending on what type
17  the current packet is, the routine will call the appropriate
18  output routine to output the packet data to the scan.
19 
20 !Input Parameters:
21  PGSt_IO_L0_Packet *pkt ** The structure containing **
22  ** the current packet's **
23  ** packed data **
24 
25  uint16 *pkt_contents ** The structure containing **
26  ** the current packet's **
27  ** unpacked contents **
28 
29  PH_PACKET_HEADER_t pkt_header ** Buffer that contains pkt **
30  ** header info of the pkt **
31 
32 !Output Parameters:
33  None
34 
35 !Input/Output Parameters:
36  SC_SCAN_DATA_t *L1A_scan ** The MODIS scan that is **
37  ** currently being built **
38 
39 Return Values:
40  None
41 
42 Externally Defined:
43  PGSt_IO_L0_Packet (PGS_IO.h)
44  SC_SCAN_DATA_t (SC_scan.h)
45  PH_PACKET_HEADER_t (PH_pkt_hdr.h)
46  PH_MOD_FPA_AEM_CONFIG_NUM_ELEMENTS (PH_pkt_hdr.h)
47  PH_SEC_PKT_TYPE_DAY_GROUP (PH_pkt_hdr.h)
48  PH_SEC_PKT_TYPE_NIGHT_GROUP (PH_pkt_hdr.h)
49  PH_SEC_PKT_TYPE_ENG1_GROUP (PH_pkt_hdr.h)
50  PH_SEC_PKT_TYPE_ENG2_GROUP (PH_pkt_hdr.h)
51 
52 Called By:
53  process_a_scan
54 
55 Routines Called:
56  output_daymode_data_to_scan
57  output_nightmode_data_to_scan
58  output_eng_data_to_scan
59 
60 !Revision History:
61  Revision 2.0 1997/09/09 10:40 EDT
62  Timi Adelekan/SAIC/GSC (adelekan@ltpmail.gsfc.nasa.gov)
63  Oringinated code for version 2.
64 
65  Revision 1.1 1997/08/27 9:30
66  Tom Johnson (johnson@ltpmail.gsfc.nasa.gov)
67  Incorporate PDL walkthru comments
68 
69  Revision 1.0 1997/06/18 16:40 EDT
70  Timi Adelekan/SAIC/GSC (adelekan@ltpmail.gsfc.nasa.gov)
71  Baseline from Version 1.
72 
73 !Team-unique Header:
74  This software is developed by the MODIS Science
75  Data Support Team (SDST) for the National Aeronautics
76  and Space Administration (NASA), Goddard Space Flight
77  Center (GSFC), under contract NAS5-32373.
78 
79 !References and Credits:
80  None
81 
82 !Design Notes:
83  The CODE below was developed in C language.
84 
85  This routine assumes that the data contained in the
86  input parameters have been validated before this
87  routine is executed. No validation of data is performed
88  in this routine.
89 
90 !END*************************************************************************
91 */
92 
93  {
94  /**************************************************************************/
95  /* */
96  /* Declare and Initialize Local Variables */
97  /* */
98  /**************************************************************************/
99 
100  int i;
101 
102 
103  /**************************************************************************/
104  /* */
105  /* Set SC_SCAN_DATA_t.science_state to PH_PACKET_HEADER_t.sci_state */
106  /* */
107  /* Set SC_SCAN_DATA_t.science_abnormal to PH_PACKET_HEADER_t.sci_abnorm */
108  /* */
109  /* Set all elements of SC_SCAN_DATA_t.fpa_aem_config to */
110  /* PH_PACKET_HEADER_t.fpa_aem_config */
111  /* */
112  /**************************************************************************/
113 
114  L1A_scan->science_state = pkt_header.sci_state;
115 
116  L1A_scan->science_abnormal = pkt_header.sci_abnorm;
117 
119  L1A_scan->fpa_aem_config[i] = pkt_header.fpa_aem_config[i];
120 
121 
122  /**************************************************************************/
123  /* */
124  /* Determine which group the current packet falls under and then call the */
125  /* appropriate routine to output the packet data to the scan structure. */
126  /* */
127  /**************************************************************************/
128  /* */
129  /* IF PH_PACKET_HEADER_t.pkt_type is equal to PH_SEC_PKT_TYPE_DAY_GROUP */
130  /* THEN */
131  /* CALL output_daymode_data_to_scan to output the packet data to the */
132  /* scan structure if the packet is a daymode packet */
133  /* INPUTS: PH_PACKET_HEADER_t, pkt_contents */
134  /* OUTPUTS: SC_SCAN_DATA_t */
135  /* RETURN: NONE */
136  /* ELSE */
137  /* IF PH_PACKET_HEADER_t.pkt_type is equal to */
138  /* PH_SEC_PKT_TYPE_NIGHT_GROUP */
139  /* THEN */
140  /* CALL output_nightmode_data_to_scan to output the packet data to */
141  /* the scan structure if the pkt is a nightmode packet */
142  /* INPUTS: PH_PACKET_HEADER_t, pkt_contents */
143  /* OUTPUTS: SC_SCAN_DATA_t.EV_1km_night */
144  /* RETURN: NONE */
145  /* ENDIF */
146  /* ELSE */
147  /* IF ( (PH_PACKET_HEADER_t.pkt_type is equal to */
148  /* PH_SEC_PKT_TYPE_ENG1_GROUP) OR */
149  /* (PH_PACKET_HEADER_t.pkt_type is equal to */
150  /* PH_SEC_PKT_TYPE_ENG2_GROUP) ) */
151  /* THEN */
152  /* CALL output_eng_data_to_scan to output the packet data to the */
153  /* scan structure if the packet is an engineering packet */
154  /* INPUTS: PH_PACKET_HEADER_t, pkt */
155  /* OUTPUTS: SC_SCAN_DATA_t */
156  /* RETURN: NONE */
157  /* ENDIF */
158  /* ENDIF */
159  /* */
160  /**************************************************************************/
161 
162  if (pkt_header.pkt_type == PH_SEC_PKT_TYPE_DAY_GROUP)
163  output_daymode_data_to_scan (&pkt_header, pkt_contents, L1A_scan);
164 
165  else if (pkt_header.pkt_type == PH_SEC_PKT_TYPE_NIGHT_GROUP)
166  output_nightmode_data_to_scan (&pkt_header,
167  pkt_contents,
168  L1A_scan->EV_1km_night);
169 
170  else if ((pkt_header.pkt_type == PH_SEC_PKT_TYPE_ENG1_GROUP) ||
171  (pkt_header.pkt_type == PH_SEC_PKT_TYPE_ENG2_GROUP))
172  output_eng_data_to_scan (&pkt_header, pkt, L1A_scan);
173 
174  } /* End of routine put_pkt_cont_in_scan */
int8 fpa_aem_config[PH_MOD_FPA_AEM_CONFIG_NUM_ELEMENTS]
Definition: SC_scan.h:238
int8 fpa_aem_config[PH_MOD_FPA_AEM_CONFIG_NUM_ELEMENTS]
Definition: PH_pkt_hdr.h:261
character(len=1000) if
Definition: names.f90:13
#define PH_SEC_PKT_TYPE_ENG2_GROUP
Definition: PH_pkt_hdr.h:164
void output_daymode_data_to_scan(PH_PACKET_HEADER_t *pkt_header, uint16 *pkt_contents, SC_SCAN_DATA_t *L1A_scan)
int8 science_abnormal
Definition: SC_scan.h:240
#define PH_SEC_PKT_TYPE_NIGHT_GROUP
Definition: PH_pkt_hdr.h:162
#define PH_SEC_PKT_TYPE_DAY_GROUP
Definition: PH_pkt_hdr.h:161
void put_pkt_cont_in_scan(PH_PACKET_HEADER_t pkt_header, PGSt_IO_L0_Packet *pkt, uint16 *pkt_contents, SC_SCAN_DATA_t *L1A_scan)
#define PH_SEC_PKT_TYPE_ENG1_GROUP
Definition: PH_pkt_hdr.h:163
void output_eng_data_to_scan(PH_PACKET_HEADER_t *pkt_header, PGSt_IO_L0_Packet *pkt, SC_SCAN_DATA_t *L1A_scan)
int8 science_state
Definition: SC_scan.h:239
void output_nightmode_data_to_scan(PH_PACKET_HEADER_t *pkt_header, uint16 *pkt_contents, SC_EV_1KM_NIGHT EV_1km_night)
#define PH_MOD_FPA_AEM_CONFIG_NUM_ELEMENTS
Definition: PH_pkt_hdr.h:221
SC_EV_1KM_NIGHT EV_1km_night
Definition: SC_scan.h:234
int i
Definition: decode_rs.h:71