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

Home » Public Forums » archive » Re: IDL plot is inconsistent, where is subtle error?
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
Re: IDL plot is inconsistent, where is subtle error? [message #24925] Fri, 04 May 2001 11:17 Go to next message
Joseph B. Gurman is currently offline  Joseph B. Gurman
Messages: 31
Registered: April 2000
Member
In article <9csbad$jqu$1@hecate.umd.edu>, bleau@umtof.umd.edu wrote:

But of course, Larry, you know that you can't create GIFs in 5.4....

BTW, I love the PM and SEM pages, especially the Shockspotter
pooches.

Best,

Joe Gurman

> Thank you, Craig Markwardt <craigmnet@cow.physics.wisc.edu> and Paul van
> Delst
> <paul.vandelst@noaa.gov>, for your suggestion to subtract off a base
> epoch. A
> coworker of mine gave me the same suggestion last night, which I tested.
> You'll be happy to learn that it worked!
>
> Also, your insights about direct graphics being single precision in IDL
> V5.2,
> but double in V5.4, were quite enlightening and would explain the missing
> tick
> mark. I'll definitely upgrade and retest this later on (anything to
> simplify
> this code).
>
> Btw, the missing tick mark was not just on the even hour; that was a
> false
> pattern. I ran it with a whole range of ending hours, and only 2 in 10
> worked
> as expected. I was using XTICKV already, btw, and passed it a DOUBLE.
> That's
> moot, though; since I put in the base epoch subtraction it works like a
> charm.
> If you're curious as to how this plot developed, look at
>
> http://umtof.umd.edu/sem/latest4hrs.gif
>
> For info on the science project from which this data was obtained, see
>
> http://umtof.umd.edu/sem/
>
> Thanks again!

--
| Joseph B. Gurman, NASA Goddard Space Flight Center, Solar Physics
| Branch, Greenbelt MD 20771 USA / Federal employees are still
| prohibited from holding opinions while at work. Therefore, any
| opinions expressed herein are somebody else's.
Re: IDL plot is inconsistent, where is subtle error? [message #24935 is a reply to message #24925] Thu, 03 May 2001 12:25 Go to previous messageGo to next message
bleau is currently offline  bleau
Messages: 24
Registered: November 1993
Junior Member
Thank you, Craig Markwardt <craigmnet@cow.physics.wisc.edu> and Paul van Delst
<paul.vandelst@noaa.gov>, for your suggestion to subtract off a base epoch. A
coworker of mine gave me the same suggestion last night, which I tested.
You'll be happy to learn that it worked!

Also, your insights about direct graphics being single precision in IDL V5.2,
but double in V5.4, were quite enlightening and would explain the missing tick
mark. I'll definitely upgrade and retest this later on (anything to simplify
this code).

Btw, the missing tick mark was not just on the even hour; that was a false
pattern. I ran it with a whole range of ending hours, and only 2 in 10 worked
as expected. I was using XTICKV already, btw, and passed it a DOUBLE. That's
moot, though; since I put in the base epoch subtraction it works like a charm.
If you're curious as to how this plot developed, look at

http://umtof.umd.edu/sem/latest4hrs.gif

For info on the science project from which this data was obtained, see

http://umtof.umd.edu/sem/

Thanks again!

