[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IDL messes up Julian day plots ?



Plotting is done using only single precision arithmetic,
but you should be OK over a two-year span.  Your talking
about an interval of 900 seconds over a span of 6x10^7 or
~.0001 which is well within the resolution of a real.

It's a little kludgy, but you could do something like

   common mydates, time0

   time0 = times(0)
   times = times-time0
   plot, times, ..., xtickformat='NEWlabel_date'

with
   function NEWlabel_date, axis, index, value
      common mydates, time0
      return, label_date,axis,index,value+time0
   end
   

Since you've gotten rid of a potentially large offset
value in the plotting you should get the full benefit
of single precision, but are still able to label
things appropriately.

	Tom McGlynn
	tam@silk.gsfc.nasa.gov
   

LC's No-Spam Newsreading account wrote:
> 
> I have a 2-year-long list of samples, one sample every 15 min.
> The times are stored in Unix format (integer seconds since 1970).
> 
> I want to plot this using label_date to annotate the x axis. I do
> 
> ; convert to julian days
> times=double(a.data.time)
> times=times/86400.
> times=times + julday(1,1,1970)
> 
> dummy=label_date(date_format='%D %M')
> plot,times,a.data.nitem   ,xtickformat='label_date'
> 
> If I restrict the plot to shorter periods e.g.
> plot,times(u),a.data(u).nitem   ,xtickformat='label_date'
> 
> I get that several points are plotted at the same abscissa (x coordinate)
> even if the values of a.data.time and times are distinct.
> 
> It looks like the plotting routines are unable to scale double precision
> values correctly. On the other hand I'd say I need such precision with "large"
> numbers like dates in julian days.  And I need julian days to use label_date.
> 
> Any clue ?
>