MISR Toolkit  1.5.1
MtkBlsToSomXY.c
Go to the documentation of this file.
1 /*===========================================================================
2 = =
3 = MtkBlsToSomXY =
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  int block,
37  float line,
38  float sample,
39  double *som_x,
40  double *som_y )
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 (som_x == NULL || som_y == 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 = misrinv(block, line, sample, som_x, som_y);
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 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_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
#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