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

Home » Public Forums » archive » Help w/Plotting
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
Help w/Plotting [message #15800] Fri, 11 June 1999 00:00 Go to next message
akk is currently offline  akk
Messages: 10
Registered: July 1998
Junior Member
Hi,

I have a graph of measurements vs time. Both my MeasurementArray and
TimeArray have 55924 elememts
with measurements taken on the hour for 8 years (1973-1980). I would
also like to
indicate on the xaxis the years as they correspond to the time (i.e. After
the first
year's of data have 1973 on the x axis and so on)
However I am having some trouble
figuring out how to do this. I have tried using the axis prodeure and
graphing:

YearsArray = [1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980]
Plot, TimeArray, MeasurementAray
axis, xaxis = 0,xticks = 7,xtickn = YearsArray, xtitle =
'Yr',xcharsize = 0.9

However, since measurents were only first collected in October 1973,
dividing the xaxis
into 8 even parts would not accurately relate the years to the
Measurments.

I also tried creating another array TimeArrayNew which has the year
markers (i.e. 1973, 1974 etc)
placed in the corresponding time slots:

YearsArray = [1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980]
YearIndex = where(TimeArray GT 365.86 and TimeArray LT 365.9,
count)
print, 'Count: ', count
NumElem = n_elements(Final_Time)
TimeArrayNew = intarr(NumElem) ; Initialize Array of size NUmElem
to ZERO
TimeArrayNew(YearIndex) = YearsArray
Plot, TimeArray, MeasurementAray
axis, xaxis = 0, xticks = NumElem-1 ,xtickn = TimeArrayNew, xtitle
= 'Yr',xcharsize = 0.9


Note: NumElem equals 55924
However this yields as an error b/c XTICKN can only have 60 elements:
ERROR: %Keyword array parameter XTICKNAME must have from 1 to 60 elements.

I'm looking for suggestions on can plot the measurements vs time while
also indicating the
corresponding Years along the X Axis:

Thanks
(please reply to my email address)

p.s. Also could someone suggest a good IDL website for beginners



anilk@mtolympus.ari.net

"Internet or BUST !!"
Re: Help w/Plotting [message #15860 is a reply to message #15800] Tue, 15 June 1999 00:00 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Anil Kochhar wrote:

> Hi,
>
> I have a graph of measurements vs time. Both my MeasurementArray and
> TimeArray have 55924 elememts
> with measurements taken on the hour for 8 years (1973-1980). I would
> also like to
> indicate on the xaxis the years as they correspond to the time (i.e. After
> the first
> year's of data have 1973 on the x axis and so on)
> However I am having some trouble
> figuring out how to do this. I have tried using the axis prodeure and
> graphing:
>
> YearsArray = [1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980]
> Plot, TimeArray, MeasurementAray
> axis, xaxis = 0,xticks = 7,xtickn = YearsArray, xtitle =
> 'Yr',xcharsize = 0.9
>
> However, since measurents were only first collected in October 1973,
> dividing the xaxis
> into 8 even parts would not accurately relate the years to the
> Measurments.
>
> I also tried creating another array TimeArrayNew which has the year
> markers (i.e. 1973, 1974 etc)
> placed in the corresponding time slots:
>
> YearsArray = [1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980]
> YearIndex = where(TimeArray GT 365.86 and TimeArray LT 365.9,
> count)
> print, 'Count: ', count
> NumElem = n_elements(Final_Time)
> TimeArrayNew = intarr(NumElem) ; Initialize Array of size NUmElem
> to ZERO
> TimeArrayNew(YearIndex) = YearsArray
> Plot, TimeArray, MeasurementAray
> axis, xaxis = 0, xticks = NumElem-1 ,xtickn = TimeArrayNew, xtitle
> = 'Yr',xcharsize = 0.9
>
> Note: NumElem equals 55924
> However this yields as an error b/c XTICKN can only have 60 elements:
> ERROR: %Keyword array parameter XTICKNAME must have from 1 to 60 elements.
>
> I'm looking for suggestions on can plot the measurements vs time while
> also indicating the
> corresponding Years along the X Axis:
>
> Thanks
> (please reply to my email address)
>
> p.s. Also could someone suggest a good IDL website for beginners
>
> anilk@mtolympus.ari.net
>
> "Internet or BUST !!"

Idl website for beginners:

look at the pages of David Fanning or better get one of his books.
http://www.dfanning.com/

The problem with timeaxis is resolved by Ray Sterner.
He uses a dateformat named Julian Second. He has routines to convert given
time formats to Julian Seconds. Julian Seconds are seconds since 2000-01-01
00:00:00.

The JHU/APL/S1R library is on:
http://sd-www.jhuapl.edu/fermi/s1r/idl/s1rlib/local_idl.html

There is a great point about:
Dealing with time in IDL using the JHU/APL/S1R library.


I myself was pleased about knowing this routines before I started to design
our own dataformat.
We are using for our data this time format.


R.Bauer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Nice plot application
Next Topic: dpss / multi-taper / ssa toolkit?

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

Current Time: Wed Oct 08 17:05:08 PDT 2025

Total time taken to generate the page: 0.00560 seconds