OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
GEO_interp_mirr_ang.c
Go to the documentation of this file.
1 /* file: GEO_interp_mirr_ang.c */
2 
3 #include "PGS_MODIS_35251.h"
4 #include "smfio.h"
5 #include "GEO_inst.h"
6 #include "GEO_parameters.h"
7 #include "GEO_util.h"
8 
10  double const sample_enc,
11  double * const sample_mirr_ang
12  )
13 /*
14 !C*****************************************************************************
15 !Description: Routine in Instrument Model of the Level-1A geolocation
16  software to calculate the sample mirror angle as a polynomial
17  function of the input encoder value.
18 
19 !Input Parameters:
20  int sample_number the sample number in the ideal band
21  double sample_enc - sample encoder value
22  double *sample_mirr_ang - sample mirror_angle
23 
24 !Output Parameters:
25  double *sample_mirr_ang - sample mirror angle
26 
27 Return parameter:
28  int err_stat - error status
29 
30 Global variables:
31  int poly_degree - degree of the mirror polynomial
32  double poly_coef[MAX_POLY_DEGREE+1] - coefficient of the
33  polynomial
34 
35 Call functions:
36  int GEO_poly_fit(double, double, int, double) -
37  evaluate a polynomial
38  modsmf(MODIS_X_MNEMONIC_STRING, "user message string", "function,
39  GEO_interp_mirr_ang.c") - writes error status messages to log
40 
41 !Revision History:
42  $Log: GEO_interp_mirr_ang.c,v $
43  Revision 1.6 1997/07/21 16:24:34 kuyper
44  Baselined Version 1
45 
46  * Revision 1.6 1997/03/26 18:07:54 fhliang
47  * Initial revision of SDST delivery of GEO_interp_mirr_ang.c.
48  *
49  Revision 1.5 1997/02/13 20:10:48 kuyper
50  Merged seed files.
51 
52  Revision 1.4 1996/07/24 21:04:56 kuyper
53  Standardized order of #include files.
54  Declared arguments const.
55 
56  Revision 1.3 1996/07/23 23:17:46 kuyper
57  Inserted required '!' in comments.
58  Removed ret_val.
59 
60  Revision 1.2 1996/07/18 19:20:39 kuyper
61  Included self-checking header file.
62  Replaced extern declarations with corresponding header file.
63  Added needed header file.
64  James Kuyper Jr. (kuyper@ltpmail.gsfc.nasa.gov)
65 
66  10/10/95
67  Tracey W. Holmes
68  Added debug option.
69 
70  6/30/95
71  Tracey W. Holmes (holmes@modis-xl.gsfc.nasa.gov)
72  Added SDP error messages.
73 
74  6/12/95
75  Frederick S. Patt (patt@modis-xl.gsfc.nasa.gov)
76  Fixed wrap-around lines and added.
77 
78  4/25/95
79  Ruiming Chen
80  Finished coding.
81 
82 !Team-unique Header:
83  This software is developed by the MODIS Science Data Support
84  Team for the National Aeronautics and Space Administration,
85  Goddard Space Flight Center, under contract NAS5-32373.
86 
87 !END*************************************************************************
88 */
89 {
90 
91  /* fit the polynomial to get the mirr angle for the sample pixel */
92  if (GEO_poly_fit(poly_coef, sample_enc, poly_degree, sample_mirr_ang) == FAIL)
93  {
94  /* call SDP function to report error */
95  modsmf(MODIS_E_UTIL_POLY, "", "GEO_poly_fit, GEO_interp_mirr_ang.c");
96 
97  return FAIL;
98  }
99 
100  return SUCCESS;
101 }
102 
#define SUCCESS
Definition: ObpgReadGrid.h:15
#define FAIL
Definition: ObpgReadGrid.h:18
const double * poly_coef
#define MODIS_E_UTIL_POLY
int GEO_poly_fit(double const *coef, double const in_x, int const degree, double *const out_fit)
Definition: GEO_poly_fit.c:8
int GEO_interp_mirr_ang(double const sample_enc, double *const sample_mirr_ang)
int poly_degree