MISR Toolkit  1.5.1
MtkSomXYToBls.c
Go to the documentation of this file.
1 /*===========================================================================
2 = =
3 = MtkSomXYToBls =
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 
34  int path,
35  int resolution_meters,
36  double som_x,
37  double som_y,
38  int *block,
39  float *line,
40  float *sample )
41 {
42  MTKt_status status_code; /* Return status of this function */
43  MTKt_status status; /* Return status */
44  MTKt_MisrProjParam pp; /* Projection parameters */
45 
46  if (block == NULL || line == NULL || sample == NULL)
48 
49  status = MtkPathToProjParam(path, resolution_meters, &pp);
50  MTK_ERR_COND_JUMP(status);
51 
52  status = misr_init(pp.nblock, pp.nline, pp.nsample,
53  pp.reloffset, pp.ulc, pp.lrc);
54  if (status != MTK_SUCCESS)
56 
57  status = misrfor(som_x, som_y, block, line, sample);
58  if (status != MTK_SUCCESS)
60 
61  return MTK_SUCCESS;
62 
63 ERROR_HANDLE:
64  return status_code;
65 }
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.
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
float reloffset[179]
int misrfor(const double x, const double y, int *block, float *line, float *sample)
Definition: misrfor.c:18
MTKt_status MtkPathToProjParam(int path, int resolution_meters, MTKt_MisrProjParam *pp)
Get projection parameters.
#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