[Thread Prev][Thread Next][Index]

Re: [ferret_users] accuracy with axis in seconds



Hi Patric,
We had another idea for setting up your log.  See if this works out for you.  Define an axis ending on the exact date and time you want to measure to, and use `tt,return=Lsize` to get the length of the axis. Then redefine the axis with another end date and get that length.
define symbol time_end = 02-JUN-2010 13:34:45

define axis/t="1-jan-2008":"($time_end)":1/units=seconds/t0="1-jan-2008"/cal=gregorian mytaxis
 !-> def axis/t="1-jan-2008":"02-JUN-2010 13:34:45":1/units=seconds/t0="1-jan-2008"/cal=gregorian mytaxis

let tt = t[gt=mytaxis]
LET x1 = `tt,return=lsize`
 !-> DEFINE VARIABLE x1 = 76340086


define symbol time_end = 02-JUN-2010 13:34:46

def axis/t="1-jan-2008":"($time_end)":1/units=seconds/t0="1-jan-2008"/cal=gregorian mytaxis
 !-> def axis/t="1-jan-2008":"02-JUN-2010 13:34:46":1/units=seconds/t0="1-jan-2008"/cal=gregorian mytaxis

Replacing definition of axis MYTAXIS
let tt = t[gt=mytaxis]
LET x2 = `tt,return=lsize`
 !-> DEFINE VARIABLE x2 = 76340087


Ansley Manke wrote:
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