OB.DAAC Logo
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 
31 /* aph function types */
32 #define APHTAB 0
33 #define APHGAUSS 1
34 #define APHBRICAUD 2
35 #define APHCIOTTI 3
36 
37 
38 /* acdom function type*/
39 #define ACDOMTAB 0
40 #define ACDOMNONE 1
41 
42 /* anap function type*/
43 #define ANAPTAB 0
44 #define ANAPNONE 1
45 
46 /* bbph function type*/
47 #define BBPHTAB 0
48 #define BBPHNONE 1
49 
50 /* bbnap function type*/
51 #define BBNAPTAB 0
52 #define BBNAPNONE 1
53 
54 
55 /* rrs function types */
56 #define RRSGRD 0
57 #define RRSFOQ 1
58 
59 typedef struct giop_ctl_str {
60  int npar; /* # optimized params */
61  int maxiter; /* max iterations */
62 
63  int fit_opt; /* optimization routine */
64  int aph_opt; /* aph function type */
65  int adg_opt; /* adg function type */
66  int bbp_opt; /* bbp function type */
67  int acdom_opt; /* acdom function type */
68  int anap_opt; /* anap function type */
69  int bbph_opt; /* bbph function type */
70  int bbnap_opt; /* bbnap function type */
71  int rrs_opt; /* rrs function type */
72  int wt_opt; /* do we have input wts */
73 
74  int nwave; /* # fit wavelengths */
75  float *wave; /* fit wavelengths [NBANDS] */
76  int *bindx; /* index to sensor wave [NBANDS]*/
77  float *aw; /* aw per fit wave [NBANDS] */
78  float *bbw; /* bbw per fit wave [NBANDS] */
79  float *wts; /* input Rrs wts [NBANDS] */
80 
81  int siopIdx; /*Optimal set of IOPs for svd_siop implementation*/
82 
83  float grd[2]; /* RRSGRD param */
84  float *foq; /* RRSFOQ variable [NBANDS] */
85  float aph_s; /* APHS spectral param */
86  float adg_s; /* ADGS spectral param */
87  float bbp_s; /* BBPS spectral param */
88  float aph_w; /* APHS referance wave */
89  float adg_w; /* ADGS reference wave */
90  float bbp_w; /* BBPS reference wave */
91 
92  float chl; /* Input chlorophyll */
93 
94  char aph_tab_file[FILENAME_MAX];
95  int aph_tab_nw; /* elements in aph tab */
96  float *aph_tab_w; /* aph tab wavelengths */
97  float **aph_tab_s; /* aph tab values */
98  int aph_nvec; /* number of eigenvect */
99 
100  char adg_tab_file[FILENAME_MAX];
101  int adg_tab_nw; /* elements in adg tab */
102  float *adg_tab_w; /* adg tab wavelengths */
103  float **adg_tab_s; /* adg tab values */
104  int adg_nvec; /* number of eigenvect */
105 
106  char anap_tab_file[FILENAME_MAX];
107  int anap_tab_nw; /* elements in anap tab */
108  float *anap_tab_w; /* anap tab wavelengths */
109  float **anap_tab_s; /* anap tab values */
110  int anap_nvec; /* number of eigenvect */
111 
112  char acdom_tab_file[FILENAME_MAX];
113  int acdom_tab_nw; /* elements in acdom tab */
114  float *acdom_tab_w; /* acdom tab wavelengths */
115  float **acdom_tab_s; /* acdom tab values */
116  int acdom_nvec; /* number of eigenvect */
117 
118  char bbp_tab_file[FILENAME_MAX];
119  int bbp_tab_nw; /* elements in bbp tab */
120  float *bbp_tab_w; /* bbp tab wavelengths */
121  float **bbp_tab_s; /* bbp tab values */
122  int bbp_nvec; /* number of eigenvect */
123 
124  char bbph_tab_file[FILENAME_MAX];
125  int bbph_tab_nw; /* elements in bbph tab */
126  float *bbph_tab_w; /* bbph tab wavelengths */
127  float **bbph_tab_s; /* bbph tab values */
128  int bbph_nvec; /* number of eigenvect */
129 
130  char bbnap_tab_file[FILENAME_MAX];
131  int bbnap_tab_nw; /* elements in bbnap tab */
132  float *bbnap_tab_w; /* bbnap tab wavelengths */
133  float **bbnap_tab_s; /* bbnap tab values */
134  int bbnap_nvec; /* number of eigenvect */
135 
136  double *par; /* starting params [NBANDS] */
137  double *len; /* characteristic length [NBANDS] */
138 
139 } giopstr;
140 
141 void set_giop_aph_s(giopstr *g, float aph_s);
142 void set_giop_adg_s(giopstr *g, float adg_s);
143 void set_giop_bbp_s(giopstr *g, float bbp_s);
144 void set_giop_aph_t(giopstr *g, float aphw[], float aphs[], int aphn);
145 
146 float* giop_get_chl_pointer();
147 float* giop_get_adg_pointer();
148 float* giop_get_aph_pointer();
149 float* giop_get_bbp_pointer();
150 float** giop_get_fitpar_pointer();
151 
152 void run_giop(l2str *l2rec);
153 
154 #endif
float ** giop_get_fitpar_pointer()
Definition: giop.c:2789
void run_giop(l2str *l2rec)
Definition: giop.c:1616
int bbp_opt
Definition: giop.h:66
char bbp_tab_file[FILENAME_MAX]
Definition: giop.h:118
int bbph_opt
Definition: giop.h:69
float ** bbnap_tab_s
Definition: giop.h:133
float ** bbph_tab_s
Definition: giop.h:127
int * bindx
Definition: giop.h:76
float * acdom_tab_w
Definition: giop.h:114
int fit_opt
Definition: giop.h:63
float * bbph_tab_w
Definition: giop.h:126
int acdom_opt
Definition: giop.h:67
int bbp_tab_nw
Definition: giop.h:119
char aph_tab_file[FILENAME_MAX]
Definition: giop.h:94
void set_giop_aph_s(giopstr *g, float aph_s)
float * bbp_tab_w
Definition: giop.h:120
int bbph_nvec
Definition: giop.h:128
void set_giop_bbp_s(giopstr *g, float bbp_s)
float * wts
Definition: giop.h:79
float ** adg_tab_s
Definition: giop.h:103
int adg_tab_nw
Definition: giop.h:101
float aph_s
Definition: giop.h:85
float bbp_s
Definition: giop.h:87
int acdom_tab_nw
Definition: giop.h:113
int bbnap_tab_nw
Definition: giop.h:131
int maxiter
Definition: giop.h:61
float aph_w
Definition: giop.h:88
float * anap_tab_w
Definition: giop.h:108
void set_giop_adg_s(giopstr *g, float adg_s)
double * len
Definition: giop.h:137
float * bbw
Definition: giop.h:78
int wt_opt
Definition: giop.h:72
int adg_nvec
Definition: giop.h:104
char adg_tab_file[FILENAME_MAX]
Definition: giop.h:100
int aph_nvec
Definition: giop.h:98
void set_giop_aph_t(giopstr *g, float aphw[], float aphs[], int aphn)
int bbnap_opt
Definition: giop.h:70
float ** bbp_tab_s
Definition: giop.h:121
int bbnap_nvec
Definition: giop.h:134
int aph_tab_nw
Definition: giop.h:95
int siopIdx
Definition: giop.h:81
float * giop_get_aph_pointer()
Definition: giop.c:2782
int adg_opt
Definition: giop.h:65
int anap_nvec
Definition: giop.h:110
float adg_w
Definition: giop.h:89
int npar
Definition: giop.h:60
int anap_opt
Definition: giop.h:68
float * foq
Definition: giop.h:84
int nwave
Definition: giop.h:74
float ** anap_tab_s
Definition: giop.h:109
int anap_tab_nw
Definition: giop.h:107
float * giop_get_chl_pointer()
Definition: giop.c:2761
int acdom_nvec
Definition: giop.h:116
int bbp_nvec
Definition: giop.h:122
int aph_opt
Definition: giop.h:64
float adg_s
Definition: giop.h:86
float * giop_get_adg_pointer()
Definition: giop.c:2768
char bbnap_tab_file[FILENAME_MAX]
Definition: giop.h:130
float grd[2]
Definition: giop.h:83
float * giop_get_bbp_pointer()
Definition: giop.c:2775
float chl
Definition: giop.h:92
char acdom_tab_file[FILENAME_MAX]
Definition: giop.h:112
char anap_tab_file[FILENAME_MAX]
Definition: giop.h:106
float * adg_tab_w
Definition: giop.h:102
float * bbnap_tab_w
Definition: giop.h:132
float * aw
Definition: giop.h:77
float * wave
Definition: giop.h:75
int rrs_opt
Definition: giop.h:71
char bbph_tab_file[FILENAME_MAX]
Definition: giop.h:124
float bbp_w
Definition: giop.h:90
float ** aph_tab_s
Definition: giop.h:97
double * par
Definition: giop.h:136
float * aph_tab_w
Definition: giop.h:96
int bbph_tab_nw
Definition: giop.h:125
float ** acdom_tab_s
Definition: giop.h:115