NASA Logo
Ocean Color Science Software

ocssw V2022
l_sun.c
Go to the documentation of this file.
1 #include "libnav.h"
2 #include "sun2000.h"
3 #include "nav.h"
28 void l_sun_(int *iyr, int *iday, double *sec, float sunr[3], float *rs) {
29  float su[3];
30  // Get unit Sun vector in geocentric inertial coordinates
31  sun2000(*iyr, *iday, *sec, su, rs);
32  // Get Greenwich mean sideral angle
33  double day = *iday + *sec / 864.e2;
34  double gha;
35  gha2000(*iyr, day, &gha);
36  double ghar = gha / radeg;
37  // Transform Sun vector into geocentric rotating frame
38  sunr[0] = su[0]*cos(ghar) + su[1]*sin(ghar);
39  sunr[1] = su[1]*cos(ghar) - su[0]*sin(ghar);
40  sunr[2] = su[2];
41 }
int32_t day
void l_sun_(int *iyr, int *iday, double *sec, float sunr[3], float *rs)
c Computes unit Sun vector in geocentric rotating coodinates, using c subprograms to compute inertial...
Definition: l_sun.c:28
int gha2000(int32_t iyr, double day, double &gha)
int sun2000(size_t sdim, int32_t iyr, int32_t idy, double *sec, orb_array *sun)
int32_t iyr
Definition: atrem_corl1.h:161