Menu

ncks reducing size of record dimension to 0

Help
2023-11-27
2023-11-29
  • Akash Dutta

    Akash Dutta - 2023-11-27

    Dear NCO team,

    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).

    Thanks in advance,
    Akash

     
    • Charlie Zender

      Charlie Zender - 2023-11-27

      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.

       
      • Akash Dutta

        Akash Dutta - 2023-11-29

        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 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.

        Thanks a ton,
        Akash

        On Mon, Nov 27, 2023 at 7:53 PM Charlie Zender zender@users.sourceforge.net
        wrote:

        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.


        ncks reducing size of record dimension to 0
        https://sourceforge.net/p/nco/discussion/9830/thread/70f898daa2/?limit=25#e4c8/0baa


        Sent from sourceforge.net because you indicated interest in
        https://sourceforge.net/p/nco/discussion/9830/

        To unsubscribe from further messages, please visit
        https://sourceforge.net/auth/subscriptions/

         
  • Akash Dutta

    Akash Dutta - 2023-11-29

    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 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.

    Thanks a ton!

     

    Last edit: Akash Dutta 2023-11-29
    • Charlie Zender

      Charlie Zender - 2023-11-29

      Hi Akash,

      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

       

Log in to post a comment.

MongoDB Logo MongoDB