Re: Arghh, not an Axis object problem.... [message #64858 is a reply to message #64694] |
Wed, 21 January 2009 15:20  |
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.
|
|
|