Skip to content

NetCDF scale factor not being processed #1640

Locked Answered by JohnHalleyGotway
malloryprow asked this question in File I/O
Discussion options

You must be logged in to vote

Hi all, @j-opatz asked me to take a closer look at this. I suspect that this is the first time we've run across NetCDF files that specify the scale_factor but not add_offset. And that's why we're seeing this behavior.

On this line, the code is only parsing scale_factor and add_offset if BOTH are present. We could easily tweak that logic to process them independently.

I read a bit in the CF-conventions doc, and saw this comment:

If both scale_factor and add_offset attributes are present, the data are first scaled before the offset is added.

Based on that, I infer that neither, one, or both can be present, and they should be processed independently. I'll write up a bugfix issue about this.

I…

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@malloryprow
Comment options

malloryprow Jun 3, 2022
Collaborator Author

@barlage
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@barlage
Comment options

@JohnHalleyGotway
Comment options

Answer selected by JohnHalleyGotway
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: code optimization Code optimization issue
4 participants