Go to the documentation of this file.
3 double norm(
const double* vec,
size_t n) {
4 return sqrt(
square(vec, n));
7 double square(
const double* vec,
size_t n) {
9 for (
size_t i = 0;
i < n;
i++) {
10 norm_ += vec[
i] * vec[
i];
15 double dot(
const double* vec1,
const double* vec2,
size_t n) {
17 for (
size_t i = 0;
i < n;
i++) {
18 ans += vec1[
i] * vec2[
i];
24 return a - ((int32_t)(
a /
p) *
p);
31 const static double d0 = 2415020.5e0, d1 = 1.e-4, d2 = 1.e-2, d3 = 24.e0, d4 = 1.44e3, d5 = 8.64e4;
33 int32_t iy = (
int)(tin[0] * d1 - 1.9e3);
34 int32_t
im = (
int)(tin[0] * d2 - 1.9e5) - iy * 100;
35 int32_t
id = (
int)(tin[0] - 1.9e7) - iy * 10000 -
im * 100;
36 int32_t ihour = (
int)(tin[1] * d1);
37 int32_t imin = (
int)(tin[1] * d2) - ihour * 100;
38 double sec = tin[1] - ihour * 10000 - imin * 100;
39 int32_t
jd = iy * 365 + (iy - 1) / 4;
78 if (iy / 4 * 4 - iy == 0 &&
im > 2)
81 tout += (
double)
jd + (
double)ihour / d3 + (
double)imin / d4 + sec / d5;
94 *
k = l - 1461 * (*
i - 1) / 4 - 365;
102 int n = 4 * l / 146097;
103 l = l - (146097 * n + 3) / 4;
104 *
i = 4000 * (l + 1) / 1461001;
105 l = l - 1461 * *
i / 4 + 31;
107 *
k = l - 2447 * *
j / 80;
109 *
j = *
j + 2 - 12 * l;
110 *
i = 100 * (n - 49) + *
i + l;
113 void ymdhms2jul(int32_t year, int32_t month, int32_t
day, int32_t hour, int32_t minute,
double sec,
115 *jul =
jd(year, month,
day) + (hour * 3600.e0 + minute * 60.e0 + sec) / 86400.e0;
119 int32_t
jd(int32_t
i, int32_t
j, int32_t
k) {
120 return 367 *
i - 7 * (
i + (
j + 9) / 12) / 4 + 275 *
j / 9 +
k + 1721014;
void jddate(int jd, int *i, int *j, int *k)
Construct a new ddate objectC C This routine computes the calendar date corresponding to C a given Ju...
double norm(const double *vec, size_t n)
computes the norm of a vector
void jdate(int jd, int *i, int *k)
double square(const double *vec, size_t n)
computes the square of the norm of a vector
void ymdhms2jul(int32_t year, int32_t month, int32_t day, int32_t hour, int32_t minute, double sec, double *jul)
c ----------------------------------------------------------— c Subroutine ymdhms2jul c c Convers fro...
int32_t jd(int32_t i, int32_t j, int32_t k)
c This function converts a calendar date to the corresponding Julian day starting at noon on the cale...
integer, parameter double
double julian(double tin[2])
double dmod(double a, double p)
Description:
double dot(const double *vec1, const double *vec2, size_t n)
computes the scalar/dot product of two vectors
PGE01 indicating that PGE02 PGE01 V6 for and PGE01 V2 for MOD03 were used to produce the granule By convention adopted in all MODIS Terra PGE02 code versions are The fourth digit of the PGE02 version denotes the LUT version used to produce the granule The source of the metadata environment variable ProcessingCenter was changed from a QA LUT value to the Process Configuration A sign used in error in the second order term was changed to a