MISR Toolkit  1.5.1
MtkBlsToSomXYAry.c
Go to the documentation of this file.
1 /*===========================================================================
2 = =
3 = MtkBlsToSomXYAry =
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 *som_x,
47  double *som_y )
48 {
49  MTKt_status status_code; /* Return status of this function */
50  MTKt_status status; /* Return status */
51  MTKt_MisrProjParam pp; /* Projection parameters */
52  int i; /* Loop index */
53 
54  if (block == NULL || line == NULL || sample == NULL ||
55  som_x == NULL || som_y == NULL)
57 
58  if (nelement < 0)
60 
61  status = MtkPathToProjParam(path, resolution_meters, &pp);
62  MTK_ERR_COND_JUMP(status);
63 
64  status = misr_init(pp.nblock, pp.nline, pp.nsample,
65  pp.reloffset, pp.ulc, pp.lrc);
66  if (status != MTK_SUCCESS)
68 
69  for (i = 0; i < nelement; i++) {
70  status = misrinv(block[i], line[i], sample[i], &som_x[i], &som_y[i]);
71  if (status != MTK_SUCCESS)
73  }
74 
75  return MTK_SUCCESS;
76 
77 ERROR_HANDLE:
78  return status_code;
79 }
int misr_init(const int nblock, const int nline, const int nsample, const float relOff[NOFFSET], const double ulc_coord[], const double lrc_coord[])
Definition: misr_init.c:18
MISR Projection Parameters.
#define MTK_ERR_CODE_JUMP(code)
Definition: MisrError.h:175
float reloffset[179]
MTKt_status MtkPathToProjParam(int path, int resolution_meters, MTKt_MisrProjParam *pp)
Get projection parameters.
int misrinv(const int block, const float line, const float sample, double *x, double *y)
Definition: misrinv.c:17
MTKt_status MtkBlsToSomXYAry(int path, int resolution_meters, int nelement, const int *block, const float *line, const float *sample, double *som_x, double *som_y)
Convert array from Block, Line, Sample, to SOM Coordinates.
#define MTK_ERR_COND_JUMP(code)
Definition: MisrError.h:188
MTKt_status
Definition: MisrError.h:11

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