MISR Toolkit  1.5.1
MtkBlsToLatLonAry.c
Go to the documentation of this file.
1 /*===========================================================================
2 = =
3 = MtkBlsToLatLonAry =
4 = =
5 =============================================================================
6 
7  Jet Propulsion Laboratory
8  MISR
9  MISR Toolkit
10 
11  Copyright 2005, California Institute of Technology.
12  ALL RIGHTS RESERVED.
13  U.S. Government Sponsorship acknowledged.
14 
15 ============================================================================*/
16 
17 #include "MisrCoordQuery.h"
18 #include "MisrError.h"
19 #include "misrproj.h"
20 
40  int path,
41  int resolution_meters,
42  int nelement,
43  const int *block,
44  const float *line,
45  const float *sample,
46  double *lat_dd,
47  double *lon_dd )
48 {
49  MTKt_status status_code; /* Return status of this function */
50  MTKt_status status; /* Return status */
51  double som_x; /* SOM X */
52  double som_y; /* SOM Y */
53  int i; /* Loop index */
54 
55  if (block == NULL || line == NULL || sample == NULL ||
56  lat_dd == NULL || lon_dd == NULL)
58 
59  if (nelement < 0)
61 
62  for (i = 0; i < nelement; i++) {
63  status = MtkBlsToSomXY(path, resolution_meters,
64  block[i], line[i], sample[i], &som_x, &som_y);
65  MTK_ERR_COND_JUMP(status);
66 
67  status = MtkSomXYToLatLon(path, som_x, som_y, &lat_dd[i], &lon_dd[i]);
68  MTK_ERR_COND_JUMP(status);
69  }
70 
71  return MTK_SUCCESS;
72 
73 ERROR_HANDLE:
74  return status_code;
75 }
#define MTK_ERR_CODE_JUMP(code)
Definition: MisrError.h:175
MTKt_status MtkSomXYToLatLon(int path, double som_x, double som_y, double *lat_dd, double *lon_dd)
Convert SOM X, SOM Y to decimal degrees latitude and longitude.
MTKt_status MtkBlsToSomXY(int path, int resolution_meters, int block, float line, float sample, double *som_x, double *som_y)
Convert from Block, Line, Sample, to SOM Coordinates.
Definition: MtkBlsToSomXY.c:33
#define MTK_ERR_COND_JUMP(code)
Definition: MisrError.h:188
MTKt_status
Definition: MisrError.h:11
MTKt_status MtkBlsToLatLonAry(int path, int resolution_meters, int nelement, const int *block, const float *line, const float *sample, double *lat_dd, double *lon_dd)
Convert array from Block, Line, Sample, to Latitude and Longitude.

MISR Toolkit - Copyright © 2005 - 2020 Jet Propulsion Laboratory
Generated on Fri Jun 19 2020 22:49:51