aodn / imos-toolbox

Graphical tool for QC'ing and NetCDF'ing oceanographic datasets
GNU General Public License v3.0
46 stars 31 forks source link

SideLobeVelocitySetQC.m and wiki do not agree #776

Closed evacougnon closed 2 years ago

evacougnon commented 2 years ago

Question sent via email on 28/01/2022 to AODN

Need investigation and clarification in the wiki and/or(?) in the code

According to the Wiki the threshold is

contaminated depth = instrument depth - (instrument depth * cos(beam angle) + 1/2 * bin size)

continued by the statement: “Adding 1/2 of the size of a bin to the theoretical contaminated depth enables us to be conservative in order to make sure that the data in the first bin below the contaminated depth hasn't been computed from any contaminated signal.”

However, in the function imosSideLobeVelocitySetQC.m the calculation is: cDepth = distanceTransducerToObstacle - (distanceTransducerToObstacle * cos(sample_data.meta.beam_angle*pi/180) - nBinSize*BinSize);

preceded by the statement: “by default substraction of 1/2*BinSize to the non-contaminated height in order to be conservative and be sure that the first bin below the contaminated depth hasn't been computed from any contaminated signal”>

So the documentation and the calculation do not agree. For me it seems, the latter approach (substraction) is more conservative. What do you think?

evacougnon commented 2 years ago

Closing as the wiki was updated accordingly