very simple fix, but will require re-running RTQC on existing profiles, so documenting here
Mixed layer in the CHLA is calculated as the first time the difference in density is greater than 0.03 kg m-3, below 10m. However, because the profiles are reported bottom-to-surface, density is always decreasing. This is a problem because the logic to find the mixed layer is written as:
The first difference is given by out[i] = a[i+1] - a[i] along the given axis, higher differences are calculated by using diff recursively.
So, since density is monotonically increasing with depth, np.diff(density) will always be negative. Therefore, a mixed layer is never found, and in that case CHLA_QC is set to 2.
This is fixed by taking absolute value of density difference, some logic will need to be re-arranged.
very simple fix, but will require re-running RTQC on existing profiles, so documenting here
Mixed layer in the CHLA is calculated as the first time the difference in density is greater than 0.03 kg m-3, below 10m. However, because the profiles are reported bottom-to-surface, density is always decreasing. This is a problem because the logic to find the mixed layer is written as:
np.diff
is defined as:So, since density is monotonically increasing with depth,
np.diff(density)
will always be negative. Therefore, a mixed layer is never found, and in that case CHLA_QC is set to 2.This is fixed by taking absolute value of density difference, some logic will need to be re-arranged.