Skip to content

Add quantization algorithms to reserved attributes #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sfinkens
Copy link

Fix cfchecker reporting invalid quantization attributes by adding three new reserved attributes.

Starting with version 4.9.0, libnetcdf offers three quantization algorithms. When enabled, they add one of the following attributes to the quantized variable

Algorithm Attribute
Bit Groom _QuantizeBitGroomNumberOfSignificantDigits
Granular Bit Round _QuantizeGranularBitRoundNumberOfSignificantDigits
Bit Round _QuantizeBitRoundNumberOfSignificantBits

I also added a small test file for this:

netcdf quantization {
dimensions:
        x = 3 ;
variables:
        double bit_groom(x) ;
                bit_groom:_QuantizeBitGroomNumberOfSignificantDigits = 2 ;
                bit_groom:_FillValue = NaN ;
                bit_groom:standard_name = "air_temperature" ;
                bit_groom:units = "K" ;
        double bit_round(x) ;
                bit_round:_QuantizeBitRoundNumberOfSignificantBits = 2 ;
                bit_round:_FillValue = NaN ;
                bit_round:standard_name = "air_temperature" ;
                bit_round:units = "K" ;
        double granular_bit_round(x) ;
                granular_bit_round:_QuantizeGranularBitRoundNumberOfSignificantDigits = 2 ;
                granular_bit_round:_FillValue = NaN ;
                granular_bit_round:standard_name = "air_temperature" ;
                granular_bit_round:units = "K" ;

// global attributes:
                :comment = "Test file with quantized data variables" ;
                :Conventions = "CF-1.8" ;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant