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

Home » Public Forums » archive » Re: Arghh, not an Axis object problem....
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: Arghh, not an Axis object problem.... [message #64694] Tue, 13 January 2009 21:47 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
ghgm2008@gmail.com writes:


> Yeh - Julian days needing to be double can really catch you out - but
> I don't think that is the issue.
> In my code everything is double that needs to be.

Have you tried using the OFFSET keyword to LABEL_DATE?
I think LABEL_DATE is screwing you up somehow. That way
you can use smaller numbers for the labels.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Arghh, not an Axis object problem.... [message #64702 is a reply to message #64694] Tue, 13 January 2009 10:21 Go to previous messageGo to next message
ghgm2008 is currently offline  ghgm2008
Messages: 17
Registered: December 2008
Junior Member
On Jan 13, 9:41 am, Brian Larsen <balar...@gmail.com> wrote:
> If this if your issue I can't say as I am still in the stone age with
> direct graphics only, but when working with julian days I often get
> bit by the float/double issue, be sure the julian days are doubles.
> You probably have this right but worth a check.  What is your code
> doing that is wrong?
>
> IDL> help, 2454845.083333333954215
> <Expression>    FLOAT     =   2.45484e+06
> IDL> help, 2454845.083333333954215d
> <Expression>    DOUBLE    =        2454845.1
>
> Brian
>
> ------------------------------------------------------------ --------------
> Brian Larsen
> Boston University
> Center for Space Physicshttp://people.bu.edu/balarsen/Home/IDL

Brian,

Yeh - Julian days needing to be double can really catch you out - but
I don't think that is the issue.
In my code everything is double that needs to be.

The problem is that idl will not plot the axis as it is being asked to
- this issue has come up many times before
(lots of criticism about object axes working in a very non-intuitive
way). I've read all the old posts on this - but
they're not helping.
There is something I'm missing in my code.

What my code is doing is:
1) Not drawing the axis
2) Drawing 1 tickmark (roughly in the middle) and then marking this
with many (overlaind) formatted Julian dates
- which then becomes a big blob of overlaid text.

Hmm, it's like idl has scaled the axis itself - to be a large scale -
so that all of my ticks and text end up being on top of each other.

Cheers,

George.
Re: Arghh, not an Axis object problem.... [message #64707 is a reply to message #64702] Tue, 13 January 2009 08:41 Go to previous messageGo to next message
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
If this if your issue I can't say as I am still in the stone age with
direct graphics only, but when working with julian days I often get
bit by the float/double issue, be sure the julian days are doubles.
You probably have this right but worth a check. What is your code
doing that is wrong?

IDL> help, 2454845.083333333954215
<Expression> FLOAT = 2.45484e+06
IDL> help, 2454845.083333333954215d
<Expression> DOUBLE = 2454845.1


Brian

------------------------------------------------------------ --------------
Brian Larsen
Boston University
Center for Space Physics
http://people.bu.edu/balarsen/Home/IDL
Re: Arghh, not an Axis object problem.... [message #64858 is a reply to message #64694] Wed, 21 January 2009 15:20 Go to previous message
ghgm2008 is currently offline  ghgm2008
Messages: 17
Registered: December 2008
Junior Member
On Jan 13, 10:47 pm, David Fanning <n...@dfanning.com> wrote:
> ghgm2...@gmail.com writes:
>> Yeh - Julian days needing to be double can really catch you out - but
>> I don't think that is the issue.
>> In my code everything is double that needs to be.
>
> Have you tried using the OFFSET keyword to LABEL_DATE?
> I think LABEL_DATE is screwing you up somehow. That way
> you can use smaller numbers for the labels.
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

David,

Sorry for the slow reply - but yes, that cured it - thanks for the
help.

For anyone following this thread here is the issue - and the solution:

if you are wanting to produce a time axis between 2 Julian dates that
are
close together (say 3 hours apart) you would think this is how it is
done:

result = label_date(date_format='%H')
xrange = [tmin,tmax]
info.xaxis1_A->SetProperty, range=xrange
info.xaxis1_A->SetProperty, tickformat='label_date'

Looks fine - but it doesn't work. IDL seems to have a problem with
big Julian numbers and small fractions.

The way to get it to work is to use the OFFSET keyword (as David
points out)
- then the axis scales between zero and (tmax - tmin)

like this:


result = label_date(date_format='%H',offset=tmin)
xrange = [0.d,tmax-tmin]
info.xaxis1_A->SetProperty, range=xrange
info.xaxis1_A->SetProperty, tickformat='label_date'

I don't quite understand why this 'fix' wasn't just incorporated into
the
Label_date function itself - and therefore invisible to the user - but
it wasn't
so you have to do the above.

Also, my problems were for Julian dates with a small difference (3
hours) -
but the same issue arises for larger differences (10 days)... so maybe
the
above is a general solution for time axes with Julian dates.


Cheers,

George.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: axis ystyle=0 double rounding problem
Next Topic: IDL Export Bridge Assistant Wierdness

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

Current Time: Wed Oct 08 11:32:59 PDT 2025

Total time taken to generate the page: 0.00841 seconds