Ejemplo n.º 1
0
 def test_profile_orthogonal(self):
     '''
     Ensures profile-orthogonal detection works
     '''
     with Dataset(resources.STATIC_FILES['profile-orthogonal']) as nc:
         for variable in util.get_geophysical_variables(nc):
             assert util.is_profile_orthogonal(nc, variable), "{} is profile-orthogonal".format(variable)
Ejemplo n.º 2
0
    def check_dimensions(self, dataset):
        '''
        Checks that the feature types of this dataset are consistent with a profile-orthogonal dataset.

        :param netCDF4.Dataset dataset: An open netCDF dataset
        '''
        results = []
        required_ctx = TestCtx(
            BaseCheck.HIGH,
            'All geophysical variables are profile-orthogonal feature types')

        message = '{} must be a valid profile-orthogonal feature type. It must have dimensions of (profile, depth).'
        message += ' x and y should have dimensions of (profile), z should have dimension of (depth) and t should have dimension (profile)'
        for variable in util.get_geophysical_variables(dataset):
            is_valid = util.is_profile_orthogonal(dataset, variable)
            required_ctx.assert_true(is_valid, message.format(variable))
        results.append(required_ctx.to_result())
        return results
Ejemplo n.º 3
0
    def check_dimensions(self, dataset):
        '''
        Checks that the feature types of this dataset are consistent with a profile-orthogonal dataset.

        :param netCDF4.Dataset dataset: An open netCDF dataset
        '''
        results = []
        required_ctx = TestCtx(BaseCheck.HIGH, 'All geophysical variables are profile-orthogonal feature types')

        message = '{} must be a valid profile-orthogonal feature type. It must have dimensions of (profile, depth).'
        message += ' x and y should have dimensions of (profile), z should have dimension of (depth) and t should have dimension (profile)'
        for variable in util.get_geophysical_variables(dataset):
            is_valid = util.is_profile_orthogonal(dataset, variable)
            required_ctx.assert_true(
                is_valid,
                message.format(variable)
            )
        results.append(required_ctx.to_result())
        return results