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

Home » Public Forums » archive » Re: IDL 5.4 label_date function
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 5.4 label_date function [message #27791] Wed, 07 November 2001 14:54
Wayne Landsman is currently offline  Wayne Landsman
Messages: 117
Registered: January 1997
Senior Member
> This would have made sense 2000 years ago when the date changed at midday,
> but these days it only makes sense to IDL developers.
>

Well, it also once made a small amount of sense to (non-solar) astronomers,
since starting at noon meant that telescope observations taken over one night
would all have the same integral value of Julian date (JD). Of course, this
is irrelevant for telescope observations from space , or for Australia/New
Zealand/Japan where noon UT (Greenwich time) occurs in the middle of the
night. So even astronomers now typically use modified Julian date (MJD)
defined as JD- 2400000.5 and which does begin at midnite.

Wayne Landsman landsman@mpb.gsfc.nasa.gov
Re: IDL 5.4 label_date function [message #27792 is a reply to message #27791] Wed, 07 November 2001 14:37 Go to previous message
Chad Bahrmann is currently offline  Chad Bahrmann
Messages: 7
Registered: September 2001
Junior Member
Thanks to all for the information....I guess I really did not fully
understand julday
Chad
"Chad Bahrmann" <cbahrmann@ou.edu> wrote in message
news:QscG7.6556$o4.12893@news.ou.edu...
> Has anyone encountered problems in using the label_date function in IDL
5.4?
> From the documentation for IDL 5.4. This plot gives you data from
> 11/01/2001 at 1200 through 11/02/2001 at 1200 when I would expect data
from
> 11/01/2001 at 0000 through 11/02/2001 at 0000. I have had success using
> this function in older versions of IDL but this one appears not to work
> properly? The actual code had revisions on
> ; MODIFICATION HISTORY:
> ; DMS, RSI. April, 1993. Written.
> ; DMS, RSI. March, 1997. Added Time format.
> ; DMS, RSI. Jan, 1999. Rounded least significant time unit
> ; CT, RSI. May 2000. Completely rewrote to use calendar format codes.
> ; Added Level argument for new date/time TICKUNITS.
> ; Added AM_PM and DAYS_OF_WEEK keywords, '%A' and '%W'
codes.
> ;-
>
> PRO test
>
> ; Create format strings for a two-level axis:
>
> dummy = LABEL_DATE(DATE_FORMAT=['%H%I!C%N/%D/%Y'])
>
> ;Generate the Date/Time data
> time = TIMEGEN(START=JULDAY(11,1,2001), FINAL=JULDAY(11,2,2001))
>
> ;Generate the Y-axis data
> data = RANDOMN(seed, N_ELEMENTS(time))
>
> ;Plot the data
> PLOT, time, data, XTICKUNITS = ['Time'], $
> XTICKFORMAT='LABEL_DATE', XSTYLE=1, XTICKS=6, YMARGIN=[6,2]
>
>
> end
>
>
>
Re: IDL 5.4 label_date function [message #27795 is a reply to message #27792] Wed, 07 November 2001 13:01 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
From: "Mark Hadfield" <m.hadfield@niwa.cri.nz>
[Re; JULDAY's argument order]
> And don't even start me on the perversity of the
> (year, day, month) order!

Oops that should be (month, day, year). I told you it was perverse!

---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield
National Institute for Water and Atmospheric Research



--
Posted from clam.niwa.cri.nz [202.36.29.1]
via Mailgate.ORG Server - http://www.Mailgate.ORG
Re: IDL 5.4 label_date function [message #27797 is a reply to message #27795] Wed, 07 November 2001 12:45 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
From: "Craig Markwardt" <craigmnet@cow.physics.wisc.edu>
>
> "Chad Bahrmann" <cbahrmann@ou.edu> writes:
>
>> Has anyone encountered problems in using the label_date function in IDL
5.4?
>> From the documentation for IDL 5.4. This plot gives you data from
>> 11/01/2001 at 1200 through 11/02/2001 at 1200 when I would expect data
from
>> 11/01/2001 at 0000 through 11/02/2001 at 0000. I have had success using
>> this function in older versions of IDL but this one appears not to work
>> properly? The actual code had revisions on
> ...
>> ;Generate the Date/Time data
>> time = TIMEGEN(START=JULDAY(11,1,2001), FINAL=JULDAY(11,2,2001))
>
> I agree with David. This has nothing to do with LABEL_DATE, and
> everything to do with the Julian dates you created in your array.
> Midnight comes at Julian day fraction 0.5.

To expand on Craig's answer, Chad has been bitten by one of the curious
aspects of JULDAY. When it is given only three arguments (year, day, month)
it returns an integral Julian Date, representing 12:00 on the day in
question. When it is given another 3 (...hour,minute,second) it returns a
double Julian date, eg:

IDL> print, JULDAY(11,1,2001), JULDAY(11,1,2001,0,0,0)
2452215 2452214.5

This would have made sense 2000 years ago when the date changed at midday,
but these days it only makes sense to IDL developers.

And don't even start me on the perversity of the (year, day, month) order!

---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield
National Institute for Water and Atmospheric Research




--
Posted from clam.niwa.cri.nz [202.36.29.1]
via Mailgate.ORG Server - http://www.Mailgate.ORG
Re: IDL 5.4 label_date function [message #27802 is a reply to message #27797] Wed, 07 November 2001 10:57 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"Chad Bahrmann" <cbahrmann@ou.edu> writes:

> Has anyone encountered problems in using the label_date function in IDL 5.4?
> From the documentation for IDL 5.4. This plot gives you data from
> 11/01/2001 at 1200 through 11/02/2001 at 1200 when I would expect data from
> 11/01/2001 at 0000 through 11/02/2001 at 0000. I have had success using
> this function in older versions of IDL but this one appears not to work
> properly? The actual code had revisions on
...
> ;Generate the Date/Time data
> time = TIMEGEN(START=JULDAY(11,1,2001), FINAL=JULDAY(11,2,2001))

I agree with David. This has nothing to do with LABEL_DATE, and
everything to do with the Julian dates you�created in your array.
Midnight comes at Julian day fraction 0.5.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: IDL 5.4 label_date function [message #27810 is a reply to message #27802] Wed, 07 November 2001 07:51 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Chad Bahrmann (cbahrmann@ou.edu) writes:

> Has anyone encountered problems in using the label_date function in IDL 5.4?
> From the documentation for IDL 5.4. This plot gives you data from
> 11/01/2001 at 1200 through 11/02/2001 at 1200 when I would expect data from
> 11/01/2001 at 0000 through 11/02/2001 at 0000. I have had success using
> this function in older versions of IDL but this one appears not to work
> properly? The actual code had revisions on
> ; MODIFICATION HISTORY:
> ; DMS, RSI. April, 1993. Written.
> ; DMS, RSI. March, 1997. Added Time format.
> ; DMS, RSI. Jan, 1999. Rounded least significant time unit
> ; CT, RSI. May 2000. Completely rewrote to use calendar format codes.
> ; Added Level argument for new date/time TICKUNITS.
> ; Added AM_PM and DAYS_OF_WEEK keywords, '%A' and '%W' codes.
> ;-
>
> PRO test
>
> ; Create format strings for a two-level axis:
>
> dummy = LABEL_DATE(DATE_FORMAT=['%H%I!C%N/%D/%Y'])
>
> ;Generate the Date/Time data
> time = TIMEGEN(START=JULDAY(11,1,2001), FINAL=JULDAY(11,2,2001))
>
> ;Generate the Y-axis data
> data = RANDOMN(seed, N_ELEMENTS(time))
>
> ;Plot the data
> PLOT, time, data, XTICKUNITS = ['Time'], $
> XTICKFORMAT='LABEL_DATE', XSTYLE=1, XTICKS=6, YMARGIN=[6,2]
>
>
> end

I don't know. The second paragraph in the TIMEGEN
documentation seems pretty clear:

The Julian date is the number of days elapsed
since Jan. 1, 4713 B.C.E., plus the time expressed
as a day fraction. Following the astronomical
convention, the day is defined to start at 12 PM
(noon). Julian date 0.0d is therefore Jan. 1,
4713 B.C.E. at 12:00:00.

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: <sigh> My color question
Next Topic: PlotS rasterization info update

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

Current Time: Wed Oct 08 09:01:26 PDT 2025

Total time taken to generate the page: 0.00506 seconds