Go to the documentation of this file.
9 fprintf(
stderr,
"Numerical Recipes run-time error...\n");
10 fprintf(
stderr,
"%s\n", error_text);
11 fprintf(
stderr,
"...now exiting to system...\n");
19 v = (
float *) malloc((
size_t) ((nh -
nl + 1 +
NR_END) *
sizeof (
float)));
20 if (!
v)
nrerror(
"allocation failure in vector()");
28 v = (
int *) malloc((
size_t) ((nh -
nl + 1 +
NR_END) *
sizeof (
int)));
29 if (!
v)
nrerror(
"allocation failure in ivector()");
37 v = (
unsigned char *) malloc((
size_t) ((nh -
nl + 1 +
NR_END) *
sizeof (
unsigned char)));
38 if (!
v)
nrerror(
"allocation failure in cvector()");
46 v = (
unsigned long *) malloc((
size_t) ((nh -
nl + 1 +
NR_END) *
sizeof (
long)));
47 if (!
v)
nrerror(
"allocation failure in lvector()");
55 v = (
double *) malloc((
size_t) ((nh -
nl + 1 +
NR_END) *
sizeof (
double)));
56 if (!
v)
nrerror(
"allocation failure in dvector()");
60 float **
matrix(
long nrl,
long nrh,
long ncl,
long nch)
62 long i, nrow = nrh - nrl + 1, ncol = nch - ncl + 1;
66 m = (
float **) malloc((
size_t) ((nrow +
NR_END) *
sizeof (
float*)));
67 if (!m)
nrerror(
"allocation failure 1 in matrix()");
72 m[nrl] = (
float *) malloc((
size_t) ((nrow * ncol +
NR_END) *
sizeof (
float)));
73 if (!m[nrl])
nrerror(
"allocation failure 2 in matrix()");
77 for (
i = nrl + 1;
i <= nrh;
i++) m[
i] = m[
i - 1] + ncol;
83 double **
dmatrix(
long nrl,
long nrh,
long ncl,
long nch)
85 long i, nrow = nrh - nrl + 1, ncol = nch - ncl + 1;
89 m = (
double **) malloc((
size_t) ((nrow +
NR_END) *
sizeof (
double*)));
90 if (!m)
nrerror(
"allocation failure 1 in matrix()");
95 m[nrl] = (
double *) malloc((
size_t) ((nrow * ncol +
NR_END) *
sizeof (
double)));
96 if (!m[nrl])
nrerror(
"allocation failure 2 in matrix()");
100 for (
i = nrl + 1;
i <= nrh;
i++) m[
i] = m[
i - 1] + ncol;
106 int **
imatrix(
long nrl,
long nrh,
long ncl,
long nch)
108 long i, nrow = nrh - nrl + 1, ncol = nch - ncl + 1;
112 m = (
int **) malloc((
size_t) ((nrow +
NR_END) *
sizeof (
int*)));
113 if (!m)
nrerror(
"allocation failure 1 in matrix()");
119 m[nrl] = (
int *) malloc((
size_t) ((nrow * ncol +
NR_END) *
sizeof (
int)));
120 if (!m[nrl])
nrerror(
"allocation failure 2 in matrix()");
124 for (
i = nrl + 1;
i <= nrh;
i++) m[
i] = m[
i - 1] + ncol;
130 float **
submatrix(
float **
a,
long oldrl,
long oldrh,
long oldcl,
long oldch,
131 long newrl,
long newcl)
133 long i,
j, nrow = oldrh - oldrl + 1, ncol = oldcl - newcl;
137 m = (
float **) malloc((
size_t) ((nrow +
NR_END) *
sizeof (
float*)));
138 if (!m)
nrerror(
"allocation failure in submatrix()");
143 for (
i = oldrl,
j = newrl;
i <= oldrh;
i++,
j++) m[
j] =
a[
i] + ncol;
154 long i,
j, nrow = nrh - nrl + 1, ncol = nch - ncl + 1;
158 m = (
float **) malloc((
size_t) ((nrow +
NR_END) *
sizeof (
float*)));
159 if (!m)
nrerror(
"allocation failure in convert_matrix()");
165 for (
i = 1,
j = nrl + 1;
i < nrow;
i++,
j++) m[
j] = m[
j - 1] + ncol;
170 float ***
f3tensor(
long nrl,
long nrh,
long ncl,
long nch,
long ndl,
long ndh)
172 long i,
j, nrow = nrh - nrl + 1, ncol = nch - ncl + 1, ndep = ndh - ndl + 1;
176 t = (
float ***) malloc((
size_t) ((nrow +
NR_END) *
sizeof (
float**)));
177 if (!
t)
nrerror(
"allocation failure 1 in f3tensor()");
182 t[nrl] = (
float **) malloc((
size_t) ((nrow * ncol +
NR_END) *
sizeof (
float*)));
183 if (!
t[nrl])
nrerror(
"allocation failure 2 in f3tensor()");
188 t[nrl][ncl] = (
float *) malloc((
size_t) ((nrow * ncol * ndep +
NR_END) *
sizeof (
float)));
189 if (!
t[nrl][ncl])
nrerror(
"allocation failure 3 in f3tensor()");
193 for (
j = ncl + 1;
j <= nch;
j++)
t[nrl][
j] =
t[nrl][
j - 1] + ndep;
194 for (
i = nrl + 1;
i <= nrh;
i++) {
195 t[
i] =
t[
i - 1] + ncol;
196 t[
i][ncl] =
t[
i - 1][ncl] + ncol*ndep;
197 for (
j = ncl + 1;
j <= nch;
j++)
t[
i][
j] =
t[
i][
j - 1] + ndep;
229 void free_matrix(
float **m,
long nrl,
long nrh,
long ncl,
long nch)
void free_convert_matrix(float **b, long nrl, long nrh, long ncl, long nch)
double ** dmatrix(long nrl, long nrh, long ncl, long nch)
float * vector(long nl, long nh)
int * ivector(long nl, long nh)
double * dvector(long nl, long nh)
unsigned char * cvector(long nl, long nh)
void nrerror(char error_text[])
void free_matrix(float **m, long nrl, long nrh, long ncl, long nch)
float ** matrix(long nrl, long nrh, long ncl, long nch)
void free_submatrix(float **b, long nrl, long nrh, long ncl, long nch)
void free_dvector(double *v, long nl, long nh)
void free_f3tensor(float ***t, long nrl, long nrh, long ncl, long nch, long ndl, long ndh)
void free_vector(float *v, long nl, long nh)
float ** convert_matrix(float *a, long nrl, long nrh, long ncl, long nch)
void free_lvector(unsigned long *v, long nl, long nh)
float *** f3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh)
int ** imatrix(long nrl, long nrh, long ncl, long nch)
void free_imatrix(int **m, long nrl, long nrh, long ncl, long nch)
void free_cvector(unsigned char *v, long nl, long nh)
void free_ivector(int *v, long nl, long nh)
unsigned long * lvector(long nl, long nh)
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
float ** submatrix(float **a, long oldrl, long oldrh, long oldcl, long oldch, long newrl, long newcl)
void free_dmatrix(double **m, long nrl, long nrh, long ncl, long nch)