Re: Best way to store a time-stamp [message #38010] |
Tue, 10 February 2004 06:06 |
btt
Messages: 345 Registered: December 2000
|
Senior Member |
|
|
M. Katz wrote:
> I'm interested to know what method people use for making a time-stamp.
> With each datapoint I'd like to record the current time, store it, and
> be able to read it and plot with it later.
>
> systime(0) gives a well-formatted string, but it would be difficult to
> deconstruct back into abscissa values.
>
> systime(1) is great for relative and elapsed time, but is it easy to
> convert it into absolute date and time down to fractions of a second?
>
> systime(1, /julian) seems to only change once per second.
>
> Ideally, I'd like a double-precision number that I can store, and a
> function I can use to interpret the values as read-able date stamps.
>
> Thanks,
> M. Katz
Hello,
I have a DLM that uses the system function gettimeofday. It returns the
time of day as a Long64 integer in milliseconds. I have used it with
video acquisition to timestamp each video frame. The long integer is
easy to work with and to decomposed back into a julian day number. Send
me an email and I will send it along if you're interested. Of course,
there are two caveats (1) I'm a rather wobbly c-programmer and (2) it
was written to work on MacOSX - but that shouldn't matter.
IDL> for i = 0, 9 do print, hbb_milliclock()
1076420938927
1076420938929
1076420938931
1076420938972
1076420938974
1076420938976
1076420938981
1076420938983
1076420938985
1076420938987
Also, in the DLM is a seconds clock, but I haven't ever used it. A
double precision value is returned.
IDL> for i = 0, 9 do print, hbb_secclock(), format = '(f20.4)'
1076421825.6358
1076421825.6379
1076421825.6398
1076421825.6797
1076421825.6826
1076421825.6846
1076421825.6899
1076421825.6919
1076421825.6939
1076421825.6959
On a similar note, I'm not sure what it means that IDL will become an
"National Instruments Alliance Member", but I do know that LabView is
very much clock dependent and has a wide variety of time functions.
Perhaps IDL's time functions will be expanded to accomodate this
connection with LabView.
Ben
|
|
|
Re: Best way to store a time-stamp [message #38012 is a reply to message #38010] |
Tue, 10 February 2004 05:06  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
M. Katz wrote:
> I'm interested to know what method people use for making a time-stamp.
> With each datapoint I'd like to record the current time, store it, and
> be able to read it and plot with it later.
>
> systime(0) gives a well-formatted string, but it would be difficult to
> deconstruct back into abscissa values.
>
> systime(1) is great for relative and elapsed time, but is it easy to
> convert it into absolute date and time down to fractions of a second?
>
> systime(1, /julian) seems to only change once per second.
>
> Ideally, I'd like a double-precision number that I can store, and a
> function I can use to interpret the values as read-able date stamps.
>
> Thanks,
> M. Katz
We are using Julian Seconds defined by Ray Sterner, (seconds since
2000-01-01 00:00:00)
x=string2js(/now)
print,x
print,js2string(x)
1.2973343e+08
2004-02-10 13:03:47 321
You could find both routines in our library. There are several output
formats defined.
regards
Reimar
--
Reimar Bauer
Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
|
|
|