MISR Toolkit  1.5.1
MtkLatLonToBlsAry.c
Go to the documentation of this file.
1 /*===========================================================================
2 = =
3 = MtkLatLonToBlsAry =
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 "proj.h"
20 
41  int path,
42  int resolution_meters,
43  int nelement,
44  const double *lat_dd,
45  const double *lon_dd,
46  int *block,
47  float *line,
48  float *sample )
49 {
50  MTKt_status status_code; /* Return status of this function */
51  MTKt_status status; /* Return status */
52  double som_x; /* SOM X */
53  double som_y; /* SOM Y */
54  int i; /* Loop index */
55 
56  if (lat_dd == NULL || lon_dd == NULL || block == NULL ||
57  line == NULL || sample == NULL)
59 
60  if (nelement < 0)
62 
63  for (i = 0; i < nelement; i++) {
64  status = MtkLatLonToSomXY(path, lat_dd[i], lon_dd[i], &som_x, &som_y);
65  MTK_ERR_COND_JUMP(status);
66 
67  status = MtkSomXYToBls(path, resolution_meters, som_x, som_y,
68  &block[i], &line[i], &sample[i]);
69  MTK_ERR_COND_JUMP(status);
70  }
71 
72  return MTK_SUCCESS;
73 
74 ERROR_HANDLE:
75  return status_code;
76 }
MTKt_status MtkSomXYToBls(int path, int resolution_meters, double som_x, double som_y, int *block, float *line, float *sample)
Convert SOM X, SOM Y to block, line, sample.
Definition: MtkSomXYToBls.c:33
#define MTK_ERR_CODE_JUMP(code)
Definition: MisrError.h:175
MTKt_status MtkLatLonToBlsAry(int path, int resolution_meters, int nelement, const double *lat_dd, const double *lon_dd, int *block, float *line, float *sample)
Convert array of decimal degrees latitude and longitude to array of block, line, sample.
#define MTK_ERR_COND_JUMP(code)
Definition: MisrError.h:188
MTKt_status
Definition: MisrError.h:11
MTKt_status MtkLatLonToSomXY(int path, double lat_dd, double lon_dd, double *som_x, double *som_y)
Convert decimal degrees latitude and longitude to SOM X, SOM Y.

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