[Thread Prev][Thread Next][Index]

Re: [ferret_users] accuracy of axis in ferret

Hi all-
Ned is quite right. It's been said before, but I'll just go through some of the details here, since it's come up in a few questions lately.

Axis coordinates in Ferret are stored and used internally as double precision values, but any variables -including numbers used in expressions as you're defining axes- are single precision. So long axes in and of themselves are not a problem, but defining them accurately can be.  For equally spaced axes, using  /NPOINTS is always accurate.  Start, end and delta values that can be accurately represented in single-precision will also result in an accurate definition.

In addition, starting with the next release of Ferret, the value specified for NPOINTS will be read from the command line as an integer, so that really large values of NPOINTS can be given.


E. D. (Ned) Cokelet wrote:
I've used big topographic data sets from ascii values.  When the axis is very long, ferret gets the spacing wrong due to rounding error.  You can get around this for evenly spaced axes by using the npoints parameter.  Try something like this

define axis/x=1:100000/npoints=100000 my_axis

to get an even axis 100,000 points long.  

Edward D. (Ned) Cokelet, Ph.D. Oceanographer
NOAA/PMEL                         off:  (206) 526-6820
7600 Sand Point Way NE     fax: (206) 526-6485
Seattle, WA 98115-6349

The contents of this message are mine personally and do not necessarily reflect any position of the Government or the National Oceanic and Atmospheric Administration.

[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement