OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
initialize_scan_metadata.c
Go to the documentation of this file.
1 #include "L1A_prototype.h"
2 #include "SC_scan.h"
3 #include "MD_metadata.h"
4 
6 
7 /****************************************************************************
8 !C
9 
10 !Description: This function fills the scan level metadata data structures
11  with the appropriate data.
12 
13 !Input Parameters: None
14 
15 !Output Parameters:
16  MD_SCAN_MET_t *scan_meta ** Scan level metadata structure **
17 
18 Return Values: None
19 
20 Externally Defined:
21  MD_BAD_CHECKSUM_PACKET (MD_metadata.h)
22  MD_DISCARDED_PACKET (MD_metadata.h)
23  MD_MAX_MISSING_PKTS_IN_SCAN (MD_metadata.h)
24  MD_MISSING_PACKET (MD_metadata.h)
25  MD_NO_VALID_DATA_IN_SCAN (MD_metadata.h)
26  MD_OTHER_STRING (MD_metadata.h)
27  MD_SCAN_DATA_PRESENCE (MD_metadata.h)
28  MD_SCAN_MET_t (MD_metadata.h)
29  SC_FILL_VALUE (SC_scan.h)
30  TIME_FILL_VALUE (SC_scan.h)
31 
32 Called By:
33  initialize_scan
34  create_missing_scans
35 
36 Routines Called: None
37 
38 !Revision History:
39  $Log: initialize_scan_metadata.c,v $
40  Revision 5.1 2004/09/23 18:53:23 seaton
41  Modified fill value of time SDSs to be -2E9.
42  seaton@saicmodis.com
43 
44  Revision 4.2 2003/04/30 19:18:54 vlin
45  corrected the size for function strncpy.
46 
47  Revision 4.1 2003/03/07 20:52:41 vlin
48  Updated after code walkthrough
49 
50  Revision 4.0 2002/12/02 20:55:53 vlin
51  Called memcmp before calling memset
52  vlin@saicmodis.com
53 
54  Revision 2.1 1997/09/08 19:49
55  Timi Adelekan/SAIC/GSC (adelekan@ltpmail.gsfc.nasa.gov)
56  initial revision
57 
58 !Team-unique Header:
59 
60  This software is developed by the MODIS Science Data Support Team
61  for the National Aeronautics and Space Administration,
62  Goddard Space Flight Center, under contract NAS5-32373.
63 
64 References and Credits: None
65 
66 Design Notes:
67  The CODE below was developed in C language.
68 
69 !END
70 **************************************************************************/
71 
72 {
73  int i;
74 
75  scan_meta->scan_num = 0;
76  strncpy(scan_meta->scan_type, MD_OTHER_STRING, sizeof(scan_meta->scan_type));
77  scan_meta->sd_start_time = TIME_FILL_VALUE;
78  scan_meta->srca_start_time = TIME_FILL_VALUE;
79  scan_meta->bb_start_time = TIME_FILL_VALUE;
80  scan_meta->sv_start_time = TIME_FILL_VALUE;
81  scan_meta->ev_start_time = TIME_FILL_VALUE;
82  scan_meta->srca_cal_mode = SC_FILL_VALUE;
83  scan_meta->packet_scan_count = SC_FILL_VALUE;
85  scan_meta->mirror_side = SC_FILL_VALUE;
89  scan_meta->scan_qual_array[MD_DISCARDED_PACKET] = 0;
90 
91  scan_meta->ccsds_apids[0] = SC_FILL_VALUE;
92  memset(scan_meta->ccsds_apids+1, SC_FILL_VALUE, sizeof(scan_meta->ccsds_apids[0]));
93 
94  if (memcmp(scan_meta->ccsds_apids, scan_meta->ccsds_apids+1,
95  sizeof(scan_meta->ccsds_apids[0]))) { /* memset didn't work. */
96  for (i=1; i<3; i++)
97  scan_meta->ccsds_apids[i] = SC_FILL_VALUE;
98  for (i=0; i<6; i++)
99  scan_meta->frame_count_array[i] = 0;
100  }
101  else {
102  memset(scan_meta->frame_count_array, 0, sizeof(scan_meta->frame_count_array));
103  memset(scan_meta->ccsds_apids+2, SC_FILL_VALUE,
104  sizeof(scan_meta->ccsds_apids)-2*sizeof(scan_meta->ccsds_apids[0]));
105  }
106 }
int16 srca_cal_mode
Definition: MD_metadata.h:226
int16 packet_expedited_data_flag
Definition: MD_metadata.h:229
#define MD_SCAN_DATA_PRESENCE
Definition: MD_metadata.h:146
float64 bb_start_time
Definition: MD_metadata.h:223
#define MD_MISSING_PACKET
Definition: MD_metadata.h:147
#define MD_OTHER_STRING
Definition: MD_metadata.h:95
#define MD_MAX_MISSING_PKTS_IN_SCAN
Definition: MD_metadata.h:126
int16 mirror_side
Definition: MD_metadata.h:230
#define MD_BAD_CHECKSUM_PACKET
Definition: MD_metadata.h:148
float64 sv_start_time
Definition: MD_metadata.h:224
void initialize_scan_metadata(MD_SCAN_MET_t *scan_meta)
#define SC_FILL_VALUE
Definition: SC_scan.h:141
int32 scan_qual_array[4]
Definition: MD_metadata.h:231
float64 ev_start_time
Definition: MD_metadata.h:225
int16 frame_count_array[6]
Definition: MD_metadata.h:219
#define MD_NO_VALID_DATA_IN_SCAN
Definition: MD_metadata.h:127
#define TIME_FILL_VALUE
Definition: SC_scan.h:142
float64 sd_start_time
Definition: MD_metadata.h:221
#define MD_DISCARDED_PACKET
Definition: MD_metadata.h:149
PARAM_TYPE_NONE Default value No parameter is buried in the product name name_prefix is case insensitive string compared to the product name PARAM_TYPE_VIS_WAVE The visible wavelength bands from the sensor are buried in the product name The product name is compared by appending and name_suffix ie aph_412_giop where prod_ix will be set to PARAM_TYPE_IR_WAVE same search method as PARAM_TYPE_VIS_WAVE except only wavelength above are looped through but prod_ix is still based ie aph_2_giop for the second and prod_ix set to PARAM_TYPE_INT name_prefix is compared with the beginning of the product name If name_suffix is not empty the it must match the end of the product name The characters right after the prefix are read as an integer and prod_ix is set to that number strncpy(l2prod->name_prefix, "myprod", UNITLEN)
float64 srca_start_time
Definition: MD_metadata.h:222
for(i=0;i< NROOTS;i++) s[i]
Definition: decode_rs.h:85
int i
Definition: decode_rs.h:71
int16 ccsds_apids[3]
Definition: MD_metadata.h:228
int16 packet_scan_count
Definition: MD_metadata.h:227
char scan_type[10]
Definition: MD_metadata.h:220