[Thread Prev][Thread Next][Index]

Re: [ferret_users] Ambiguous time axis





On 6/14/2011 7:06 AM, Brockmann Patrick wrote:
Hi all,

Using 2 variables with apparently correct time axis (they do not ave the same range),
I get a warning and time axis switched to indices when I use the command
"list" with the 2 variables.
In the same time, when I use the "save" command, it works nicely. Proof that the
time axis can be shared between the 2 variables.

Hi Patrick,

This is an interesting subtlety.  Your speculations are correct.  This email just provides some background.

When the commands       use ambiguous_time_f1.nc ;  use ambiguous_time_f2.nc     are issued, Ferret concludes that the two variables, T2M[d=1], T2M[d=2], have distinct time axes.  The axes are distinct since they are of different lengths, even though they happen to agree perfectly for a subset of time points.

When the command list/l=1:20 T2M[d=1], T2M[d=2] Ferret warns you that it has been asked to document lines that may not share time coordinates.  It then suppresses the coordinate display, lest it be wrong.  In the case of the LIST command your speculation is quite right:  namely, Ferret could in principle check whether the coordinates to be listed are identical for the ranges requested.   And if they are identical it could suppress the warning message and list the coordinates.  This would be a nice enhancement.  (There are subtleties, of course.  For example, you could have the same dates encoded with different units (say, "days since" versus "hours since"), in which case the question of ambiguous coordinates would depend upon the state of MODE CALENDAR. )

The standard work-around for this situation is to ensure that a single axis is used:    list/l=1:20 T2M[d=1,gt=t2m[d=2]], T2M[d=2]

OK.  So you ask why does the SAVE command not also issue a warning?  Good question.  The reason is that there's whole extra layer of complexity embedded into the netCDF outputs used by SAVE.  Not only can you issue
save/file=tyty.nc/clobber/l=1:20 T2M[d=1], T2M[d=2]
 you can also issue
save/file=tyty.nc/clobber/l=1:20 T2M[d=1];  save/file=tyty.nc/append/l=1:20 T2M[d=2]
or even
save/file=tyty.nc/clobber/l=1:20 T2M[d=1];  save/file=tyty.nc/append/l=11:30 T2M[d=2]
In order to perform an /APPEND Ferret has to inspect the coordinates that were previously written into the file and see how the new coordinates match up.  That's why more complex logic is found in the SAVE command than in the LIST command.  The extra logic found in SAVE is related -- but still different -- from what would be needed for a "smarter" LIST command.

We've added your suggestion to our trac system. 

    thanks - Steve

I do not understand why ferret complains with this "list" command.

Try :
yes? go err67_ambiguous_time.jnl

use ambiguous_time_f1.nc
use ambiguous_time_f2.nc

list/l=1:20 T2M[d=1], T2M[d=2]
WARNING: Listed variables have ambiguous coordinates on axes: T
Column  1: T2M[D=ambiguous_time_f1] is Temperature 2m (K)(X=178.1E(-181.9):178.1E@AV4, Y=90.9S:90.9N@AV4)
Column  2: T2M[D=ambiguous_time_f2] is Temperature 2m (K)(X=178.1E(-181.9):178.1E@AV4, Y=90.9S:90.9N@AV4)
         T2M    T2M
L /  1:  286.5  286.6
L /  2:  286.5  286.5
L /  3:  286.7  286.6
...

Available from:
http://dods.ipsl.jussieu.fr/brocksce/ferret_bugs/err67_ambiguous_time.jnl
http://dods.ipsl.jussieu.fr/brocksce/ferret_bugs/ambiguous_time_f1.nc
http://dods.ipsl.jussieu.fr/brocksce/ferret_bugs/ambiguous_time_f2.nc

Tested with 6.67, 6.7 on Linux 32, x86_64.
Any help welcome.

Patrick


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement