Feature/offset scale outputs - #230
Conversation
Release 5.0.0
…jrc/lisflood-code into feature/offset_scale_outputs
| nc_var = nf1.variables[self.map_name] | ||
| is_packed = nc_var.dtype == np.int16 | ||
| if is_packed: | ||
| nc_var.set_auto_maskandscale(False) |
There was a problem hiding this comment.
We should double check the behavior of this line with the missing value. Maybe unit tests can help here to avoid issues
There was a problem hiding this comment.
Yes I fully agree, in our teams conversation I think you said you will take care right, but in any case if your schedule doesnt allow just let me know and I will start :)
There was a problem hiding this comment.
I already started it, don’t worry
| self._accum_count = 0 | ||
| self._write_step = 0 # own step counter for NetCDF time dimension | ||
|
|
||
| # Disable int16 packing for aggregated outputs — scale/offset ranges |
There was a problem hiding this comment.
Why? Scale and offset should be customizable, therefore we should still be able to set proper values. Furthermore, for mean aggregates there should be no issue of overflowing
There was a problem hiding this comment.
I agree, and the logic from teams makes totally sense to me! I might implement customization then now directly for the 5.1 release if u think it is not too much of a change in the xml etc.?
There was a problem hiding this comment.
XML will not change unless you need to specify different scale and offset for a specific variable
…s as test were failing for overflow
…p scal value instead of down to avoid min upper than zero.
This PR adds the scale, offset and aggregation features