OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
GEO_terrain_correct.c
Go to the documentation of this file.
1 #include "PGS_CSC.h"
2 #include "PGS_MODIS_35251.h"
3 #include "GEO_global_arrays.h"
4 #include "GEO_earth.h"
5 #include "GEO_util.h"
6 #include "smfio.h"
7 
8 PGSt_SMF_status GEO_terrain_correct(
9  int const sample_number,
10  int const num_detectors,
11  double sample_view_vec[][MAX_PADDED][3],
12  double ecr_sample_position[][MAX_PADDED][3],
13  double ellip_sample_position[][MAX_PADDED][3],
14  unsigned char sample_flags[][MAX_PADDED],
15  double terrain_sample_position[][MAX_PADDED][3]
16  )
17 /*
18 !C******************************************************************************
19 !Description:
20  subroutine in Earth Location Group of the Level-1A geolocation
21  software to perform terrain correction. The algorithm
22  establishes a regular set of points along the line
23  of sight from the spacecraft to the ellipsoid position
24  of each pixel. The geographic heights are interpolated
25  from the DEM data to identify fhe line segment in which
26  terrain pierce occurs. A further (linear) interpolation
27  is then performed using the DEM data points bounding pierce
28  to estimate the position and height of the pixel.
29 
30 !Input Parameters:
31  int sample_number - the sample number
32  int num_detectors - the number of detectors
33  sample_view_vec - ECR sample view vec
34  ecr_sample_position - ECR sample position to the ellipsoid
35  ellip_sample_position - ellip sample position
36  sample_flags - geolocation pixel data status bits
37 
38 !Output Parameters:
39  terrain_sample_position - terrain corrected sample position
40 
41 Return values:
42  MODIS_E_BAD_INPUT_ARG If any argument is invalid
43  MODIS_E_GEO If any subroutine failed.
44  PGS_S_SUCCESS Otherwise
45 
46 Externally Defined:
47  BAD_TERRAIN "GEO_geo.h"
48  DETECTORS_QKM "GEO_geo.h"
49  EARTH_MODEL "GEO_earth.h"
50  HT_IDX "GEO_global_arrays.h"
51  LAT_IDX "GEO_global_arrays.h"
52  LON_IDX "GEO_global_arrays.h"
53  MODIS_E_BAD_INPUT_ARG "PGS_MODIS_35251.h"
54  MODIS_E_GEO "PGS_MODIS_35251.h"
55  MODIS_E_UTIL_VEC "PGS_MODIS_35251.h"
56  NEAR_LIMB "GEO_geo.h"
57  NO_ELLIPSE_INTERSECT "GEO_geo.h"
58  MAX_PADDED "GEO_geo.h"
59  PGS_S_SUCCESS "PGS_SMF.h"
60  PGSd_PC_LINE_LENGTH_MAX "PGS_PC.h"
61  SUCCESS "GEO_basic.h"
62  TERRAIN_CORRECT "GEO_geo.h"
63  TERRAIN_CORRECT_LUN "GEO_geo.h"
64 
65 Call functions:
66  GEO_read_DEM - read in tile containing specified location
67  GEO_latlon2height - read DEM get height from lat lon
68  PGS_CSC_dotProduct - compute dot product of two vectors
69  PGS_CSC_Norm - perform vector normalization
70  PGS_PC_GetConfigData - Get parameter from PCF
71  PGS_CSC_ECRtoGEO - Convert ECR coordinates to geodetic ones.
72  modsmf - writes error status messages to log
73 
74 Called by: GEO_earth_location
75 
76 !Requirements:
77  PR03-F-3.3.1-1
78 
79 
80 !Revision History:
81  * $Log: GEO_terrain_correct.c,v $
82  * Revision 6.6 2010/12/14 22:02:06 kuyper
83  * Changed to perform all calculations using the height above the ellipsoid.
84  *
85  * Revision 6.5 2010/06/24 21:36:49 kuyper
86  * Corrected geoid height adjustment to match PDL.
87  *
88  * Revision 6.4 2010/03/31 19:41:44 kuyper
89  * Resolved Bug 2937 by always subtracting the geoid_height, regardless of
90  * how close the terrain-corrected position comes to the ellipsoid.
91  *
92  * James Kuyper james.kuyper@sigmaspace.com
93  *
94  * Revision 6.3 2009/09/15 16:34:34 kuyper
95  * Corrected calculation of cos_view.
96  * Corrected handling of geoid_height for locations near the ellipsoid.
97  *
98  * James Kuyper James.R.Kuyper@nasa.gov
99  *
100  * Revision 6.2 2009/05/29 13:34:00 xgeng
101  * Corrected a typo and an error message.
102  *
103  * Revision 6.1 2009/05/18 17:21:52 xgeng
104  * Changed return type to PGSt_SMF_status.
105  * Renamed pixel_flags to sample_flags.
106  * Changed sample_view_vec, ecr_sample_position, ellip_sample_position, and
107  * pixel_flags->sample_flags into input pointer parameters.
108  * Changed terrain_sample_position to an output pointer parameter.
109  * Changed MAX_SCAN_SAMPLE to MAX_PADDED, and MAX_DETECTORS to
110  * DETECTORS_QKM.
111  * Added validation for new pointer parameters.
112  * Replaced calls to GEO_vec* functions with calls to PGS_CSC_dotProduct() and PGS_CSC_Norm().
113  * Cleaned up error messaging.
114  * The above changes match with PDL revision 6.1 to 6.3.
115  *
116  *
117  * Xu Geng (xu.geng@saic.com)
118  *
119  * Revision 4.1 2003/02/21 22:13:15 kuyper
120  * Corrected to ensure 'D' is initialized before use.
121  *
122  * Revision 3.1 2001/11/30 17:31:34 kuyper
123  * Corrected comments to match code.
124  *
125  * Revision 2.10 1999/03/01 20:28:14 kuyper
126  * Changed to protect against overly large step sizes, including division by 0.
127  *
128  * Revision 2.9 1999/02/16 17:57:56 lma
129  * Additional modification during unit testing.
130  * Changed calculation of num_steps.
131  * removed "if(num_steps>2)" branches
132  * corrected initialization of h_prime and
133  * corrected calculation of D during interpolation
134  *
135  * Revision 2.8 1999/02/08 19:12:26 kuyper
136  * Changed implicit type conversions to explicit ones.
137  *
138  * Revision 2.7 1999/02/02 16:17:50 lma
139  * Corrected descriptions of hgtmin, hgtmax.
140  * Inserted correction for cos_view>1.0, from code.
141  * Corrected calculation of delta_D in the 2-step case.
142  * Changed design to avoid excess work in the case where hgtmin is close to
143  * hgtmax.
144  * Corrected application of geoid_height to final output.
145  *
146  * Revision 2.6 1998/03/04 00:14:11 jjb
147  * CCR-391: Replaced IMSL matrix routine with GEO_location routine.
148  * Made search_grid a static constant.
149  * Added 'called by' line.
150  * Added setting of BAD_TERRAIN flag
151  * when no terrain correction selected.
152  * Modified awkward phrase in 'Description'.
153  * Removed reference to obsolete 'scan_number' parameter.
154  *
155  * Revision 2.5 1997/11/03 17:09:47 jjb@ltpmail.gsfc.nasa.gov
156  * Removed possibility of delta_D = 0 causing an infinite loop.
157  *
158  * Revision 2.4 1997/10/30 20:14:28 jjb@ltpmail.gsfc.nasa.gov
159  * Corrected (infinite) loop condition to handle all-ocean DEM tiles.
160  *
161  * Revision 2.3 1997/10/24 13:21:57 kuyper@ltpmail.gsfc.nasa.gov
162  * Included header file which declares terrain_sample_position[][].
163  * Initialized DEMflag to NO_DEM_DATA.
164  *
165  * Revision 2.2 1997/10/23 19:22:35 ding@ltpmail.gsfc.nasa.gov
166  * Moved pixel_flags check up to right below the for loop.
167  *
168  * Revision 2.1 1997/10/21 18:16:22 kuyper
169  * Returned from ClearCase
170  *
171  * Revision /main/GEO_V2_DEV/2 1997/10/03 kuyper
172  * Updated call to GEO_read_DEM().
173  *
174  * Revision 1.9.1.1 1997/07/21 22:20:17 kuyper
175  * Merged in out-of-sequence changes.
176  *
177  * Revision 1.9 1997/07/21 16:24:34 kuyper
178  * Baselined Version 1
179  *
180  *Parallel development:
181  * Revision 1.12 1997/04/21 22:37:32 fhliang
182  * commented unused argument (LL.19-21).
183  *
184  * Revision 1.11 1997/04/15 19:44:51 fhliang
185  * fixed prolog: 'Description' --> '!Description';
186  * commented one 'printf' statement (LL.369-372).
187  *
188  * Revision 1.10 1997/04/10 19:36:13 fhliang
189  * Initial revision of SDST re-delivery of GEO_terrain_correct.c.
190  *
191  * Revision 1.9 1997/04/09 19:37:11 kuyper
192  * Corrected ==FAIL to !=SUCCESS, three places.
193  * Simplified detection of single pass through loop.
194  * #defined HGT_TOL, used consistently.
195  *
196  * Revision 1.8 1997/03/26 18:14:47 fhliang
197  * Initial revision of SDST delivery of GEO_terrain_correct.c.
198  *
199  Revision 1.7 1997/03/11 18:02:14 kuyper
200  Allowed for some roundoff error in loop
201  termination conditions.
202 
203  Revision 1.6 1997/02/04 20:57:35 kuyper
204  Corrected, modified loop termination condition.
205 
206  Revision 1.5 1996/11/15 23:47:16 kuyper
207  Corrected return value when TERRAIN_CORRECT_LUN not found.
208  Changed earthEllipsTag to EARTH_MODEL
209  Corrected handling of pixel_flags.
210  Corrected cos_view error message.
211  Enforced cos_view <= 1.0
212  Removed redundant copy through x[i]
213 
214  Revision 1.4 1996/11/06 16:02:24 kuyper
215  Use PGS_CSC_ECRtoGEO() rather than GEO_ecr2latlon().
216  Use imsl_d_mat_mul_rect() rather than GEO_vec_prod3()
217  Get terrain_correct from LUN parameter, not parameter file.
218  Always initialize terrain_sample_position with copy of ellip_sample_position
219  Validate input arguments.
220  Implement minimum_height, MIN_COS_VIEW checks
221  Always iterate main loop at least once.
222  Rearrange delta_D check to avoid division by 0 problems.
223  Added detector number to log status messages.
224  Set BAD_TERRAIN if GEO_vec_unit3() fails.
225  Moved SMF messages to 35256 seed file.
226  Updated function call list.
227  Name Changes: idet=>detector_index, nu=>cos_view, *_final=>previous_*
228  Added LAT_IDX, LON_IDX, HT_IDX macros.
229  Fixed typos in prologue.
230 
231  Revision 1.3 1996/07/24 21:37:10 kuyper
232  Standardized order of #include files.
233  Declared arguments const.
234  Inserted required '!'s in comments.
235  Converted constants to double, to skip implied conversion.
236  Removed ret_val.
237  Made implicit casts explicit.
238 
239  Revision 1.2 1996/07/18 21:08:08 kuyper
240  Included self-checking header file.
241  Converted terrain_sample_position from extern declaration to definition.
242  Corrected call to GEO_vec_unit3, and comment about GEO_ecr2latlon.
243  Added needed header files.
244 
245  10/10/95
246  Tracey W. Holmes
247  Added debug option.
248 
249  9/29/95
250  Frederick S. Patt
251  Corrected calculation of unit_n; saved hgtmin, hgtmax and
252  DEMflag as static variables; corrected bug in use of
253  h_prime and h_final_prime
254 
255  9/28/95
256  Frederick S. Patt
257  Correction to unit_n index.
258 
259  8/2/95
260  Tracey W. Holmes (holmes@modis-xl.gsfc.nasa.gov)
261  Changed extern correct_terrain from type double to int.
262 
263  7/3/95
264  Tracey W. Holmes (holmes@modis-xl.gsfc.nasa.gov)
265  Added SDP error messages.
266 
267  4/25/95
268  Ruiming Chen (rchen@ltpmail.gsfc.nasa.gov)
269  Finished coding.
270 
271 !Team-unique Header:
272  This software is developed by the MODIS Science Data Support
273  Team for the National Aeronautics and Space Administration,
274  Goddard Space Flight Center, under contract NAS5-32373.
275 
276 !END*************************************************************************
277 */
278 {
279 
280 #define MIN_COS_VIEW 0.087155743
281 /* Minimum cosine of the LOS wrt ellipsoid normal. = cos(85.0*PGS_PI/180.0)*/
282 
283 /*******************************************************
284 declare local variables
285 *******************************************************/
286 
287  double search_grid = 500.0; /* terrain search grid*/
288  double step_factor = 2.0; /*Maximum ratio of step size to tile thickness.*/
289  double unit_n[3]; /* local ellipsoid normal unit vec */
290  PGSt_double u[3]; /* ECR vector from the round point to the inst. */
291  double range; /* magnitude of 'u' */
292  PGSt_double unit_u[3]; /* unit u */
293  double cos_view; /* Local vertical component of satellite view vector */
294  double sin_view; /* sin of the viewing angle */
295  double D; /* distance along satellite vec to achieve a height h */
296  double D0; /* the starting value of D in the intersection loop */
297  double D_max; /* maximum D */
298  double D_min; /* minimum D */
299  double delta_D; /* increment of D */
300  int step; /* the index in the intersection loop */
301  int num_steps; /* the number of steps to be executed in the intersection loop */
302  PGSt_double x[3]; /* ECR position of one iteration */
303  double height; /* DEM height */
304  double previous_height; /* Previous value of height. */
305  PGSt_double h_prime; /* height on the search line */
306  double previous_h_prime = 0.0;/* Previous value of h_prime */
307  PGSt_double latitude; /* Geodetic location of sample point on LOS */
308  PGSt_double longitude;
309  double interpolation_weight = 0.0; /* weight */
310  double minimum_height = 1.0; /* minimum along view vector terrain deviation*/
311  static int hgtmin = 0; /* minimum height for tile */
312  static int hgtmax = 0; /* maximum height for tile */
313  int det = 0; /* detector index */
314  int i = 0; /* iteration parameter */
315  static char correct_terrain[PGSd_PC_LINE_LENGTH_MAX]="";
316  char msgbuf[PGS_SMF_MAX_MSGBUF_SIZE]; /* To store 2nd argument to modsmf calls. */
317  char filefunc[] = __FILE__ ", GEO_terrain_correct";
318 
319 
320 /********************************************************
321 calculation from here
322 ********************************************************/
323 
324  /* Validate arguments */
325  if( sample_number<0 || sample_number>=MAX_PADDED ||
326  num_detectors<0 || num_detectors>DETECTORS_QKM ||
327  sample_view_vec == NULL || ecr_sample_position == NULL ||
328  ellip_sample_position == NULL || sample_flags == NULL ||
329  terrain_sample_position == NULL
330  )
331  {
332  sprintf(msgbuf,"\nsample_number: %d, num_detectors: %d"
333  "sample_view_vec: %p, ecr_sample_position: %p"
334  "ellip_sample_position: %p, sample_flags: %p"
335  "terrain_sample_position: %p", sample_number,num_detectors,
336  (void *)sample_view_vec, (void *)ecr_sample_position,
337  (void *)ellip_sample_position, (void *)sample_flags,
338  (void *)terrain_sample_position );
339  modsmf(MODIS_E_BAD_INPUT_ARG, msgbuf,filefunc);
340  return MODIS_E_BAD_INPUT_ARG;
341  }
342 
343  /* Initialize output to position of ellipsoid height input */
344  for (det = 0; det < num_detectors; det++) {
345  for (i = 0; i < 3; i++)
346  terrain_sample_position[det][sample_number][i] =
347  ellip_sample_position[det][sample_number][i];
348  }
349 
350  /* If no terrain correction required, copy data and return */
351  if ((correct_terrain[0] == '\0')&&(PGS_PC_GetConfigData(
352  TERRAIN_CORRECT_LUN, correct_terrain) != PGS_S_SUCCESS))
353  {
354  sprintf(msgbuf, "PGS_PC_GetConfigData(%ld)", (long)TERRAIN_CORRECT_LUN);
355  modsmf(MODIS_E_GEO, msgbuf, filefunc);
356  return MODIS_E_GEO;
357  }
358 
359  if(strncmp(correct_terrain, TERRAIN_CORRECT, sizeof(correct_terrain))!=0)
360  { /* No terrain correction required. */
361  for (det = 0; det < num_detectors; det++)
362  sample_flags[det][sample_number] |= BAD_TERRAIN;
363  return PGS_S_SUCCESS;
364  }
365 
366  /* Loop through detectors */
367 
368  for (det = 0; det < num_detectors; det++)
369  {
370  if(sample_flags[det][sample_number]<NO_ELLIPSE_INTERSECT)
371  {
372  if(GEO_read_DEM(
373  ellip_sample_position[det][sample_number][LAT_IDX],
374  ellip_sample_position[det][sample_number][LON_IDX],
375  &hgtmin, &hgtmax) != SUCCESS)
376  {
377  sprintf(msgbuf, "GEO_read_DEM(%f, %f) for detector %d",
378  ellip_sample_position[det][sample_number][LAT_IDX],
379  ellip_sample_position[det][sample_number][LON_IDX], det);
380  modsmf(MODIS_E_GEO, msgbuf, filefunc);
381  sample_flags[det][sample_number] |= BAD_TERRAIN;
382  }
383  else
384  {
385  /* calculate local ellipsoid normal unit vector */
386 
387  unit_n[0] =
388  cos(ellip_sample_position[det][sample_number][LAT_IDX])*
389  cos(ellip_sample_position[det][sample_number][LON_IDX]);
390  unit_n[1] =
391  cos(ellip_sample_position[det][sample_number][LAT_IDX])*
392  sin(ellip_sample_position[det][sample_number][LON_IDX]);
393  unit_n[2] =
394  sin(ellip_sample_position[det][sample_number][LAT_IDX]);
395 
396  /* compute the ECR unit vector from the ground point to the satellite */
397 
398  for (i = 0; i < 3; ++i)
399  u[i] = - sample_view_vec[det][sample_number][i];
400 
401  range = PGS_CSC_Norm(u);
402  if (fabs(range) < DBL_MIN) {
403  sprintf(msgbuf, "u for detector %d", det);
404  modsmf(MODIS_E_UTIL_VEC, msgbuf, filefunc);
405  sample_flags[det][sample_number] |= BAD_TERRAIN;
406  continue;
407  }
408 
409  /* compute the component of the satellite vector in the
410  local vertical direction (cos_view)*/
411  for (i = 0; i < 3; ++i)
412  unit_u[i] = u[i]/range;
413 
414  cos_view = PGS_CSC_dotProduct(unit_n, unit_u, 3);
415  if(cos_view < MIN_COS_VIEW)
416  {
417  sample_flags[det][sample_number] |= (BAD_TERRAIN | NEAR_LIMB);
418  continue;
419  }
420  if(cos_view > 1.0) cos_view =1.0;
421 
422  /* compute D_max and D_min (distance along line-of-sight vector to
423  hgtmax and hgtmin) */
424 
425  D_max = (double)hgtmax / cos_view;
426  D_min = (double)hgtmin / cos_view;
427 
428  /* Compute search step size along view vector */
429  sin_view = sqrt(1.0 - cos_view*cos_view);
430 
431  if( (double)(hgtmax - hgtmin) < minimum_height)
432  {
433  /* The terrain is so flat that interpolation is not necessary. */
434  D = 0.5*(D_max + D_min);
435  }
436  else
437  {
438  if(sin_view*(D_max-D_min) < search_grid/step_factor)
439  /* protect against division by 0. */
440  delta_D = (D_max-D_min)*step_factor;
441  else /* horizontal component == search_grid */
442  delta_D = search_grid / sin_view;
443 
444  /* Must cover full range, but don't want any step to correspond
445  * exactly to one of the boundary values.
446  */
447  num_steps = 1+(int)ceil( (D_max-D_min)/delta_D + 0.1);
448 
449  /* Initialization before
450  iteration */
451  /* D_max+delta_D/2 > D0 >= D_max,
452  * D_min >= D0-(num_steps-1)*delta_D > D_min-delta_D/2
453  */
454  D0 = 0.5*( D_max + D_min + (double)(num_steps-1)*delta_D );
455  D = D0;
456 
457  /* Begin stepping down line of sight,
458  searching for intersection with
459  terrain. */
460  height = 0.0;
461  h_prime = 1.0;
462 
463  for(step = 0; (step < num_steps) && (height<h_prime) &&
464  !(sample_flags[det][sample_number] & BAD_TERRAIN); step++)
465  {
466  previous_height = height; /* Save current values for heights */
467  previous_h_prime = h_prime;
468 
469  /* Decrement distance along
470  line-of-sight */
471  D = D0 - (double)step*delta_D;
472  /* calculate x, the ECR position
473  vector for this initial
474  location */
475  for (i = 0; i < 3; i++)
476  x[i] = ecr_sample_position[det][sample_number][i]
477  + D*unit_u[i];
478 
479  /* Compute lat, lon, height */
480  if(PGS_CSC_ECRtoGEO(x, EARTH_MODEL, &longitude, &latitude, &h_prime)
481  != PGS_S_SUCCESS)
482  {
483  /* call SDP toolkit function to report error */
484  sprintf(msgbuf, "PGS_CSC_ECRtoGEO() on detector %d", det);
485  modsmf(MODIS_E_GEO, msgbuf, filefunc);
486  sample_flags[det][sample_number] |= BAD_TERRAIN;
487  }
488 
489  /* Compute terrain height */
490  else if (GEO_latlon2height(latitude, longitude, &height) != SUCCESS)
491  {
492  /* call SDP toolkit function to report error */
493  sprintf(msgbuf, "GEO_latlon2height(%f, %f) on detector %d",
494  latitude, longitude, det);
495  modsmf(MODIS_E_GEO, msgbuf, filefunc);
496  sample_flags[det][sample_number] |= BAD_TERRAIN;
497  }
498  }
499 
500  if(sample_flags[det][sample_number] & BAD_TERRAIN)
501  continue;
502 
503  if(step > 0) /*the search loop was performed more than once */
504  {
505  /* Now (should) have line of sight
506  and terrain heights for two
507  locations. Interpolate between
508  these two positions to the
509  estimated line of sight intersection
510  with the terrain. */
511  /* calculate the interpolation_weight */
512  interpolation_weight = (height-h_prime) /
513  (height - previous_height + previous_h_prime - h_prime);
514 
515  /* calculate the final ECR coordinates */
516  D = D0 + ( interpolation_weight-(double)(step-1) ) * delta_D;
517  }
518  } /* end else hgtmax-hgtmin is less than minimum height */
519 
520  /* Check for correction less than 1 meter */
521  if (fabs(D) > minimum_height)
522  {
523  for (i = 0; i < 3; ++i)
524  ecr_sample_position[det][sample_number][i]
525  += D*unit_u[i];
526 
527  /* calculate final geodetic coordinates */
528  if(PGS_CSC_ECRtoGEO(ecr_sample_position[det][sample_number],
529  EARTH_MODEL, &longitude, &latitude, &height) != PGS_S_SUCCESS)
530  {
531  /* call SDP toolkit function to report error */
532  sprintf(msgbuf, "PGS_CSC_ECRtoGEO() on detector %d", det);
533  modsmf(MODIS_E_GEO, msgbuf, filefunc);
534  sample_flags[det][sample_number] = BAD_TERRAIN;
535  continue;
536  }
537 
538  /* assign the final position to the global variable */
539  terrain_sample_position[det][sample_number][LAT_IDX] =
540  latitude;
541  terrain_sample_position[det][sample_number][LON_IDX] =
542  longitude;
543  terrain_sample_position[det][sample_number][HT_IDX] =
544  height;
545  }
546 
547  } /* End of if DEM data */
548 
549  } /* End of if pixel_flags<No_ELLIPS_INTERSECT */
550 
551  } /* End of detector loop */
552 
553  return SUCCESS;
554 }
#define NEAR_LIMB
Definition: GEO_geo.h:121
#define SUCCESS
Definition: ObpgReadGrid.h:15
#define MIN_COS_VIEW
real(single), dimension(:,:), allocatable longitude
#define NULL
Definition: decode_rs.h:63
#define MODIS_E_BAD_INPUT_ARG
const unsigned char NO_ELLIPSE_INTERSECT
real(single), dimension(:,:), allocatable latitude
#define MAX_PADDED
Definition: GEO_geo.h:84
@ HT_IDX
const unsigned char BAD_TERRAIN
#define MODIS_E_GEO
PGSt_SMF_status GEO_terrain_correct(int const sample_number, int const num_detectors, double sample_view_vec[][MAX_PADDED][3], double ecr_sample_position[][MAX_PADDED][3], double ellip_sample_position[][MAX_PADDED][3], unsigned char sample_flags[][MAX_PADDED], double terrain_sample_position[][MAX_PADDED][3])
int GEO_read_DEM(double lat, double lon, int *const hgtmin, int *const hgtmax)
Definition: GEO_DEM.c:395
#define TERRAIN_CORRECT
Definition: GEO_geo.h:125
#define TERRAIN_CORRECT_LUN
Definition: GEO_geo.h:95
integer, parameter double
#define MODIS_E_UTIL_VEC
@ LON_IDX
#define EARTH_MODEL
Definition: GEO_earth.h:118
@ LAT_IDX
data_t u
Definition: decode_rs.h:74
#define fabs(a)
Definition: misc.h:93
int GEO_latlon2height(double const lat, double const lon, double *const h)
Definition: GEO_DEM.c:944
#define DETECTORS_QKM
Definition: GEO_geo.h:87
int i
Definition: decode_rs.h:71