Only perform NPQ correction if FLAG_MLD is FALSE. The test is not defined in the manual though??
Using RES calculated in #5, check where residual is greater than 2 times the 90th percentile of RES:
[1] RES > 2*percentile(RES, 90)
Next, calculate the NPQ depth, which is the depth at the maximum of the 5-pt median filtered. Ignore any depths where [1] is TRUE. This depth should be relatively near the surface, we check this by verifying that NPQ depth is within 90% of the MLD:
[2] depthNPQ < 0.9MLD
If [2] is TRUE, CHLA_ADJUSTED[0:depthNPQ] = CHLA_ADJUSTED[depthNPQ], CHLA_QC[0:depthNPQ] = 3, CHLA_ADJUSTED[0:depthNPQ] = 5.
Only perform NPQ correction if FLAG_MLD is FALSE. The test is not defined in the manual though??
Using RES calculated in #5, check where residual is greater than 2 times the 90th percentile of RES:
[1] RES > 2*percentile(RES, 90)
Next, calculate the NPQ depth, which is the depth at the maximum of the 5-pt median filtered. Ignore any depths where [1] is TRUE. This depth should be relatively near the surface, we check this by verifying that NPQ depth is within 90% of the MLD:
[2] depthNPQ < 0.9MLD
If [2] is TRUE, CHLA_ADJUSTED[0:depthNPQ] = CHLA_ADJUSTED[depthNPQ], CHLA_QC[0:depthNPQ] = 3, CHLA_ADJUSTED[0:depthNPQ] = 5.