# Path: cotede/qctests/core.py
# class QCCheckVar(QCCheck):
#     """Template for a QC check of a specific variable
#     """
# 
#     def __init__(self, data, varname, cfg=None, autoflag=True, attrs=None):
#         self.varname = varname
#         super().__init__(data=data, cfg=cfg, autoflag=autoflag, attrs=attrs)


import logging
import numpy as np
    import pandas as pd
from numpy import ma
from cotede.qctests import QCCheckVar
        u2[n + 1] = np.median(u1[n : n + 3])

    u3 = np.nan * np.ones(N)
    u3[1:-1] = 0.25 * (u2[:-2] + 2 * u2[1:-1] + u2[2:])

    delta = np.nan * np.ones(N)
    delta[1:-1] = x[1:-1] - u3[1:-1]

    if not normalize:
        return delta

    idx = ~np.isnan(u1)
    if idx.all():
        return np.nan * delta
    sigma = np.std(u1[idx], ddof=1)
    return delta / sigma


def tukey53H_norm(x, l=12):
    """Spike test Tukey53H() normalized by the std of the low pass

    ATTENTION: l option is temporarily deactivated.

       l is the number of observations. The default l=12 is trully not
         a big number, but this test foccus on spikes, therefore, any
         variability longer than 12 is something else.
    """
    return tukey53H(x, normalize=True)



# Path: cotede/qctests/core.py
# class QCCheckVar(QCCheck):
#     """Template for a QC check of a specific variable
#     """
# 
#     def __init__(self, data, varname, cfg=None, autoflag=True, attrs=None):
#         self.varname = varname
#         super().__init__(data=data, cfg=cfg, autoflag=autoflag, attrs=attrs)


# Path: cotede/qctests/tukey53H.py
import logging
import numpy as np
    import pandas as pd
from numpy import ma
from cotede.qctests import QCCheckVar

        u2[n + 1] = np.median(u1[n : n + 3])

    u3 = np.nan * np.ones(N)
    u3[1:-1] = 0.25 * (u2[:-2] + 2 * u2[1:-1] + u2[2:])

    delta = np.nan * np.ones(N)
    delta[1:-1] = x[1:-1] - u3[1:-1]

    if not normalize:
        return delta

    idx = ~np.isnan(u1)
    if idx.all():
        return np.nan * delta
    sigma = np.std(u1[idx], ddof=1)
    return delta / sigma


def tukey53H_norm(x, l=12):
    """Spike test Tukey53H() normalized by the std of the low pass

    ATTENTION: l option is temporarily deactivated.

       l is the number of observations. The default l=12 is trully not
         a big number, but this test foccus on spikes, therefore, any
         variability longer than 12 is something else.
    """
    return tukey53H(x, normalize=True)



class Tukey53H(QCCheckVar):