Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
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
mh 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 > Hi Mike We are using therefore Ray Sterners definition of julian seconds (js) It's defined: seconds since 2000-1-1 00:00:00 UTC. Now you have a double precision negative value which will become positive after 2000-1-1 00:00:00 UTC. Ray has written a lot of routines to handle these timeformat. He has lots of routines to transform times in and out to this format and he has written routines like timeaxis and jsplot. timeaxis makes whith julian seconds a time axis on a plot. jsplot is a plot routine to do timeseries plots. Please look at this documentation for more details. http://fermi.jhuapl.edu/s1r/idl/s1rlib/time/time.html I think it's a very good definition for time and the most of our data are using this js time! -- R.Bauer Institut fuer Stratosphaerische Chemie (ICG-1) Forschungszentrum Juelich email: R.Bauer@fz-juelich.de