0

I have a netCDF file

dimensions:
    i1 = 3 ;
    x = 11 ;
    s1 = 1 ;
    mid1 = 8 ;
    mid2 = 8 ;
variables:
    double Height(i1,x) ;
    double Temp(s1, x) ;
    short Soil(s1, x) ;
    double Liq(mid1, x) ;

I want to reduce the mid1 size to 3 where I remove the rest of the 5 values.

How can I do it in using ncdf4 package or some other utility?

Charlie Zender
  • 5,929
  • 14
  • 19
maximusdooku
  • 5,242
  • 10
  • 54
  • 94

1 Answers1

3

You could use NCO's ncks to hyperslab netCDF files, e.g.,

ncks -d mid1,0,2 in.nc out.nc

Charlie Zender
  • 5,929
  • 14
  • 19