netCDF Grads and Matlab

Don Hooper hoop at COLORADO.EDU
Thu Jun 30 18:08:43 EDT 2005


Vincent Moron,

Yeah, mexcdf doesn't understand packed NetCDF files.  There's another Matlab
package from the CSIRO folks in Australia that does:
ftp://ftp.marine.csiro.au/software/mansbrid/matlab_netcdf_5_0.tar.Z

Here's an excerpt from their documentation:
"rescale_opts is a 2 element vector specifying whether or not rescaling is
carried out on retrieved variables or attributes.  Only use this option if you
are sure that you know what you are doing.  If rescale_opts(1) == 1 then
a variable read in by getnc.m will be rescaled by 'scale_factor' and
'add_offset' if these are attributes of the variable; this is the default.
If rescale_opts(1) == 0 then this rescaling will not be done.
If rescale_opts(2) == 1 then the attributes '_FillValue', 'valid_range',
'valid_min' and 'valid_max' read in by getnc.m (and used to find the missing
values of the relevant variable) will be rescaled by 'scale_factor' and
'add_offset'; this is the default.  If rescale_opts(2) == 0 then this
rescaling will not be done."

-Hoop
> From owner-gradsusr at LIST.CINECA.IT  Thu Jun 30 16:04:44 2005
> From: Vincent MORON <vincent at IRI.COLUMBIA.EDU>
>
> Hi all
>
> I have a question about the reading of netCDF file in . matlab. Sorry for
> the posting in this list but I guess that someone has ones the same problem
> as me. I am opening a netCDF file in Grads and everything is OK. When I open
> it in Matlab with the function ncload (distributed in the mexCDF packaging),
> the variable isn't converted using the scaling factors included in netCDF
> (for example, I have a value of -32767 for rainfall), The spatial and
> temporal variability is OK but the value are not properly scaled. Does
> anybody have the solution to scale directly the netCDF variables in matlab?
>
> Thank you in advance
>
> Vincent



More information about the gradsusr mailing list