This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi James, > I want to restructure a NetCDF variable which has dimensions (lat, lon, > time) to an orientation with dimensions (time, lat, lon). Is there a way > to do this simpler than writing a conversion program myself (I am using > Python with NumPy and the Google NetCDF4 API)? I wrote the variables in > this (lat, lon, time) orientation because that worked out to be much faster > (see > http://stackoverflow.com/questions/17051107/does-each-assignment-of-values-to-an-output-netcdf-variable-result-in-a-rewrite/17069811#17069811) > but now that the data is in NetCDF it needs to be reoriented so that time > is the slowest changing (outermost) dimension, i.e. (time, lat, lon). Is > this easily done, and if so then how? It's easily done with the NetCDF Operators package: http://nco.sourceforge.net/ using the NCO program named ncpdq (Permute Dimensions Quickly): ncpdq -a time,lat,lon in.nc out.nc > P.S. Sorry if this is a question more suited to the mailing list, if so > please let me know and I can send there instead, but this seems beginner > level so I thought I'd run it past you guys first. No problem, if you have any troubles with building nco or using it, you should ask on the NCO forums at sourceforge: http://sourceforge.net/projects/nco/forums/forum/9830 --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: LJJ-126826 Department: Support netCDF Priority: Normal Status: Closed