Problems verifying SeaDAS implementation of QAA
Posted: Mon Oct 21, 2019 12:58 pm America/New_York
Hi - I have converted the SeaDAS QAA code (qaa.c and get_qaa.c in l2gen msl12 9.5.0-V2019.3 (Aug 16 2019 13:00:37)) to run in R. To be sure I got things right in the translation, I did the following experiment (based on MODIS data). I generated a large set L2 files adding the products a_488_qaa, bbp_488_qaa, bb_488_qaa, and b_488_qaa to the output. Then I used the Rrs_{nnn} values from that same set of files to drive my QAA.R code which outputs these same products. In an ideal world (I thought) the values of these products from my R code would exactly (or pretty close to exactly) match those generated by SeaDAS. Alas, that turns out not to be the case. I've gone over my code many, many times and although there might be some bug(s) that I've missed, there are a few things about the SeaDAS output itself that I don't understand. I'm hoping that if I describe my results someone might provide some insight into the source(s) of the discrepancies.
First: Although the SeaDAS code get_qaa.c shows that b_488_qaa should be a linear function of bb_488_qaa, this is only true for values of bb_488_qaa < 0.107865 above which SeaDAS outputs b_488_qaa as a constant with value 5.7767. I haven't found anything in the SeaDAS source that would account for this. It must be there somewhere, but where (and why)?
Second: bb_488_qaa is simply the sum of bbp_488_qaa and bbw_488. Since bbw_488 is a constant (as noted in the reply to one of my earlier queries, https://oceancolor.gsfc.nasa.gov/forum/oceancolor/topic_show.pl?dln=28423;pid=47947) the difference (bb_488_qaa - bbp_488_qaa) should equal bbw_488. However, it does not. The value of bbw_488 is given (in the L2 header) as 0.001437299 but the differences range from 0.00108 to 0.00144 with the most common value (about half the observations) being 0.001435. This may be a small point, but again, why doesn't the difference equal a single value equal to what is supposed to be the input value of bbw_488?
Finally: When comparing my R results to the SeaDAS results, I find that they (a, bbp) agree pretty much as expected (slope~=1, intercept~=0, r^2=1) only for the cases when Rrs_667 >= 0.0015. For cases below that Rrs_667 value the slope of my a_R vs SeaDAS a_488_qaa is 0.7948, the intercept is 0.005728 and the r^2 value is 0.957. Beside the non-unity slope, the increased scatter seems curious insofar as both my code and SeaDAS are (presumably) using the same input Rrs spectra. Because there is a switch in the QAA(v6) algorithm from one reference wavelength to another based on the value of Rrs_667 this was an obvious place to look for a problem in my code, but I've gone over it several time without finding an error in coding. So, I guess I want to know if it is possible that the qaa.c source does not correspond to the qaa routine actually implemented in SeaDAS and also whether anyone else has attempted an independent verification of the SeaDAS QAA products.
Thanks!
First: Although the SeaDAS code get_qaa.c shows that b_488_qaa should be a linear function of bb_488_qaa, this is only true for values of bb_488_qaa < 0.107865 above which SeaDAS outputs b_488_qaa as a constant with value 5.7767. I haven't found anything in the SeaDAS source that would account for this. It must be there somewhere, but where (and why)?
Second: bb_488_qaa is simply the sum of bbp_488_qaa and bbw_488. Since bbw_488 is a constant (as noted in the reply to one of my earlier queries, https://oceancolor.gsfc.nasa.gov/forum/oceancolor/topic_show.pl?dln=28423;pid=47947) the difference (bb_488_qaa - bbp_488_qaa) should equal bbw_488. However, it does not. The value of bbw_488 is given (in the L2 header) as 0.001437299 but the differences range from 0.00108 to 0.00144 with the most common value (about half the observations) being 0.001435. This may be a small point, but again, why doesn't the difference equal a single value equal to what is supposed to be the input value of bbw_488?
Finally: When comparing my R results to the SeaDAS results, I find that they (a, bbp) agree pretty much as expected (slope~=1, intercept~=0, r^2=1) only for the cases when Rrs_667 >= 0.0015. For cases below that Rrs_667 value the slope of my a_R vs SeaDAS a_488_qaa is 0.7948, the intercept is 0.005728 and the r^2 value is 0.957. Beside the non-unity slope, the increased scatter seems curious insofar as both my code and SeaDAS are (presumably) using the same input Rrs spectra. Because there is a switch in the QAA(v6) algorithm from one reference wavelength to another based on the value of Rrs_667 this was an obvious place to look for a problem in my code, but I've gone over it several time without finding an error in coding. So, I guess I want to know if it is possible that the qaa.c source does not correspond to the qaa routine actually implemented in SeaDAS and also whether anyone else has attempted an independent verification of the SeaDAS QAA products.
Thanks!