[Thread Prev][Thread Next][Index]

Re: Time Stuff

Jeremy S Pal wrote:
>   Hi again -
> Thanks to the help of Halldor Bjornsson and Kevin O'Brien I am now able to
> string together Multiple NetCDF files.  But, now I have a couple of new
> new questions.
> 1.  In my NetCDF files, I define time in hours as starting from
>     01-JAN-0000 (e.g. 17419896 = 01-APR-1988 00:00).  When I plot these
>     data files, the date that Ferret lists in the top left hand corner of
>     the plot is exactly 2 days later than it should be (Ferret says
>     03-APR-1988 00:00).  Upon testing the same file in GrADS, I found that
>     the date is exactly what I expect it to be.   Any ideas of why this is
>     happening?

Hi Jeremy,

Sigh ... sometimes life gets complicated. The answer here is that the
behavior of the udunits libraries is "incorrect". Udunits chose the
interpretation of calendars that was accurrate to an English historian,
but not suitable for computers. Their calendar definition includes a
switch from the Julian to the Gregorian calendars at some point in the
1500's and an 11 day discontinuity in a particular October of that
century to adjust for the differences in the calendars. In other words
the definition of "year" is 3-times ambiguous. Ferret uses the Gregorian
calendar consistently.

In Ferret V5.0 we have inserted a "hack" that detects time origins prior
to 1500 and adjusts to match the udunits baggage. (Much as I hate to
further complicate an already messy issue.) That will make the 2-day
difference go away. To get the same behavior in Ferret V4.91 use DEFINE
AXIS to define a correct axis and then "G=correct_axis@ASN" to assign
that axis to the variable in question.

> 2.  Some of the datasets that I use contain hourly values of data (with
>     times defined similar to above).  When I plot a time series of these
>     data, ferret seems to combine 3 or so hours worth of values into one
>     time and then skips few times plotting 3 more hours worth of different
>     values into another time, and so on. For example, if I type
>     'plot/i=50/j=50/l=1:3 ts', I get a verticle line.  If I type
>     'plot/i=50/j=50/l=1:6 ts', I get two connected verticle lines.  I
>     tested the data in GrADS, and everything appears as I think it should
>     appear.  This problem does not occur when I plot data that have a time
>     resolution coarser than 3 hours or when I average the data.  Any ideas
>     of how to overcome this problem?
>   Thank you,
>   - Jeremy

As Russel surmised in his response, you are hitting a precision
limitation in Ferret's calendar axes. It derives from combining a
resolution of hours with a time origin of 1-JAN-0000. Again, an easy
work-around is to use the axis replacement technique above. (Ferret will
choose a more recent time origin automatically.)

To follow up with more detailed discussion lets take this off-line and
then summarize the conclusions at the end for those interested.

	- steve

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement