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 Arlyn, > I have netcdf files written using utilities in R and python. I am > trying to figure out whether the files were written with internal > compression (i.e. I want to know if I can rewrite them and make them > smaller). I can do some tests to figure this out, but I wonder if there > is a utility that returns file format and compression information? I did > get format information from 'ncdump -k' but cannot find anything about > compression. Yes, if you want to know compression information about "file.nc", you can use the "-s" option of ncdump ("-s" stands for "special virtual attributes"): ncdump -s -h file.nc The "-h" option prints only header information, so you don't get a complete data dump. See the ncdump man page for the meanings of the special virtual attributes: http://www.unidata.ucar.edu/netcdf/docs/ncdump-man-1.html You want to look at is '_DeflateLevel', which, if present, means the variable has been compressed (at some level from 1 to 9). If your files are not compressed the easiest way to see how much they can be compressed is using the nccopy utility: http://www.unidata.ucar.edu/netcdf/docs/nccopy-man-1.html --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: CDI-919203 Department: Support netCDF Priority: Normal Status: Closed