comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Longword plotting problems...
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Longword plotting problems... [message #11982] Mon, 22 June 1998 00:00 Go to next message
Geraint H. Jones is currently offline  Geraint H. Jones
Messages: 1
Registered: June 1998
Junior Member
Hi,

I'd be glad of any help with this...

I'm handling data files (well, trying to!) in which the time is recorded
as the number of seconds since the beginning of 1950 (I know it's not
the easiest format to deal with, but it's what I have to work with). In
order to get precision to the level of seconds, I have to use longword
arrays.

This is all fine, but the problem is plotting using the longword arrays.
Whatever plot ranges I choose, the time values in the plots are
quantized, i.e. they do not increase smoothly, even though the values
in the array itself increase smoothly. I've attached a short piece of
example code below to demonstrate this...

I know I can get around this by converting the times to other units, but
I'd really like a solution which would let me use seconds since 1950.0.

(I'm running IDL Version 5.0 (sunos sparc)).

Thanks for any help,
Geraint Jones

; Example code

time=lindgen(10)+13254100

data=findgen(10)

plot,time,data

; Just to show that time should increase smoothly in the plot

print,time
Re: Longword plotting problems... [message #12104 is a reply to message #11982] Wed, 24 June 1998 00:00 Go to previous message
Justin[1] is currently offline  Justin[1]
Messages: 4
Registered: June 1998
Junior Member
For info - I've seen the problem on IDL5.0 on SunOS however it does not
occur in IDL5.1 under WinNT4, at least not with the code supplied by Geraint
in the original post.

Justin
Re: Longword plotting problems... [message #12107 is a reply to message #11982] Wed, 24 June 1998 00:00 Go to previous message
R. Bauer is currently offline  R. Bauer
Messages: 137
Registered: November 1996
Senior Member
Damiano Zilio wrote:

> R. Bauer wrote:
>
>>>
>>> ; Example code
>>>
>>> time=lindgen(10)+13254100
>>>
>>> data=findgen(10)
>>>
>>> plot,time,data
>>>
>>> ; Just to show that time should increase smoothly in the plot
>>>
>>> print,time
>>
>> --
>> R.Bauer
>>
>> Institut fuer Stratosphaerische Chemie (ICG-1)
>> Forschungszentrum Juelich
>> email: R.Bauer@fz-juelich.
>
> I don't know where is the problem...
> but making some tests I understood that the plot procedure become crazy
> when works with 8 digits long integer number (such as your dates).
> Now, you can easily avoid the "step line" problem with a translation of the
> x-axis origin,
> i.e.
>> xtrasl=min(time)
>> plot,time-xtrasl,data
> and then, if you want, you can define the "original" thick marks playing with
> the keywords:
> xtickv=[a],xtickn=[b],xticks=n

That's the way jsplot is working too. In addition the offset is stored in a
common block. Because
if you later on like to use cursor or xcursor you need the offset to show your
data.

May be you want to show at your axes values formated like a human readable
date/time string format instead of axes values between 0 and 86400 (or more)
this will be done by jsplot.

There are a lot of functions behind jsplot to handle date/time strings formats
specially for changing into other formats.



--
R.Bauer

Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
Re: Longword plotting problems... [message #12117 is a reply to message #11982] Tue, 23 June 1998 00:00 Go to previous message
DAMIANO ZILIO is currently offline  DAMIANO ZILIO
Messages: 8
Registered: February 1997
Junior Member
R. Bauer wrote:

>>
>> ; Example code
>>
>> time=lindgen(10)+13254100
>>
>> data=findgen(10)
>>
>> plot,time,data
>>
>> ; Just to show that time should increase smoothly in the plot
>>
>> print,time
>
> --
> R.Bauer
>
> Institut fuer Stratosphaerische Chemie (ICG-1)
> Forschungszentrum Juelich
> email: R.Bauer@fz-juelich.

I don't know where is the problem...
but making some tests I understood that the plot procedure become crazy
when works with 8 digits long integer number (such as your dates).
Now, you can easily avoid the "step line" problem with a translation of the
x-axis origin,
i.e.
> xtrasl=min(time)
> plot,time-xtrasl,data
and then, if you want, you can define the "original" thick marks playing with
the keywords:
xtickv=[a],xtickn=[b],xticks=n
where a and b and n are calculated from time and xtrasl

Hope that helps

Regards
--

Damiano Zilio

Joint Research Centre of the Commission of
the European Communities
I-21020 Ispra (VA)
Environment Institute TP 321

my tel: +39-332-78 9520
my fax: +39-332-78 5466
my Email: damiano.zilio@jrc.it
Re: Longword plotting problems... [message #12122 is a reply to message #11982] Tue, 23 June 1998 00:00 Go to previous message
R. Bauer is currently offline  R. Bauer
Messages: 137
Registered: November 1996
Senior Member
Geraint H. Jones wrote:

> Hi,
>
> I'd be glad of any help with this...
>
> I'm handling data files (well, trying to!) in which the time is recorded
> as the number of seconds since the beginning of 1950 (I know it's not
> the easiest format to deal with, but it's what I have to work with). In
> order to get precision to the level of seconds, I have to use longword
> arrays.

We are using julian seconds defined by Ray Sterner.The start point is
2000-01-01 00:00:00.

Julian Seconds are by now negative double precision values and they have a
precision better then 1 milli second +- 500 years.

Ray and we too are having a lot of plotting and conversion routines from
"julian seconds" to other time formats.

Look at these pages to get more information about his idea

WWW Home page: http://fermi.jhuapl.edu/s1r/idl/s1rlib/time/time.html
Specially the point: Working with time series data



>
>
> This is all fine, but the problem is plotting using the longword arrays.
> Whatever plot ranges I choose, the time values in the plots are
> quantized, i.e. they do not increase smoothly, even though the values
> in the array itself increase smoothly. I've attached a short piece of
> example code below to demonstrate this...

For example:
After you converted your long words to Julian Seconds

jsplot will do the plots for you.


You are able to format the time labels on the x-axes like
1998-Jun-23!C11:00:00
or 1998-Jun-23 or 11:00 ...




>
>
> I know I can get around this by converting the times to other units, but
> I'd really like a solution which would let me use seconds since 1950.0.
>
> (I'm running IDL Version 5.0 (sunos sparc)).
>
> Thanks for any help,
> Geraint Jones
>
> ; Example code
>
> time=lindgen(10)+13254100
>
> data=findgen(10)
>
> plot,time,data
>
> ; Just to show that time should increase smoothly in the plot
>
> print,time



--
R.Bauer

Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: outputing ascii
Next Topic: Re: Problems with CW_FSLIDER

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:40:01 PDT 2025

Total time taken to generate the page: 0.00582 seconds