def test_dataqc_globalrangetest(self):
        """
        Test of the Golbal Range Test function.

        Test values based on those defined in DPS:

        OOI (2012). Data Product Specification for Global Range Test. Document
            Control Number 1341-10004. https://alfresco.oceanobservatories.org/
            (See: Company Home >> OOI >> Controlled >> 1000 System Level >>
            1341-10004_Data_Product_SPEC_GLBLRNG_OOI.pdf)

        Implemented by Christopher Wingard, April 2013
        """
        x = [9, 10, 16, 17, 18, 19, 20, 25]
        lim = [10, 20]
        out = [0, 1, 1, 1, 1, 1, 1, 0]

        got = qcfunc.dataqc_globalrangetest(x, lim)

        self.assertTrue(np.array_equal(got, out))
    def test_dataqc_globalrangetest(self):
        """
        Test of the Golbal Range Test function.

        Test values based on those defined in DPS:

        OOI (2012). Data Product Specification for Global Range Test. Document
            Control Number 1341-10004. https://alfresco.oceanobservatories.org/
            (See: Company Home >> OOI >> Controlled >> 1000 System Level >>
            1341-10004_Data_Product_SPEC_GLBLRNG_OOI.pdf)

        Implemented by Christopher Wingard, April 2013
        """
        x = [9, 10, 16, 17, 18, 19, 20, 25]
        lim = [10, 20]
        out = [0, 1, 1, 1, 1, 1, 1, 0]

        got = qcfunc.dataqc_globalrangetest(x, lim)

        self.assertTrue(np.array_equal(got, out))
Esempio n. 3
0
    def process_glblrng(self, coverage, parameter, input_name, min_value, max_value):
        '''
        Evaluates the QC for global range for all data values that equal -88 (not yet evaluated)
        '''
        log.error("input name: %s", input_name)
        log.info("Num timesteps: %s", coverage.num_timesteps)

        # Get all of the QC values, and find where -88 is set (uninitialized)
        qc_array = coverage.get_parameter_values(parameter.name)
        indexes = np.where( qc_array == -88 )[0]

        # Now build a variable, but I need to keep track of the time where the data goes
        time_array = coverage.get_parameter_values(coverage.temporal_parameter_name)[indexes]
        value_array = coverage.get_parameter_values(input_name)[indexes]

        from ion_functions.qc.qc_functions import dataqc_globalrangetest
        qc = dataqc_globalrangetest(value_array, [min_value, max_value])
        return_dictionary = {
                coverage.temporal_parameter_name : time_array,
                parameter.name : qc
        }
    def process_glblrng(self, coverage, parameter, input_name, min_value,
                        max_value):
        '''
        Evaluates the QC for global range for all data values that equal -88 (not yet evaluated)
        '''
        log.error("input name: %s", input_name)
        log.info("Num timesteps: %s", coverage.num_timesteps)

        # Get all of the QC values, and find where -88 is set (uninitialized)
        qc_array = self.get_parameter_values(coverage, parameter.name)
        indexes = np.where(qc_array == -88)[0]

        # Now build a variable, but I need to keep track of the time where the data goes
        time_array = self.get_parameter_values(
            coverage, coverage.temporal_parameter_name)[indexes]
        value_array = self.get_parameter_values(coverage, input_name)[indexes]

        from ion_functions.qc.qc_functions import dataqc_globalrangetest
        qc = dataqc_globalrangetest(value_array, [min_value, max_value])
        return_dictionary = {
            coverage.temporal_parameter_name: time_array,
            parameter.name: qc
        }