Matlab/NetCDF users,
Please be aware that there are many different toolkits for accessing
NetCDF files from Matlab.
Some use mex files, some use NetCDF-Java.
Some automatically scale using "scale_factor" and "add_offset", some don't.
In Chuck Denham's tookbox (which uses a mex file, not NetCDF-Java),
there are global variables that can override the default behavior.
If you don't set the variables, the default behavior is to NOT
autoscale, but in my startup.m file, I have:
global nctbx_options
nctbx_options.theAutoNaN=1;
nctbx_options.theAutoscale=1;
which changes the default behavior to autoscale.
I just wanted to mention this because I've seen Matlab users who used
someone elses startup.m file as a template sometimes unaware of this
issue, which can lead to confusion.
Thanks,
Rich
On Mon, Dec 8, 2008 at 4:12 AM, Steve Loch <sgl@xxxxxxxxxx> wrote:
> Kevin,
>
> The following is what I've dug out of Chuck Denham's toolbox that we have
> used here in BODC for many years. Namely
>
> result = result .* theScalefactor + theAddoffset;
>
> in retrieving the data from a variable. If the variable doesn't have the
> attribute scale_factor then it will be taken as 1. Similar sentiments apply
> to theAddoffset
> which will be zero unless given explicitly. If you use the toolbox it'll do
> it for you with the auto-scaling option (help netcdf reveals all!)
>
> Steve Loch
> BODC
>
>
>
>
> --
> This message (and any attachments) is for the recipient only. NERC
> is subject to the Freedom of Information Act 2000 and the contents
> of this email and any reply you make may be disclosed by NERC unless
> it is exempt from release under the Act. Any material supplied to
> NERC may be stored in an electronic records management system.
>
> _______________________________________________
> netcdf-java mailing list
> netcdf-java@xxxxxxxxxxxxxxxx
> For list information or to unsubscribe, visit:
> http://www.unidata.ucar.edu/mailing_lists/
>
--
Dr. Richard P. Signell (508) 457-2229
USGS, 384 Woods Hole Rd.
Woods Hole, MA 02543-1598