Lawrence Bleau
University of Maryland
Physics Dept., Space Physics Group
301-405-6223
bleau@umtof.umd.edu
Re: IDL plot is inconsistent, where is subtle error? [message #24948 is a reply to message #24935] Wed, 02 May 2001 13:16 Go to previous messageGo to next message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
Lawrence Bleau wrote:
>
> Hello, IDLers. I'm having a very subtle problem with plotting from IDL.
> Either that or IDL is screwed up, which I doubt is the case. First, my
> configuration:
>
> IDL Version 5.2 (vms alpha)
> OpenVMS AXP V7.1-2
>
> I'm plotting a set of values along the Y-axis (log plot), with time being
> on the X-axis. The time is expressed as a double precision floating point
> quantity (created with DBLARR). The time has a base year (time zero) of
> several decades ago, and I can't change this base year, so that's something
> I have to live with. This is called an epoch time. Typical values of an
> epoch time are in the range 357588000.D0. I have a routine that converts
> from epoch time value to normal calendar notation (date and time).

IDL pre-v5.4 (or was it 5.3?) always plots in single precision (regardless if the data is
in double) so you can loose info when your numbers are that big.

What happens if you do a plot but subtract off the first value as an offset, something
like

plot, epoch-epoch[0], values(*,k)

?

paulv

--
Paul van Delst A little learning is a dangerous thing;
CIMSS @ NOAA/NCEP Drink deep, or taste not the Pierian spring;
Ph: (301)763-8000 x7274 There shallow draughts intoxicate the brain,
Fax:(301)763-8545 And drinking largely sobers us again.
Alexander Pope.
Re: IDL plot is inconsistent, where is subtle error? [message #24949 is a reply to message #24948] Wed, 02 May 2001 13:25 Go to previous messageGo to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Hi Lawrence--

Wow, there's no complaints about not enough information here! :-)

> Hello, IDLers. I'm having a very subtle problem with plotting from IDL.
> Either that or IDL is screwed up, which I doubt is the case. First, my
> configuration:
> ...

After all this I think the problem is still a single vs. double
precision issue. As you noted you are starting to lose even
integer-level precision in some of your plots.

> My first version of XTICK3 did not act in this manner. I found, by
> experimentation, that the value passed to XTICK3 was a *single* precision
> floating value, even through all the X-values to be plotted, as well as the
> vector passed to XTICKV, were *double* precision. ...

Here is the story. Direct graphics in IDL 5.3 and earlier is single
precision *only*. This means that any plot commands, etc. which
involve double precision numbers are converted internally to single
precision. However, in IDL 5.4 I understand that direct graphics now
supports both floating point precisions. If you can, you may consider
an upgrade (if 5.4 even exists for VMS).

But you can still find some salvation without IDL 5.4. First, I
strongly strongly urge you to subtract a constant baseline epoch from
your data, at least when plotting.� From my description above it is
clear that you are stuck with floating point single precision, so you
will always have problems plotting data with huge dynamic range. But
you don't have a large dynamic range!

By simply changing the plot command to "PLOT, (EPOCH-E0), VALUES..."
where E0 is a nearby time, you can eliminate the precision problems
you are having. If this really is SOHO data then you can probably set
E0 to the launch date without too much trouble. Please realize that
this suggestion is only intended for the *plotting* of the data. You
obviously still keep the science data in the full double precision
representation. [ You may have to modify your "tick label" function
to account for this offset, but that's probably a trivial mod. ]

> My current problem arises in that some of the time the last (5th) major
> tick mark does not get drawn or labelled.

Your real question is about the wierd disappearing last tick mark. I
honestly believe that this problem is caused by the single precision
problems described above. Once you start subtracting a constant time,
I will wager that things go back to normal!

If this doesn't solve the problem then you may have to set your own
major tick points using the XTICKV keyword. It's not hard but of
course you need to develop the logic to compute them.

All that being said, I have never found it easy to customize the axis
labels on a plot. Good luck!

Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: IDL plot is inconsistent, where is subtle error? [message #25024 is a reply to message #24925] Fri, 04 May 2001 11:34 Go to previous message
bleau is currently offline  bleau
Messages: 24
Registered: November 1993
Junior Member
In article <gurman-669C26.14174604052001@news.gsfc.nasa.gov>, "Joseph B. Gurman" <gurman@gsfc.nasa.gov> writes:
>
> But of course, Larry, you know that you can't create GIFs in 5.4....

No, I did not realize this, and I just paid for a new copy (only $10).

Why did this happen? Is there a replacement operation? Is there a 3rd-party
add-on to allow this?

Lawrence Bleau
University of Maryland
Physics Dept., Space Physics Group
301-405-6223
bleau@umtof.umd.edu
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Reading .xls files
Next Topic: IDL plot is inconsistent, where is subtle error?

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

Current Time: Wed Oct 08 15:38:03 PDT 2025

Total time taken to generate the page: 0.00675 seconds