Re: label_date precision problem [message #10017 is a reply to message #9985] |
Thu, 25 September 1997 00:00  |
Robert.M.Candey
Messages: 23 Registered: June 1995
|
Junior Member |
|
|
In article <34299552.C000CFB9@seanet.com>, mh <mh@seanet.com> wrote:
> Hello All,
>
> I've got some timeseries data every 15 minutes for a period of a couple of
> days, and I'd like to use the label_date routine to do the time (x) axis. In
> order to use label_date, I am converting my time axis into absolute
Julian Day
> - a real number when you convert the time as well. For example, 2450717.5
> would be 12:00 on 9/25/1997. If I want 12:15, though, I get 2450717.5104.
> But, it appears IDL isn't maintaining the precision of a double when I
> plot, and the .5104 is getting truncated to .5. This makes for an ugly plot,
> with 4 or 5 y-values collapsing onto one x-value.
>
> Right now, I'm working around it by pretending I'm in year -4710, which is
> basically the start year for -4713 (1/1/-4713 = Julian Day 1) in order to keep
> enough precision to get down to hours. It works, but, it's a cludge, and
> requires some thinking around leap years.
>
> Anybody have a suggestion how to make this work? Or another easy way of
> doing a time axis in IDL?
>
> Please respond via email.
>
> Thanks,
> Mike
IDL uses 4 byte floats for the axes values, thus your truncation. We
generally subtract the time (in Julian values) at the beginning of the year
(or the beginning of the first day plotted) from the time array first and
added it as a parameter to the time_axis routine (we use the JHU APL date
routines). So the plot is made first with no time axis and then time_axis
is called. You could, I suppose, also pass the beginning date in a common
block to the routine called by the tickmarks.
--
Robert.M.Candey@gsfc.nasa.gov
NASA Goddard Space Flight Center, Code 632
Greenbelt, MD 20771 USA 1-301-286-6707
|
|
|