Reducing var dimension

Help
augusto
2013-02-06
2013-10-17
  • augusto
    augusto
    2013-02-06

    I have stracted wind speed at level 'k' the extracted var is 4D (time,level,lat,lon)
    I need to reduce it to a 3D var (time,lat,lon) I'm using:
    ncap2 -s 'new_wsp=wspeed(:,1,:,:)' inf.nc outf.nc
    but it doesn't produce anything. What am I doing wrong?

    Thanks for your help.

    Regards,

    Augusto

     
  • Charlie Zender
    Charlie Zender
    2013-02-14

    Augusto, I lost track of this question.
    You may have an old version of ncap2. Try upgrading and the
    command should work without modification, e.g., this works for me:

    ncap2 -O -v -s 'new_wsp=four_dmn_rec_var(:,1,:,:)' ~/nco/data/in.nc ~/foo.nc

    Older versions might be coaxed to work with

    ncap2 -s 'new_wsp=wspeed(:,1,:,:)'  inf.nc outf.nc

    cz