ArgoCanada / medsrtqc

An experimental container for Argo Canada realtime quality control code
https://argocanada.github.io/medsrtqc/
MIT License
0 stars 1 forks source link

CHLA spike test #5

Closed cgrdn closed 2 years ago

cgrdn commented 2 years ago

Test set up to find negative spikes, as positive spikes contain valid information.

Calculate the residual between the profile and a 5-point running median filter:

RES = CHLA(z0) - median(z0 - 2 : z0 + 2)

Then, calculate the 10th percentile of the difference. If RES is smaller than 2 times the 10th percentile, it is considered a spike:

[1] RES < 2*percentile(RES, 10)

if [1] is TRUE, CHLA_QC = 4 at that point.