OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
get_index.c
Go to the documentation of this file.
1 #include "L1A_prototype.h"
2 #include "hdf.h"
3 #include "hdfi.h"
4 #include "VU_vdata_utility.h"
5 
6 int16 get_index (char *Vdata_name)
7 
8 /*
9 !C************************************************************************
10 
11 !Description: This function retrieves the Vdata_id_table index for Vdata_name.
12 
13 !Input Parameters:
14  char *Vdata_name ** The name of the Vdata for **
15  ** which to get the associated **
16  ** Vdata_id_table index **
17 !Output Parameters:
18  None
19 
20 Return Values:
21  FAIL (hdf.h)
22  index ** if found in Vdata_id_table **
23 
24 Externally Defined:
25  int16 (hdfi.h)
26  VU_MAX_NUMBER_OF_VDATAS (VU_vdata_utility.h)
27  global_VU_VDATA_ID (level1a)
28 
29 Called By:
30  forget
31 
32 Routines Called:
33  equal_strings
34 
35 !Revision History:
36  Revision 2.0 1997/10/02 12:55 EDT
37  Timi Adelekan/SAIC/GSC (adelekan@ltpmail.gsfc.nasa.gov)
38  Originated Code.
39 
40  Revision 1.1 1997/09/03 10:55
41  Tom Johnson/GSC (johnson@ltpmail.gsfc.nasa.gov)
42  Incorporate walkthrough comments
43 
44  Revision 1.0 1997/07/14 15:58 EDT
45  David Catozzi/SAIC/GSC (cato@ltpmail.gsfc.nasa.gov)
46  Originated code development.
47 
48 !Team-unique Header:
49  This software is developed by the MODIS Science
50  Data Support Team (SDST) for the National Aeronautics
51  and Space Administration (NASA), Goddard Space Flight
52  Center (GSFC), under contract NAS5-32373.
53 
54 !References and Credits:
55  None
56 
57 !Design Notes:
58  This is a private function - only to be used by functions
59  internal to the Vdata_id_table.
60 
61 !END************************************************************************
62 */
63 
64  {
65  /**************************************************************************/
66  /* */
67  /* Declare the global variables. */
68  /* */
69  /**************************************************************************/
70 
71  extern VU_ID_TABLE global_VU_VDATA_ID[VU_MAX_NUMBER_OF_VDATAS];
72 
73 
74  /**************************************************************************/
75  /* */
76  /* Declare the local variables and initialize them. */
77  /* */
78  /**************************************************************************/
79  /* */
80  /* set index to 0 */
81  /* set Found to FALSE */
82  /* */
83  /**************************************************************************/
84 
85  int16 index;
86  int16 Found;
87  int16 result;
88 
89 
90  index = 0;
91  Found = FALSE;
92 
93 
94  /**************************************************************************/
95  /* */
96  /* DO-WHILE (index is less than or equal to 0 to */
97  /* VU_MAX_NUMBER_OF_VDATAS-1) AND (Found is equal to FALSE) */
98  /* CALL equal_strings to test string equality */
99  /* INPUTS: global_VU_VDATA_ID[index].name, Vdata_name */
100  /* OUTPUTS: None */
101  /* RETURN: result */
102  /* */
103  /* IF (result is equal to TRUE) */
104  /* THEN */
105  /* set Found to TRUE */
106  /* ELSE */
107  /* increment index */
108  /* ENDIF */
109  /* */
110  /* END_DO */
111  /* */
112  /**************************************************************************/
113 
114  while (( index < VU_MAX_NUMBER_OF_VDATAS) && (Found == FALSE)) {
116 
117  if (result == TRUE)
118  Found = TRUE;
119  else
120  index++;
121  }
122 
123 
124 
125  /**************************************************************************/
126  /* */
127  /* IF (Found is equal to FALSE) */
128  /* THEN */
129  /* set index to FAIL */
130  /* ENDIF */
131  /* */
132  /* RETURN index */
133  /* */
134  /**************************************************************************/
135 
136  if (Found == FALSE)
137  index = FAIL;
138 
139  return index;
140 
141  } /* End of routine get_index */
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
integer, parameter int16
Definition: cubeio.f90:3
#define VU_MAX_NUMBER_OF_VDATAS
int16 equal_strings(char *a, char *b)
Definition: equal_strings.c:6
#define FAIL
Definition: ObpgReadGrid.h:18
#define FALSE
Definition: rice.h:164
#define TRUE
Definition: rice.h:165
VU_ID_TABLE global_VU_VDATA_ID[VU_MAX_NUMBER_OF_VDATAS]
Definition: level1a.c:36
int16 get_index(char *Vdata_name)
Definition: get_index.c:6