[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #CDI-919203]: compression question

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 


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:

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

NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.