How to decrease nc file bulk using mexnc

Discussion about analysis, visualization, and collaboration tools and techniques

Moderators: arango, robertson

Post Reply
Message
Author
shifei
Posts: 30
Joined: Thu Aug 01, 2013 3:11 pm
Location: Ocean University of China

How to decrease nc file bulk using mexnc

#1 Unread post by shifei »

Hi,

Using NETCDF4 can obviously decrease nc file bulk.
Is mexnc function able to make it ?
[ncid,status]=mexnc('create',ncname,'clobber');

User avatar
wilkin
Posts: 875
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: How to decrease nc file bulk using mexnc

#2 Unread post by wilkin »

The built-in netcdf utility in more recent releases of Matlab is what you want:
>> help netcdf.create
netcdf.create Create new netCDF file.
ncid = netcdf.create(filename, mode) creates a new netCDF file
according to the file creation mode. The return value is a file
ID.

The type of access is described by the mode parameter, which could
be one of the following string values or a bitwise-or of numeric mode
values:

'CLOBBER' - overwrite existing files
'NOCLOBBER' - do not overwrite existing files
'SHARE' - allow for synchronous file updates
'64BIT_OFFSET' - allow the creation of 64-bit files instead of
the classic format
'NETCDF4' - create a netCDF-4/HDF5 file
'CLASSIC_MODEL' - enforce classic model, has no effect unless used
in a bitwise-or with 'NETCDF4'
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

User avatar
jivica
Posts: 169
Joined: Mon May 05, 2003 2:41 pm
Location: The University of Western Australia, Perth, Australia
Contact:

Re: How to decrease nc file bulk using mexnc

#3 Unread post by jivica »

Just a hint you can try saving variables as short using add_offset and scale_factor.
This is useful if you have already created netCDF files but want to make them smaller.
With nco you have already ncpdq doing that for you...
I.

Post Reply