OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
GEO_poly_coef1.c
Go to the documentation of this file.
1 #include "GEO_basic.h"
2 #include "GEO_util.h"
3 
5  double const var_val1,
6  double const var_val2,
7  double const derivative1,
8  double const derivative2,
9  double const t1,
10  double const t2,
11  double fit_coef[CUBIC])
12 
13 /*
14 !C*****************************************************************************
15 !Description:
16  subroutine in utility group of the Level-1A geolocation
17  software to generate cubic polynomial coefficients using
18  values and slopes at two times.
19 
20 !Input Parameters:
21  double var_val1 - value of first point
22  double var_val2 - value of second point
23  double derivative1 - slope of first point
24  double derivative2 - slope of second point
25  double t1 - time of first point
26  double t2 - time of second point
27  int scan_number - the scan number
28 
29 !Output Parameters:
30  double fit_coef[CUBIC] - cubic polynomial coefficients
31 
32 Return parameter:
33  int err_stat - error status
34 
35 Global variables:
36  None
37 
38 Call functions:
39  None
40 
41 !Revision History:
42  * $Log: GEO_poly_coef1.c,v $
43  * Revision 2.1 1997/10/21 18:16:22 kuyper
44  * Returned from ClearCase
45  *
46  * Revision /main/GEO_V2_DEV/1 1997/10/15 kuyper
47  * Changed to use CUBIC macro.
48  *
49  * Revision 1.5 1997/07/21 16:24:34 kuyper
50  * Baselined Version 1
51  *
52  * Revision 1.5 1997/03/26 18:10:35 fhliang
53  * Initial revision of SDST delivery of GEO_poly_coef1.c.
54  *
55  Revision 1.4 1996/07/24 21:08:47 kuyper
56  Declared arguments const.
57 
58  Revision 1.3 1996/07/23 23:29:41 kuyper
59  Inserted required '!'s in comments.
60  Changed constants to double, to avoid conversions.
61 
62  Revision 1.2 1996/07/18 19:52:42 kuyper
63  Included self-checking header file.
64 
65 
66  6/2/95
67  Frederick S. Patt (patt@modis-xl.gsfc.nasa.gov)
68  Finished coding.
69 
70  6/12/95
71  Frederick S. Patt
72  Revised prolog
73 
74 !Team-unique Header:
75  This software is developed by the MODIS Science Data Support
76  Team for the National Aeronautics and Space Administration,
77  Goddard Space Flight Center, under contract NAS5-32373.
78 
79 !END*************************************************************************
80 */
81 
82 {
83 /* Local variable declarations */
84 
85  double dt = 1.0;
86 
87  /* Begin program logic */
88 
89  dt = t2 - t1;
90 
91  /* calculate the polynominal coefficients */
92  fit_coef[0] = var_val1;
93  fit_coef[1] = derivative1*dt;
94  fit_coef[2] = 3.0*var_val2 - 3.0*var_val1 - 2.0*derivative1*dt -
95  derivative2*dt;
96  fit_coef[3] = 2.0*var_val1 - 2.0*var_val2 + derivative1*dt + derivative2*dt;
97 
98  return SUCCESS;
99 }
#define SUCCESS
Definition: ObpgReadGrid.h:15
#define CUBIC
Definition: GEO_util.h:71
int GEO_poly_coef1(double const var_val1, double const var_val2, double const derivative1, double const derivative2, double const t1, double const t2, double fit_coef[CUBIC])
Definition: GEO_poly_coef1.c:4