# Path: cotede/qctests/qctests.py
# def frozen_profile():
# def grey_list():
# def valid_speed():
# def gross_sensor_drift():
# def platform_identification():
# 
# Path: cotede/qctests/gradient.py
# def curvature(x):
#     """Curvature of a timeseries
# 
#     This test is commonly known as gradient for historical reasons, but that
#     is a bad name choice since it is not the actual gradient, like:
#     d/dx + d/dy + d/dz,
#     but as defined by GTSPP, EuroGOOS and others, which is actually the
#     curvature of the timeseries..
# 
#     Note
#     ----
#     - Pandas.Series operates with indexes, so it should be done different. In
#       that case, call for _curvature_pandas.
#     """
#     if isinstance(x, ma.MaskedArray):
#         x[x.mask] = np.nan
#         x = x.data
# 
#     if PANDAS_AVAILABLE and isinstance(x, pd.Series):
#         return _curvature_pandas(x)
# 
#     x = np.atleast_1d(x)
#     y = np.nan * x
#     y[1:-1] = x[1:-1] - (x[:-2] + x[2:]) / 2.0
#     return y


import logging
import numpy as np
from numpy import ma
from .qctests import QCCheckVar
from .gradient import curvature
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst

"""

"""




module_logger = logging.getLogger(__name__)


class GradientDepthConditional(QCCheckVar):
    def set_features(self):

# Path: cotede/qctests/qctests.py
# def frozen_profile():
# def grey_list():
# def valid_speed():
# def gross_sensor_drift():
# def platform_identification():
# 
# Path: cotede/qctests/gradient.py
# def curvature(x):
#     """Curvature of a timeseries
# 
#     This test is commonly known as gradient for historical reasons, but that
#     is a bad name choice since it is not the actual gradient, like:
#     d/dx + d/dy + d/dz,
#     but as defined by GTSPP, EuroGOOS and others, which is actually the
#     curvature of the timeseries..
# 
#     Note
#     ----
#     - Pandas.Series operates with indexes, so it should be done different. In
#       that case, call for _curvature_pandas.
#     """
#     if isinstance(x, ma.MaskedArray):
#         x[x.mask] = np.nan
#         x = x.data
# 
#     if PANDAS_AVAILABLE and isinstance(x, pd.Series):
#         return _curvature_pandas(x)
# 
#     x = np.atleast_1d(x)
#     y = np.nan * x
#     y[1:-1] = x[1:-1] - (x[:-2] + x[2:]) / 2.0
#     return y


# Path: cotede/qctests/gradient_depthconditional.py
import logging
import numpy as np
from numpy import ma
from .qctests import QCCheckVar
from .gradient import curvature

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst

"""

"""




module_logger = logging.getLogger(__name__)


class GradientDepthConditional(QCCheckVar):
    def set_features(self):

        self.features = {"gradient": curvature(self.data[self.varname])}