# Path: cotede/qctests/qctests.py
# def frozen_profile():
# def grey_list():
# def valid_speed():
# def gross_sensor_drift():
# def platform_identification():


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

"""

    Based on Timms 2011, p9597

    RoC(t) = x(t) - x(t-1)

"""





module_logger = logging.getLogger(__name__)


def rate_of_change(x):
    if isinstance(x, ma.MaskedArray):
        x[x.mask] = np.nan
        x = x.data

    y = np.nan * np.atleast_1d(x)
    y[1:] = np.diff(x)

    return y



# Path: cotede/qctests/qctests.py
# def frozen_profile():
# def grey_list():
# def valid_speed():
# def gross_sensor_drift():
# def platform_identification():


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

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

"""

    Based on Timms 2011, p9597

    RoC(t) = x(t) - x(t-1)

"""





module_logger = logging.getLogger(__name__)


def rate_of_change(x):
    if isinstance(x, ma.MaskedArray):
        x[x.mask] = np.nan
        x = x.data

    y = np.nan * np.atleast_1d(x)
    y[1:] = np.diff(x)

    return y



class RateOfChange(QCCheckVar):