OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
create_missing_scans.c
Go to the documentation of this file.
1 #include "L1A_prototype.h"
2 #include "hdf.h"
3 #include "PGS_TD.h"
4 #include "MD_metadata.h"
5 #include "SC_scan.h"
6 
7 
8 void create_missing_scans (int16 prev_scan_num,
9  PGSt_double scan_rate,
10  PGSt_double *SD_start_time,
11  MD_SCAN_MET_t *scan_metadata,
12  SC_PIXEL_QUALITY_DATA_t *pixel_qual_data)
13 
14 /*
15 !C**********************************************************************
16 
17 !Description: This function defaults the scan metadata to create a missing
18  scan. Only the scan metadata will be defaulted as the rest
19  of the scan is already set with fill values.
20 
21 !Input Parameters:
22  int16 prev_scan_num ** previous scan number **
23  PGSt_double scan_rate ** scan rate **
24 
25 !Output Parameters:
26  MD_SCAN_MET_t scan_metadata ** Defaulted scan metadata **
27 
28 !Input/Output Parameters:
29  PGSt_double SD_start_time ** SD start time **
30 
31 Return Values:
32  None
33 
34 Externally Defined:
35  MD_SCAN_META_t (MD_metadata.h)
36  PGSt_double (PGS_TD.h)
37 
38 Called By:
39  handle_missing_scans
40 
41 Routines Called:
42  initialize_scan_metadata
43 
44 !Revision History:
45  Revision 1.0 1997/08/28 17:30
46  Qi Huang/RDC (qhuang@ltpmail.gsfc.nasa.gov)
47  Original development
48 
49 !Team-unique Header:
50  This software is developed by the MODIS Science
51  Data Support Team (SDST) for the National Aeronautics
52  and Space Administration (NASA), Goddard Space Flight
53  Center (GSFC), under contract NAS5-32373.
54 
55 !References and Credits:
56  None
57 
58 !Design Notes:
59  None
60 
61 !END***************************************************************************
62 */
63 {
64  /******************************************************************************/
65  /* Declare Global Variables */
66  /******************************************************************************/
67 
68  extern PGSt_double global_time_offset_array[5];
69  /* array containing the time */
70  /* offsets for each sector from */
71  /* the beginning of the scan */
72  /* (ie. SD sector) */
73 
74 
75  /******************************************************************************/
76  /* */
77  /* CALL initialize_scan_metadata to initialize the scan metadata */
78  /* INPUT: None */
79  /* OUTPUT: MD_SCAN_META_t */
80  /* RETURN: None */
81  /* */
82  /******************************************************************************/
83 
84  initialize_scan_metadata(scan_metadata);
85 
86 
87  /******************************************************************************/
88  /* */
89  /* Set MD_SCAN_META_t.scan_num to prev_scan_num + 1 */
90  /* */
91  /* Set SD_start_time to SD_start_time + scan_rate */
92  /* */
93  /* Set MD_SCAN_META_t.sd_start_time to SD_start_time */
94  /* Set MD_SCAN_META_t.srca_start_time to SD_start_time + */
95  /* global_time_offset_array[1] */
96  /* Set MD_SCAN_META_t.bb_start_time to SD_start_time + */
97  /* global_time_offset_array[2] */
98  /* Set MD_SCAN_META_t.sv_start_time to SD_start_time + */
99  /* global_time_offset_array[3] */
100  /* Set MD_SCAN_META_t.ev_start_time to SD_start_time + */
101  /* global_time_offset_array[4] */
102  /* */
103  /******************************************************************************/
104 
105  scan_metadata->scan_num = prev_scan_num + 1;
106 
107  *SD_start_time = *SD_start_time + scan_rate;
108 
109  scan_metadata->sd_start_time = *SD_start_time;
110  scan_metadata->srca_start_time = *SD_start_time + global_time_offset_array[1];
111  scan_metadata->bb_start_time = *SD_start_time + global_time_offset_array[2];
112  scan_metadata->sv_start_time = *SD_start_time + global_time_offset_array[3];
113  scan_metadata->ev_start_time = *SD_start_time + global_time_offset_array[4];
114 
115 
116  /******************************************************************************/
117  /* */
118  /* CALL initialize_pixel_qual_data to initialize the pixel quality data */
119  /* INPUT: None */
120  /* OUTPUT: SC_PIXEL_QUALITY_DATA_t */
121  /* RETURN: None */
122  /* */
123  /******************************************************************************/
124 
125  initialize_pixel_qual_data(pixel_qual_data);
126 
127 
128  /******************************************************************************/
129  /* */
130  /* CALL finalize_pixel_qual_data to finalize the pixel quality data */
131  /* INPUT: MD_SCAN_META_t, SC_PIXEL_QUALITY_DATA_t */
132  /* OUTPUT: SC_PIXEL_QUALITY_DATA_t */
133  /* RETURN: None */
134  /* */
135  /******************************************************************************/
136 
137  finalize_pixel_qual_data(pixel_qual_data, scan_metadata);
138 
139 
140  return;
141 }
integer, parameter int16
Definition: cubeio.f90:3
void create_missing_scans(int16 prev_scan_num, PGSt_double scan_rate, PGSt_double *SD_start_time, MD_SCAN_MET_t *scan_metadata, SC_PIXEL_QUALITY_DATA_t *pixel_qual_data)
void finalize_pixel_qual_data(SC_PIXEL_QUALITY_DATA_t *scan_pixel, MD_SCAN_MET_t *scan_meta)
float64 bb_start_time
Definition: MD_metadata.h:223
float64 sv_start_time
Definition: MD_metadata.h:224
void initialize_pixel_qual_data(SC_PIXEL_QUALITY_DATA_t *scan_pixel)
void initialize_scan_metadata(MD_SCAN_MET_t *scan_meta)
float64 ev_start_time
Definition: MD_metadata.h:225
float64 sd_start_time
Definition: MD_metadata.h:221
PGSt_double global_time_offset_array[SECTOR_TIME_OFFSETS]
Definition: level1a.c:32
float64 srca_start_time
Definition: MD_metadata.h:222