MISR Toolkit  1.5.1
MtkLSToSomXY.c
Go to the documentation of this file.
1 /*===========================================================================
2 = =
3 = MtkLSToSomXY =
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 "MisrMapQuery.h"
18 #include "MisrError.h"
19 
34  MTKt_MapInfo mapinfo,
35  float line,
36  float sample,
37  double *som_x,
38  double *som_y )
39 {
40  MTKt_status status_code; /* Return status of this function */
41 
42  if (som_x == NULL || som_y == NULL)
44 
45  /* Check argument bounds */
46  if (line < -0.5 || line > mapinfo.nline - 0.5)
48  if (sample < -0.5 || sample > mapinfo.nsample - 0.5)
50 
51  /* Determine som x/y from ulc and line/sample and resolution */
52  *som_x = mapinfo.som.ulc.x + line * mapinfo.resolution;
53  *som_y = mapinfo.som.ulc.y + sample * mapinfo.resolution;
54 
55  return MTK_SUCCESS;
56 
57 ERROR_HANDLE:
58  if (status_code != MTK_NULLPTR)
59  {
60  *som_x = -1e-9;
61  *som_y = -1e-9;
62  }
63  return status_code;
64 }
#define MTK_ERR_CODE_JUMP(code)
Definition: MisrError.h:175
Map Information.
Definition: MisrMapQuery.h:65
MTKt_status MtkLSToSomXY(MTKt_MapInfo mapinfo, float line, float sample, double *som_x, double *som_y)
Convert line, sample to SOM X, SOM Y.
Definition: MtkLSToSomXY.c:33
MTKt_status
Definition: MisrError.h:11
MTKt_SomRegion som
Definition: MisrMapQuery.h:74
MTKt_SomCoord ulc
Definition: MisrMapQuery.h:56

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