Thanks for all your wonderful work, this tool is amazing!
I am trying to copy heavy files of extension .nc.1 from one directory
into another, retaining (extracting) only certain variables which concern
me. The command:
ncks -H time,0,30 -v temp,u,v in.nc.1 out.nc.1
worked and gave me an output file with the right variables and coordinates.
The only issue is that the record dimension - time (UNLIMITED, currently
31) is reduced to size 0 in out.nc.1 and thus none of my data are
actually accessible. I was unable to locate any description of such an
issue in the manual.
I was able to replicate this exact problem with another file in the
original directory with an .nc extension (... in.nc out.nc).
First, the filename extension (.nc or .nc.1) has nothing to do with the operator behavior. It is more likely a clue to how the file was obtained (via download rather than created from scratch). In any case, your command is syntactically correct and the result is unexpected. It is up to you to provide a minimal working example that reproduces the problem. From that, we can probably diagnose what's going wrong.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your reply. I am attaching screenshots of an example, which I
hope are sufficient to figure things out. The screenshots show dimensions
from an ncdump of the in file ("Example_1.png"), the ncks command,
and then the dimensions from an ncdump of the out file ("Example_2.png").
You can see that the other dimensions are appropriately sliced except for time - the record dimension.
Further note that this behaviour persists even if I do not specify -d
time,0,29 (starting directly with the other coordinates). In fact, the time dimension is of size zero in the output even if I do simply ncks -H
in out. ("Example_3.png"). The issue is, that while I want the entire
range of time, I need only a small box in space.
First, the filename extension (.nc or .nc.1) has nothing to do with the
operator behavior. It is more likely a clue to how the file was obtained
(via download rather than created from scratch). In any case, your command
is syntactically correct and the result is unexpected. It is up to you to
provide a minimal working example that reproduces the problem. From that,
we can probably diagnose what's going wrong.
Thanks for your reply. I am attaching screenshots of an example, which I hope are sufficient to figure things out. The screenshots show dimensions from an ncdump of the in file ("Example_1.png"), the ncks command, and then the dimensions from an ncdump of the out file ("Example_2.png"). You can see that the other dimensions are appropriately sliced except for time - the record dimension.
Further note that this behaviour persists even if I do not specify -d time,0,29 (starting directly with the other coordinates). In fact, the time dimension is of size zero in the output even if I do simply ncks -H in out. ("Example_3.png"). The issue is, that while I want the entire range of time, I need only a small box in space.
The problem appears to be caused by including the -H option. Eliminate it and re-try. -H is superfluous for your intended action. -H is intended to control printed (not disk) output, but apparently it has this unfortunate side effect which needs further investigation.
Charlie
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear NCO team,
Thanks for all your wonderful work, this tool is amazing!
I am trying to copy heavy files of extension
.nc.1from one directoryinto another, retaining (extracting) only certain variables which concern
me. The command:
ncks -H time,0,30 -v temp,u,v in.nc.1 out.nc.1
worked and gave me an output file with the right variables and coordinates.
The only issue is that the record dimension -
time(UNLIMITED, currently31) is reduced to size 0 in
out.nc.1and thus none of my data areactually accessible. I was unable to locate any description of such an
issue in the manual.
I was able to replicate this exact problem with another file in the
original directory with an
.ncextension (... in.nc out.nc).Thanks in advance,
Akash
First, the filename extension (
.ncor.nc.1) has nothing to do with the operator behavior. It is more likely a clue to how the file was obtained (via download rather than created from scratch). In any case, your command is syntactically correct and the result is unexpected. It is up to you to provide a minimal working example that reproduces the problem. From that, we can probably diagnose what's going wrong.Dear Zender,
Thanks for your reply. I am attaching screenshots of an example, which I
hope are sufficient to figure things out. The screenshots show dimensions
from an
ncdumpof theinfile ("Example_1.png"), thenckscommand,and then the dimensions from an
ncdumpof the out file ("Example_2.png").You can see that the other dimensions are appropriately sliced except for
time- the record dimension.Further note that this behaviour persists even if I do not specify
-d time,0,29(starting directly with the other coordinates). In fact, thetimedimension is of size zero in the output even if I do simplyncks -H in out. ("Example_3.png"). The issue is, that while I want the entirerange of
time, I need only a small box in space.Thanks a ton,
Akash
On Mon, Nov 27, 2023 at 7:53 PM Charlie Zender zender@users.sourceforge.net
wrote:
Dear Zender,
Thanks for your reply. I am attaching screenshots of an example, which I hope are sufficient to figure things out. The screenshots show dimensions from an
ncdumpof the in file ("Example_1.png"), thenckscommand, and then the dimensions from anncdumpof the out file ("Example_2.png"). You can see that the other dimensions are appropriately sliced except fortime- the record dimension.Further note that this behaviour persists even if I do not specify
-d time,0,29(starting directly with the other coordinates). In fact, thetimedimension is of size zero in the output even if I do simplyncks -H in out. ("Example_3.png"). The issue is, that while I want the entire range oftime, I need only a small box in space.Thanks a ton!
Last edit: Akash Dutta 2023-11-29
Hi Akash,
The problem appears to be caused by including the
-Hoption. Eliminate it and re-try.-His superfluous for your intended action.-His intended to control printed (not disk) output, but apparently it has this unfortunate side effect which needs further investigation.Charlie