Skip to content
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

netcdf encoding "significant_digits" rather than least_significant_digit #7634

Closed
axelschweiger opened this issue Mar 16, 2023 · 3 comments
Closed

Comments

@axelschweiger
Copy link

axelschweiger commented Mar 16, 2023

Is your feature request related to a problem?

The most current version of xarray only seems to support the "least_significant_digit" compression. As of version 1.6.0. of netcdf4-python, thee option to specify "significant_digits" is available. This allows specifying the total number of digits rather than the digits after the the decimal point and is therefore independent of magnitude.
https://unidata.github.io/netcdf4-python/#Variable.quantization

Describe the solution you'd like

Allow

ncoding={myvar:{'dtype':'float32', 'zlib': True, 'complevel':5, 'significant_digit':7},
                      'time':{'units': 'days since 1800-01-01'}}

Describe alternatives you've considered

No response

Additional context

No response

@nishtha981
Copy link
Contributor

Hey!
I'm an Outreachy applicant. Can I be assigned this issue?

@keewis
Copy link
Collaborator

keewis commented Mar 22, 2023

we don't usually assign issues, so you're free to just submit a pull request (don't forget to add tests that verify the new encoding actually works, though)

@dcherian
Copy link
Contributor

There are some in-progress PRs that might fix this as a side effect, but thanks for chekcing @nishtha981 !

markelg added a commit to markelg/xarray that referenced this issue Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants