[Thread Prev][Thread Next][Index]

Re: [ferret_users] accuracy with axis in seconds



Hi Patrick,
In Ferret, coordinate axes are stored in double precision internally, but all variables, like tt and x1 and x2 are stored and handled in single precision.  So when you evaluate a time step and assign its value to a variable, the accuracy of the single-precision variables isn't enough to express the number. Single precision has only about 6 digits of accuracy, so even though the digits are written to the Ferret output, the last couple of digits are meaningless.  If you write the data to a netCDF file, the double precision of the coordinates is preserved:
def axis/T="01-JAN-2008":"31-DEC-2010":1/units="seconds"/t0="01-JAN-2008"/cal=GREGORIAN mytaxis
let tt=t[gt=mytaxis]

! Save one minute of data to a file
save/file=tfile.nc/clobber/t="2-jun-2010:13:34":"2-jun-2010:13:35" tt
Even in the file, the values of the variable tt are in single precision, so the values of tt do not match the double precision values of the coordinate variable mytaxis. We just don't have the ability in Ferret to handle or compute with double precision variables.

Ansley


Brockmann Patrick wrote:
Hi all,

For analysis log, I would know how many seconds I get from a starting point.
The problem encountered is that I get the same number of seconds from 2 different
date ?

def axis/T="01-JAN-2008":"31-DEC-2010":1/units="seconds"/t0="01-JAN-2008"/cal=GREGORIAN mytaxis
let tt=t[gt=mytaxis]

let x1=`tt[t="02-JUN-2010 13:34:45"]` ; let x2=`tt[t="02-JUN-2010 13:34:46"]`

gives the same
!-> DEFINE VARIABLE x1=76340088
!-> DEFINE VARIABLE x2=76340088

Patrick


[Thread Prev][Thread Next][Index]

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

Privacy Policy | Disclaimer | Accessibility Statement