ncks ignores user-specified chunk size
Command-line operators for netCDF and HDF files
Brought to you by:
zender
$ ncks --version
NCO netCDF Operators version 4.5.4 built by buildd on lgw01-02 at Jan 28 2016 22:33:25
ncks version "4.5.4"
I want to have a file that is chunked by 2D fields. I do
$ ncks -4 -L9 --cnk_dmn time,1 in200x200.nc in200x200.nc4
The command generates a file with the main variable chunked like
CO:_ChunkSizes = 80, 114, 114
Is it a bug or a feature?
Thank you!
Diff:
Maybe it's just a poor API or bad documentation. Thank you for reporting. The rd1 chunk map does what you want:
ncks -O -4 -L9 --cnk_map rd1 in200x200.nc in200x200.nc4To get NCO to use the explicitly set chunk sizes for each dimension, use --cnk_map=dmn
ncks -O -4 -L9 --cnk_map=dmn --cnk_dmn time,1 in200x200.nc in200x200.nc4This also results in the chunking you want.
Thank you (also fot the great toolset)! That works.
I believe that ignoring of an option explicitly specified by a user is an excuse for at least a big warning. Indeed, I would make a program to apply --cnk_map=dmn if any of --cnk_dmn is specified and no cnk_map explicitly requested. If both are specified, then exit with error is a valid option. Then the behaviour of the program would be more understandable...
BTW, your diff loks like a removal of an empty line. Is it what you intended to do?
I agree. It's not intuitive. We'll try to change it as you suggest. Ignore the diff, I don't know what that's about.
:) Thank you!