ioos/compliance-checker

Improve CF Conformance: 2.5.1 Missing data, valid and actual range of data

jamesdoyle21 opened this issue · 1 comments

2.5.1 Missing data, valid and actual range of data
Requirements:

  • The valid_range attribute must not be present if the valid_min and/or valid_max attributes are present.

Note: no function checks for the presence of valid_range together with valid_min/or valid_max.
*@benjwadams note: The function check_valid_range_or_valid_min_max_present in cf_1.6.py addresses this.

  • The _FillValue attribute must be the same type as its associated variable.

  • The missing_value attribute must be the same type as its associated variable.

  • The actual_range attribute must be of the same type as its associated variable unless there is a scale_factor and/or add_offset attribute, in which case it must be of the same type as those attributes.

  • The actual_range attribute must have two elements, of which the first exactly equals the minimum non-missing value occurring in the associated variable after any scale_factor and add_offset are applied, and the second exactly equals the maximum value in the same way.

  • There must not be an actual_range attribute if all the data values of the associated variable equal the missing value.

Note: If a variable has an actual_range attribute function check_actual_range checks equality to existing min/max values.

  • If both the actual_range and valid_range/valid_min/valid_max are specified, the values of the actual_range must be valid values.

Recommendations:

  • The value of the _FillValue attribute should not be within a specified valid range.

This is checked in two cases:

  • Fill Values should be outside the range specified by valid_range (if used) for a variable.

  • Fill Values should be outside the range specified by valid_min/valid_max (if used) for a variable.

  • If both missing_value and _FillValue be used, they should have the same value.

Note: no function checks for missing value and _FillValue equality.

Implementation finished.