More NetCDF commands

1. NetCDF file compression

ncks -L 2 in.nc out.nc    # 2 is the compression ratio, could be 2-9

2. Split file by dimension (e.g. time, lat, lon)

ncks -d time,0,30 in.nc out.nc     
ncks -F -d time,1,31 in.nc out.nc  (equivalent)

3. Merge time using NCO

ncks --mk_rec_dmn time in.nc out.nc
ncrcat *.nc out.nc
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s