NASA Logo
Ocean Color Science Software

ocssw V2022
giop.h
Go to the documentation of this file.
1 #ifndef _GIOP_H
2 #define _GIOP_H
3 
4 
5 /* optimization routines */
6 #define AMOEBA 0
7 #define LEVMARQ 1
8 #define SVDFIT 3
9 #define SVDSIOP 4
10 
11 /* adg function types */
12 #define ADGTAB 0
13 #define ADGS 1
14 #define ADGSQAA 2
15 #define ADGSOBPG 3
16 #define ADGSIOPTAB 4
17 
18 /* bbp function types */
19 #define BBPTAB 0
20 #define BBPS 1
21 #define BBPSHAL 2
22 #define BBPSQAA 3
23 #define BBPSPML 4
24 #define BBPSCIOTTI 5
25 #define BBPSMM01 6
26 #define BBPSLAS 7
27 #define BBPLAS 8
28 #define BBPLASFIX 9
29 #define BBPQAAFIX 10
30 #define BBPLH 11
31 #define BBPCHL 12
32 
33 /* aph function types */
34 #define APHTAB 0
35 #define APHGAUSS 1
36 #define APHBRICAUD 2
37 #define APHCIOTTI 3
38 
39 
40 /* acdom function type*/
41 #define ACDOMTAB 0
42 #define ACDOMNONE 1
43 
44 /* anap function type*/
45 #define ANAPTAB 0
46 #define ANAPNONE 1
47 
48 /* bbph function type*/
49 #define BBPHTAB 0
50 #define BBPHNONE 1
51 
52 /* bbnap function type*/
53 #define BBNAPTAB 0
54 #define BBNAPNONE 1
55 
56 
57 /* rrs function types */
58 #define RRSGRD 0
59 #define RRSFOQ 1
60 
61 /*uncertainty input option*/
62 #define URRSNONE 0
63 #define URRSCALC 1
64 #define URRSABS 2
65 #define URRSREL 3
66 
67 typedef struct giop_ctl_str {
68  int npar; /* # optimized params */
69  int maxiter; /* max iterations */
70 
71  int fit_opt; /* optimization routine */
72  int aph_opt; /* aph function type */
73  int adg_opt; /* adg function type */
74  int bbp_opt; /* bbp function type */
75  int acdom_opt; /* acdom function type */
76  int anap_opt; /* anap function type */
77  int bbph_opt; /* bbph function type */
78  int bbnap_opt; /* bbnap function type */
79  int rrs_opt; /* rrs function type */
80  int wt_opt; /* do we have input wts */
81  int urrs_opt; /*relative or absolute uncertainties option*/
82 
83  int nwave; /* # fit wavelengths */
84  float *wave; /* fit wavelengths [NBANDS] */
85  int *bindx; /* index to sensor wave [NBANDS]*/
86  float *aw; /* aw per fit wave [NBANDS] */
87  float *bbw; /* bbw per fit wave [NBANDS] */
88  float *wts; /* input Rrs wts [NBANDS] */
89 
90  float *Rrs_a; /* input Rrs uncertainties [ALL BANDS] */
91  float *uRrs_a; /* input Rrs uncertainties [ALL BANDS] */
92 
93  int siopIdx; /*Optimal set of IOPs for svd_siop implementation*/
94 
95  float grd[2]; /* RRSGRD param */
96  float *foq; /* RRSFOQ variable [NBANDS] */
97  float aph_s; /* APHS spectral param */
98  float adg_s; /* ADGS spectral param */
99  float uadg_s; /* ADGS spectral param uncertainty */
100  float bbp_s; /* BBPS spectral param */
101  float ubbp_s; /* BBPS spectral param uncertainty*/
102  float aph_w; /* APHS referance wave */
103  float adg_w; /* ADGS reference wave */
104  float bbp_w; /* BBPS reference wave */
105 
106  float chl; /* Input chlorophyll */
107  float uchl; /* Input chlorophyll uncertainty */
108 
109  char aph_tab_file[FILENAME_MAX];
110  char uaph_tab_file[FILENAME_MAX];
111  int aph_tab_nw; /* elements in aph tab */
112  float *aph_tab_w; /* aph tab wavelengths */
113  float **aph_tab_s; /* aph tab values */
114  float **uaph_tab_s; /* aph tab uncertainty values */
115  int aph_nvec; /* number of eigenvect */
116 
117  char adg_tab_file[FILENAME_MAX];
118  char uadg_tab_file[FILENAME_MAX];
119  int adg_tab_nw; /* elements in adg tab */
120  float *adg_tab_w; /* adg tab wavelengths */
121  float **adg_tab_s; /* adg tab values */
122  float **uadg_tab_s; /* adg tab uncertainty values */
123  int adg_nvec; /* number of eigenvect */
124 
125  char anap_tab_file[FILENAME_MAX];
126  char uanap_tab_file[FILENAME_MAX];
127  int anap_tab_nw; /* elements in anap tab */
128  float *anap_tab_w; /* anap tab wavelengths */
129  float **anap_tab_s; /* anap tab values */
130  float **uanap_tab_s; /* anap tab uncertainty values */
131  int anap_nvec; /* number of eigenvect */
132 
133  char acdom_tab_file[FILENAME_MAX];
134  char uacdom_tab_file[FILENAME_MAX];
135  int acdom_tab_nw; /* elements in acdom tab */
136  float *acdom_tab_w; /* acdom tab wavelengths */
137  float **acdom_tab_s; /* acdom tab values */
138  float **uacdom_tab_s; /* acdom tab uncertainty values */
139  int acdom_nvec; /* number of eigenvect */
140 
141  char bbp_tab_file[FILENAME_MAX];
142  char ubbp_tab_file[FILENAME_MAX];
143  int bbp_tab_nw; /* elements in bbp tab */
144  float *bbp_tab_w; /* bbp tab wavelengths */
145  float **bbp_tab_s; /* bbp tab values */
146  float **ubbp_tab_s; /* bbp tab values */
147  int bbp_nvec; /* number of eigenvect */
148 
149  char bbph_tab_file[FILENAME_MAX];
150  char ubbph_tab_file[FILENAME_MAX];
151  int bbph_tab_nw; /* elements in bbph tab */
152  float *bbph_tab_w; /* bbph tab wavelengths */
153  float **bbph_tab_s; /* bbph tab values */
154  float **ubbph_tab_s; /* bbph tab uncertainty values */
155  int bbph_nvec; /* number of eigenvect */
156 
157  char bbnap_tab_file[FILENAME_MAX];
158  char ubbnap_tab_file[FILENAME_MAX];
159  int bbnap_tab_nw; /* elements in bbnap tab */
160  float *bbnap_tab_w; /* bbnap tab wavelengths */
161  float **bbnap_tab_s; /* bbnap tab values */
162  float **ubbnap_tab_s; /* bbnap tab uncertainty values */
163  int bbnap_nvec; /* number of eigenvect */
164 
165  double *par; /* starting params [NBANDS] */
166  double *len; /* characteristic length [NBANDS] */
167 
168 } giopstr;
169 
170 void set_giop_aph_s(giopstr *g, float aph_s);
171 void set_giop_adg_s(giopstr *g, float adg_s);
172 void set_giop_bbp_s(giopstr *g, float bbp_s);
173 void set_giop_aph_t(giopstr *g, float aphw[], float aphs[], int aphn);
174 
175 float* giop_get_chl_pointer();
176 float* giop_get_adg_pointer();
177 float* giop_get_aph_pointer();
178 float* giop_get_bbp_pointer();
179 float** giop_get_fitpar_pointer();
180 float* giop_get_mrrs_pointer();
181 
182 void run_giop(l2str *l2rec);
183 
184 #endif
float ** giop_get_fitpar_pointer()
Definition: giop.c:3796
void run_giop(l2str *l2rec)
Definition: giop.c:2230
int bbp_opt
Definition: giop.h:74
char bbp_tab_file[FILENAME_MAX]
Definition: giop.h:141
float ** ubbph_tab_s
Definition: giop.h:154
char uanap_tab_file[FILENAME_MAX]
Definition: giop.h:126
int bbph_opt
Definition: giop.h:77
float * uRrs_a
Definition: giop.h:91
float ** bbnap_tab_s
Definition: giop.h:161
float ** bbph_tab_s
Definition: giop.h:153
int * bindx
Definition: giop.h:85
float * acdom_tab_w
Definition: giop.h:136
float ubbp_s
Definition: giop.h:101
float ** uanap_tab_s
Definition: giop.h:130
int fit_opt
Definition: giop.h:71
float * bbph_tab_w
Definition: giop.h:152
int acdom_opt
Definition: giop.h:75
int bbp_tab_nw
Definition: giop.h:143
char aph_tab_file[FILENAME_MAX]
Definition: giop.h:109
void set_giop_aph_s(giopstr *g, float aph_s)
float ** ubbnap_tab_s
Definition: giop.h:162
float * bbp_tab_w
Definition: giop.h:144
int bbph_nvec
Definition: giop.h:155
void set_giop_bbp_s(giopstr *g, float bbp_s)
float ** uaph_tab_s
Definition: giop.h:114
float * wts
Definition: giop.h:88
float ** adg_tab_s
Definition: giop.h:121
int adg_tab_nw
Definition: giop.h:119
int urrs_opt
Definition: giop.h:81
float aph_s
Definition: giop.h:97
float bbp_s
Definition: giop.h:100
int acdom_tab_nw
Definition: giop.h:135
int bbnap_tab_nw
Definition: giop.h:159
int maxiter
Definition: giop.h:69
float aph_w
Definition: giop.h:102
char ubbph_tab_file[FILENAME_MAX]
Definition: giop.h:150
float * anap_tab_w
Definition: giop.h:128
void set_giop_adg_s(giopstr *g, float adg_s)
double * len
Definition: giop.h:166
char uacdom_tab_file[FILENAME_MAX]
Definition: giop.h:134
float * bbw
Definition: giop.h:87
float * giop_get_mrrs_pointer()
int wt_opt
Definition: giop.h:80
int adg_nvec
Definition: giop.h:123
char adg_tab_file[FILENAME_MAX]
Definition: giop.h:117
float uadg_s
Definition: giop.h:99
char ubbnap_tab_file[FILENAME_MAX]
Definition: giop.h:158
int aph_nvec
Definition: giop.h:115
void set_giop_aph_t(giopstr *g, float aphw[], float aphs[], int aphn)
int bbnap_opt
Definition: giop.h:78
float ** bbp_tab_s
Definition: giop.h:145
float * Rrs_a
Definition: giop.h:90
int bbnap_nvec
Definition: giop.h:163
int aph_tab_nw
Definition: giop.h:111
int siopIdx
Definition: giop.h:93
float * giop_get_aph_pointer()
Definition: giop.c:3789
int adg_opt
Definition: giop.h:73
int anap_nvec
Definition: giop.h:131
char uaph_tab_file[FILENAME_MAX]
Definition: giop.h:110
float adg_w
Definition: giop.h:103
int npar
Definition: giop.h:68
int anap_opt
Definition: giop.h:76
float * foq
Definition: giop.h:96
int nwave
Definition: giop.h:83
float ** anap_tab_s
Definition: giop.h:129
int anap_tab_nw
Definition: giop.h:127
float * giop_get_chl_pointer()
Definition: giop.c:3768
float ** ubbp_tab_s
Definition: giop.h:146
char uadg_tab_file[FILENAME_MAX]
Definition: giop.h:118
int acdom_nvec
Definition: giop.h:139
float uchl
Definition: giop.h:107
int bbp_nvec
Definition: giop.h:147
int aph_opt
Definition: giop.h:72
char ubbp_tab_file[FILENAME_MAX]
Definition: giop.h:142
float adg_s
Definition: giop.h:98
float * giop_get_adg_pointer()
Definition: giop.c:3775
char bbnap_tab_file[FILENAME_MAX]
Definition: giop.h:157
float grd[2]
Definition: giop.h:95
float * giop_get_bbp_pointer()
Definition: giop.c:3782
float chl
Definition: giop.h:106
char acdom_tab_file[FILENAME_MAX]
Definition: giop.h:133
char anap_tab_file[FILENAME_MAX]
Definition: giop.h:125
float * adg_tab_w
Definition: giop.h:120
float * bbnap_tab_w
Definition: giop.h:160
float * aw
Definition: giop.h:86
float * wave
Definition: giop.h:84
int rrs_opt
Definition: giop.h:79
char bbph_tab_file[FILENAME_MAX]
Definition: giop.h:149
float bbp_w
Definition: giop.h:104
float ** aph_tab_s
Definition: giop.h:113
double * par
Definition: giop.h:165
float * aph_tab_w
Definition: giop.h:112
int bbph_tab_nw
Definition: giop.h:151
float ** uacdom_tab_s
Definition: giop.h:138
float ** uadg_tab_s
Definition: giop.h:122
float ** acdom_tab_s
Definition: giop.h:137