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

Home » Public Forums » archive » Re: sky is falling, again ?
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: sky is falling, again ? [message #75558] Wed, 16 March 2011 11:25
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
Thank you for all of these replies.

Now, I know where I have the problem...
My julian date is exactly what I want. The problem is when I convert
the date to local time.

I am doing something like: julian_time+=(SYSTIME(/UTC,/JUL)-SYSTIME(/
JUL))
The problem is this line. If I use the calendar format, sometimes
works, sometimes not.

nata
Re: sky is falling, again ? [message #75610 is a reply to message #75558] Wed, 16 March 2011 10:53 Go to previous message
Fabzou is currently offline  Fabzou
Messages: 76
Registered: November 2010
Member
On 03/16/2011 06:06 PM, Kenneth P. Bowman wrote:

>> Because of this problem, we now defined our own time system based on
>> "milliseconds since ..." (working with LONG64 formats to be sure). It
>> works nice, but it was a long (and a bit boring) work to make it
>> flexible and stable.
>>
>> I was wondering what are you people doing?
>>
>> Fab
>
> I have a small library to do date and time calculations that are
> exact to the second using structures and integer arithmetic. It
> could be modified to add a millisecond or microsecond field.
>
> You can download it here
>
> http://idl.tamu.edu/idl/Downloads.html
>
> (see bowman_lib.zip)
>
> Ken Bowman
>
>
>
> IDL> date1 = MAKE_DATE(2011, 3, 16, 12, 4, 0)
> IDL> date2 = MAKE_DATE(2011, 3, 17, 12, 4, 0)
> IDL> print, TIME_DIFF(date2, date1)
> 86400
> IDL> print, MAKE_ISO_DATE_STRING(date1)
> 2011-03-16 12:04:00
> IDL>

Yeah, once again I re-did something that already exists thousands of
time ;-)
Reading this newsgroup regularly, I learned the most important thing
ever: "first look if someone didn't do it for you"

Nice community, by the way...

Fab
Re: sky is falling, again ? [message #75611 is a reply to message #75610] Wed, 16 March 2011 10:38 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Am 16.03.2011 17:52, schrieb Fabzou:
>
> On 03/16/2011 03:54 PM, Norbert Hahn wrote:
>> nata<bernat.puigdomenech@gmail.com> wrote:
>>
>> with the number of milliseconds missing. But you are close to
>> the next minute.
>> As usual with quantized values, the last digit may be wrong.
>>
>> Norbert
>
> Because of this problem, we now defined our own time system based on
> "milliseconds since ..." (working with LONG64 formats to be sure). It
> works nice, but it was a long (and a bit boring) work to make it
> flexible and stable.
>
> I was wondering what are you people doing?
>

We use julian seconds, defined as "seconds since 2000-01-01 00:00:00" by
Ray Sterner (JHUAPL). It is a double precision number.

Works very well. We also have timeaxis, setup_time_axis routines and
lots of conversion routines in our library.

Reimar
Re: sky is falling, again ? [message #75614 is a reply to message #75611] Wed, 16 March 2011 10:06 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <8uc870F5jqU1@mid.dfncis.de>,
Fabzou <fabien.maussion@tu-berlin.de> wrote:

> On 03/16/2011 03:54 PM, Norbert Hahn wrote:
>> nata<bernat.puigdomenech@gmail.com> wrote:
>>
>> with the number of milliseconds missing. But you are close to
>> the next minute.
>> As usual with quantized values, the last digit may be wrong.
>>
>> Norbert
>
> Because of this problem, we now defined our own time system based on
> "milliseconds since ..." (working with LONG64 formats to be sure). It
> works nice, but it was a long (and a bit boring) work to make it
> flexible and stable.
>
> I was wondering what are you people doing?
>
> Fab

I have a small library to do date and time calculations that are
exact to the second using structures and integer arithmetic. It
could be modified to add a millisecond or microsecond field.

You can download it here

http://idl.tamu.edu/idl/Downloads.html

(see bowman_lib.zip)

Ken Bowman



IDL> date1 = MAKE_DATE(2011, 3, 16, 12, 4, 0)
IDL> date2 = MAKE_DATE(2011, 3, 17, 12, 4, 0)
IDL> print, TIME_DIFF(date2, date1)
86400
IDL> print, MAKE_ISO_DATE_STRING(date1)
2011-03-16 12:04:00
IDL>
Re: sky is falling, again ? [message #75616 is a reply to message #75614] Wed, 16 March 2011 09:52 Go to previous message
Fabzou is currently offline  Fabzou
Messages: 76
Registered: November 2010
Member
On 03/16/2011 03:54 PM, Norbert Hahn wrote:
> nata<bernat.puigdomenech@gmail.com> wrote:
>
> with the number of milliseconds missing. But you are close to
> the next minute.
> As usual with quantized values, the last digit may be wrong.
>
> Norbert

Because of this problem, we now defined our own time system based on
"milliseconds since ..." (working with LONG64 formats to be sure). It
works nice, but it was a long (and a bit boring) work to make it
flexible and stable.

I was wondering what are you people doing?

Fab
Re: sky is falling, again ? [message #75618 is a reply to message #75616] Wed, 16 March 2011 07:54 Go to previous message
Norbert Hahn is currently offline  Norbert Hahn
Messages: 46
Registered: May 2003
Member
nata <bernat.puigdomenech@gmail.com> wrote:

> Hi folks,
>
> I'm converting julian dates to text, using the calendar format. So,
> for example:
> time_text=2455636.937500d
>
> PRINT, STRING(time_text,FORMAT='(C(CDI2.2,"/",CMOI2.2,"/",CYI,"
> ",CHI2.2,":",CMI2.2))')
>
> CALDAT, time_text, mo, dd, yy, hh, mm
> PRINT, STRTRIM(dd,2)+"/"+STRTRIM(mo,2)+"/"+STRTRIM(yy,2)+"
> "+STRTRIM(hh,2)+":"+STRTRIM(mm,2)
>
> 16/03/2011 10:29
> 16/03/2011 10:30
>
> Lol ! There is 1 minute difference !!!! Do you know why ?

If you use
PRINT, STRING(time_text,FORMAT='(C(CDI2.2,"/",CMOI2.2,"/",CYI,"
",CHI2.2,":",CMI2.2,":",CSI2.2))')
to print time_text
you'll get
16/03/2011 10:29:59
with the number of milliseconds missing. But you are close to
the next minute.
As usual with quantized values, the last digit may be wrong.

Norbert
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Help menu in 8.0
Next Topic: satellite data

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

Current Time: Wed Oct 08 13:56:31 PDT 2025

Total time taken to generate the page: 0.00607 seconds