I need to permute the dimensions of my netcdf file from time,lat,lon, to lat,lon,time.
The NCO command for that purpose is : " ncpdq -a lat,lon,time input.nc input_fixed.nc"
How can I run this command using Python library 'pynco' please ?
Please read the example on this page: https://github.com/nco/pynco Those instructions suggest this invocation
from nco import Nco nco = Nco() nco.ncpdq(input=in.nc, output=out.nc, options="-a lat,lon,time")
The other answer didn't work for me, and there is no longer any mention of ncpdq in the github example. However, the following syntax seems to work:
nco.ncpdq(input="in.nc", output="out.nc", options=['-a', 'lat,lon,time'])
Please read the example on this page: https://github.com/nco/pynco Those instructions suggest this invocation