OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
compute_SD_start_time.c
Go to the documentation of this file.
1 #include "L1A_prototype.h"
2 #include "hdf.h"
3 #include "PH_pkt_hdr.h"
4 #include "PGS_TD.h"
5 
6 
8  PGSt_double *SD_start_time)
9 
10 /*
11 !C**********************************************************************
12 
13 !Description: This function will compute the SD start time for the input
14  packet.
15 
16 !Input Parameters:
17  PH_PACKET_HEADER_t pkt_header ** Packet header **
18 
19 !Output Parameters:
20  PGSt_double SD_start_time ** SD start time **
21 
22 Return Values:
23  None
24 
25 Externally Defined:
26  PH_SEC_PKT_TYPE_ENG1_GROUP (PH_pkt_hdr.h)
27  PH_SEC_PKT_TYPE_ENG2_GROUP (PH_pkt_hdr.h)
28  PH_MOD_SOURCE_ID_TYPE_FLAG_EARTH (PH_pkt_hdr.h)
29  PH_PACKET_HEADER_t (PH_pkt_hdr.h)
30  PGSt_double (PGS_TD.h)
31  global_time_offset_array (level1a)
32 
33 Called By:
34  load_eng_data
35  process_a_granule
36  process_a_scan
37 
38 Routines Called:
39  None
40 
41 !Revision History:
42  revision 1.0 1997/08/29 17:30:00
43  Qi Huang/RDC (qhuang@ltpmail.gsfc.nasa.gov)
44  Original development
45 
46 !Team-unique Header:
47  This software is developed by the MODIS Science
48  Data Support Team (SDST) for the National Aeronautics
49  and Space Administration (NASA), Goddard Space Flight
50  Center (GSFC), under contract NAS5-32373.
51 
52 !References and Credits:
53 
54 !Design Notes:
55 
56 !END***************************************************************************
57 */
58 {
59  /*****************************************************************************/
60  /* */
61  /* Declare Global Variables */
62  /* */
63  /*****************************************************************************/
64 
65  extern PGSt_double global_time_offset_array[5];
66  /* array containing the time */
67  /* offsets for each sector from */
68  /* the beginning of the scan */
69  /* (ie. SD sector) */
70 
71 
72  /*****************************************************************************/
73  /* */
74  /* Declare the local variables and initialize them. */
75  /* */
76  /*****************************************************************************/
77 
78  int8 index;
79 
80 
81  /*****************************************************************************/
82  /* */
83  /* IF (PH_PACKET_HEADER_t.pkt_type equals PH_SEC_PKT_TYPE_ENG1_GROUP or */
84  /* PH_SEC_PKT_TYPE_ENG2_GROUP) or (PH_PACKET_HEADER_t.source_ID_type_flag */
85  /* equals PH_MOD_SOURCE_ID_TYPE_FLAG_EARTH) */
86  /* THEN */
87  /* index = 4 */
88  /* ELSE */
89  /* index = PH_PACKET_HEADER_t.cal_type */
90  /* ENDIF */
91  /* */
92  /*****************************************************************************/
93 
94  if ((pkt_header->pkt_type == PH_SEC_PKT_TYPE_ENG1_GROUP) ||
95  (pkt_header->pkt_type == PH_SEC_PKT_TYPE_ENG2_GROUP) ||
97  index = 4;
98  else
99  index = pkt_header->cal_type;
100 
101 
102  /*****************************************************************************/
103  /* */
104  /* SD_start_time = PH_PACKET_HEADER_t.pkt_TAI_time - */
105  /* global_time_offset_array[index] */
106  /* */
107  /*****************************************************************************/
108 
109  *SD_start_time = pkt_header->pkt_TAI_time - global_time_offset_array[index];
110 
111  return;
112 }
an array had not been initialized Several spelling and grammar corrections were which is read from the appropriate MCF the above metadata values were hard coded A problem calculating the average background DN for SWIR bands when the moon is in the space view port was corrected The new algorithm used to calculate the average background DN for all reflective bands when the moon is in the space view port is now the same as the algorithm employed by the thermal bands For non SWIR changes in the averages are typically less than Also for non SWIR the black body DNs remain a backup in case the SV DNs are not available For SWIR the changes in computed averages were larger because the old which used the black body suffered from contamination by the micron leak As a consequence of the if SV DNs are not available for the SWIR the EV pixels will not be the granule time is used to identify the appropriate tables within the set given for one LUT the first two or last two tables respectively will be used for the interpolation If there is only one LUT in the set of it will be treated as a constant LUT The manner in which Earth View data is checked for saturation was changed Previously the raw Earth View DNs and Space View DNs were checked against the lookup table values contained in the table dn_sat The change made is to check the raw Earth and Space View DNs to be sure they are less than the maximum saturation value and to check the Space View subtracted Earth View dns against a set of values contained in the new lookup table dn_sat_ev The metadata configuration and ASSOCIATEDINSTRUMENTSHORTNAME from the MOD02HKM product The same metatdata with extensions and were removed from the MOD021KM and MOD02OBC products ASSOCIATEDSENSORSHORTNAME was set to MODIS in all products These changes are reflected in new File Specification which users may consult for exact the pow functions were eliminated in Emissive_Cal and Emissive bands replaced by more efficient code Other calculations throughout the code were also made more efficient Aside from a few round off there was no difference to the product The CPU time decreased by about for a day case and for a night case A minor bug in calculating the uncertainty index for emissive bands was corrected The frame index(0-based) was previously being used the frame number(1-based) should have been used. There were only a few minor changes to the uncertainty index(maximum of 1 digit). 3. Some inefficient arrays(Sigma_RVS_norm_sq) were eliminated and some code lines in Preprocess_L1A_Data were moved into Process_OBCEng_Emiss. There were no changes to the product. Required RAM was reduced by 20 MB. Now
void compute_SD_start_time(PH_PACKET_HEADER_t *pkt_header, PGSt_double *SD_start_time)
#define PH_SEC_PKT_TYPE_ENG2_GROUP
Definition: PH_pkt_hdr.h:164
#define PH_MOD_SOURCE_ID_TYPE_FLAG_EARTH
Definition: PH_pkt_hdr.h:188
PGSt_double pkt_TAI_time
Definition: PH_pkt_hdr.h:251
#define PH_SEC_PKT_TYPE_ENG1_GROUP
Definition: PH_pkt_hdr.h:163
PGSt_double global_time_offset_array[SECTOR_TIME_OFFSETS]
Definition: level1a.c:32