def check_lat(self, dataset):
        '''
        float lat(time) ;//....................................... Depending on the precision used for the variable, the data type could be int or double instead of float.
                lat:long_name = "" ; //...................................... RECOMMENDED - Provide a descriptive, long name for this variable.
                lat:standard_name = "latitude" ; //.......................... REQUIRED    - Do not change.
                lat:units = "degrees_north" ; //............................. REQUIRED    - CF recommends degrees_north, but at least must use UDUNITS.
                lat:axis = "Y" ; //.......................................... REQUIRED    - Do not change.
                lat:valid_min = 0.0f ; //.................................... RECOMMENDED - Replace with correct value.
                lat:valid_max = 0.0f ; //.................................... RECOMMENDED - Replace with correct value.
                lat:_FillValue = 0.0f;//..................................... REQUIRED  if there could be missing values in the data.
                lat:ancillary_variables = "" ; //............................ RECOMMENDED - List other variables providing information about this variable.
                lat:comment = "" ; //........................................ RECOMMENDED - Add useful, additional information here.
        '''

        results = []
        lat = util.get_lat_variable(dataset)
        if not lat:
            return Result(BaseCheck.HIGH, False, 'latitude', ['a variable for latitude doesn\'t exist'])
        lat_var = dataset.variables[lat]
        test_ctx = TestCtx(BaseCheck.HIGH, 'Required attributes for variable {}'.format(lat))
        test_ctx.assert_true(getattr(lat_var, 'standard_name', '') == 'latitude', 'standard_name attribute must be latitude')
        units = getattr(lat_var, 'units', '')
        test_ctx.assert_true(units and units_convertible(units, 'degrees_north'), 'units are valid UDUNITS for latitude')
        test_ctx.assert_true(getattr(lat_var, 'axis', '') == 'Y', '{} axis attribute must be Y'.format(lat))

        results.append(test_ctx.to_result())

        test_ctx = TestCtx(BaseCheck.MEDIUM, 'Recommended attributes for variable {}'.format(lat))
        test_ctx.assert_true(getattr(lat_var, 'long_name', '') != '', 'long_name attribute should exist and not be empty')
        self._check_min_max_range(lat_var, test_ctx)
        if hasattr(lat_var, 'comment'):
            test_ctx.assert_true(getattr(lat_var, 'comment', '') != '', 'comment attribute should not be empty if specified')
        test_ctx.assert_true(getattr(lat_var, 'comment', '') != '', 'comment attribute should exist and not be empty')
        test_ctx.assert_true(units == 'degrees_north', '{} should have units degrees_north'.format(lat))
        results.append(test_ctx.to_result())
        return results
def check_lat ( self , dataset ) : results = [ ] lat = util . get_lat_variable ( dataset ) if not lat : return Result ( BaseCheck . HIGH , False , 'latitude' , [ 'a variable for latitude doesn\'t exist' ] ) lat_var = dataset . variables [ lat ] test_ctx = TestCtx ( BaseCheck . HIGH , 'Required attributes for variable {}' . format ( lat ) ) test_ctx . assert_true ( getattr ( lat_var , 'standard_name' , '' ) == 'latitude' , 'standard_name attribute must be latitude' ) units = getattr ( lat_var , 'units' , '' ) test_ctx . assert_true ( units and units_convertible ( units , 'degrees_north' ) , 'units are valid UDUNITS for latitude' ) test_ctx . assert_true ( getattr ( lat_var , 'axis' , '' ) == 'Y' , '{} axis attribute must be Y' . format ( lat ) ) results . append ( test_ctx . to_result ( ) ) test_ctx = TestCtx ( BaseCheck . MEDIUM , 'Recommended attributes for variable {}' . format ( lat ) ) test_ctx . assert_true ( getattr ( lat_var , 'long_name' , '' ) != '' , 'long_name attribute should exist and not be empty' ) self . _check_min_max_range ( lat_var , test_ctx ) if hasattr ( lat_var , 'comment' ) : test_ctx . assert_true ( getattr ( lat_var , 'comment' , '' ) != '' , 'comment attribute should not be empty if specified' ) test_ctx . assert_true ( getattr ( lat_var , 'comment' , '' ) != '' , 'comment attribute should exist and not be empty' ) test_ctx . assert_true ( units == 'degrees_north' , '{} should have units degrees_north' . format ( lat ) ) results . append ( test_ctx . to_result ( ) ) return results
float lat(time) ;//....................................... Depending on the precision used for the variable, the data type could be int or double instead of float.
                lat:long_name = "" ; //...................................... RECOMMENDED - Provide a descriptive, long name for this variable.
                lat:standard_name = "latitude" ; //.......................... REQUIRED    - Do not change.
                lat:units = "degrees_north" ; //............................. REQUIRED    - CF recommends degrees_north, but at least must use UDUNITS.
                lat:axis = "Y" ; //.......................................... REQUIRED    - Do not change.
                lat:valid_min = 0.0f ; //.................................... RECOMMENDED - Replace with correct value.
                lat:valid_max = 0.0f ; //.................................... RECOMMENDED - Replace with correct value.
                lat:_FillValue = 0.0f;//..................................... REQUIRED  if there could be missing values in the data.
                lat:ancillary_variables = "" ; //............................ RECOMMENDED - List other variables providing information about this variable.
                lat:comment = "" ; //........................................ RECOMMENDED - Add useful, additional information here.