time data

If I would like to store time series data in the x column, what is the
best data type to use?

My data looks like this:

2009-10-10 12:33:43.33242
2009-10-10 12:33:43.33245
2009-10-10 12:33:43.63433
2009-10-10 12:33:43.73242
2009-10-10 12:33:43.83242
2009-10-10 12:33:43.93242
2009-10-10 12:33:43.99443
2009-10-10 12:33:44.43242

Any thoughts?

TIA

···

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

what resolution/accuracy do you need?

···

-----Original Message-----
From: Mag Gam [mailto:magawake@gmail.com]
Sent: Tuesday, June 16, 2009 08:27
To: hdf-forum@hdfgroup.org
Subject: [hdf-forum] time data

If I would like to store time series data in the x column, what is the
best data type to use?

My data looks like this:

2009-10-10 12:33:43.33242
2009-10-10 12:33:43.33245
2009-10-10 12:33:43.63433
2009-10-10 12:33:43.73242
2009-10-10 12:33:43.83242
2009-10-10 12:33:43.93242
2009-10-10 12:33:43.99443
2009-10-10 12:33:44.43242

Any thoughts?

TIA

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-
subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

--
Scanned for viruses and dangerous content at
http://www.oneunified.net and is believed to be clean.

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.339 / Virus Database: 270.12.63/2169 - Release Date:
06/15/09 17:54:00

--
Scanned for viruses and dangerous content at
http://www.oneunified.net and is believed to be clean.

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

A Tuesday 16 June 2009 13:26:35 Mag Gam escrigué:

If I would like to store time series data in the x column, what is the
best data type to use?

My data looks like this:

2009-10-10 12:33:43.33242
2009-10-10 12:33:43.33245
2009-10-10 12:33:43.63433
2009-10-10 12:33:43.73242
2009-10-10 12:33:43.83242
2009-10-10 12:33:43.93242
2009-10-10 12:33:43.99443
2009-10-10 12:33:44.43242

Any thoughts?

A possibility is to use the scikits.timeseries [1] module that provides
classes and functions for manipulating, reporting, and plotting time series of
various frequencies. It is a module for Python, but seems very powerful and
also supports HDF5 (via PyTables) [2].

Of course, this is a long departure if what you want is writing a C app, but
if you don't have this limitation, scikits.timeseries can be very fast as it
makes a heavy use of NumPy, a high-performance module for multi-dimensional
arrays.

[1] http://pytseries.sourceforge.net/
[2] http://pytseries.sourceforge.net/lib.database.html#pytables-hdf5

Hope that helps,

···

--
Francesc Alted

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

The resolution should be the same.

The accuracy should be very high...

For instance: 43.33245-43.33242

12:33:43.33245 minus 12:33:43.33242 should equal .00003

Thanks again for the response...

···

On Tue, Jun 16, 2009 at 8:22 AM, Ray Burkholder<ray@oneunified.net> wrote:

what resolution/accuracy do you need?

-----Original Message-----
From: Mag Gam [mailto:magawake@gmail.com]
Sent: Tuesday, June 16, 2009 08:27
To: hdf-forum@hdfgroup.org
Subject: [hdf-forum] time data

If I would like to store time series data in the x column, what is the
best data type to use?

My data looks like this:

2009-10-10 12:33:43.33242
2009-10-10 12:33:43.33245
2009-10-10 12:33:43.63433
2009-10-10 12:33:43.73242
2009-10-10 12:33:43.83242
2009-10-10 12:33:43.93242
2009-10-10 12:33:43.99443
2009-10-10 12:33:44.43242

Any thoughts?

TIA

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-
subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

--
Scanned for viruses and dangerous content at
http://www.oneunified.net and is believed to be clean.

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.339 / Virus Database: 270.12.63/2169 - Release Date:
06/15/09 17:54:00

--
Scanned for viruses and dangerous content at
http://www.oneunified.net and is believed to be clean.

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

To easily manipulate with dates/times (e.g. subtract from each other) it is easiest to convert them to numbers. Leapyears are always a bit nasty to handle.
You have to have some reference date though (like Unix counts from 1-Jan-1970).

An important question is the time span you think it will be used for.
You could use an 8-byte floating point counting seconds from 1-Jan-2020 on. This has an accuracy of 17 digits.
So for a 20 year time span, you have 10 years of positive and negative values. 10 years is 315360000 seconds, so you have about 8 digits left for decimal seconds. Seems enough for your case, but it's up to you.

For our astronomical work we use the ModifiedJulianDate as 8-byte floating point. A class takes care of all arithmetic and so involved with it.

Another option is to use two long integer values (for seconds and nanoseconds), but the arithmetic will require a bit more work.

BTW Ho do you deal with Daylight Saving Time? Or do you record all times in UTC?

Cheers,
Ger

Mag Gam <magawake@gmail.com> 06/17/09 3:17 AM >>>

The resolution should be the same.

The accuracy should be very high...

For instance: 43.33245-43.33242

12:33:43.33245 minus 12:33:43.33242 should equal .00003

Thanks again for the response...

···

On Tue, Jun 16, 2009 at 8:22 AM, Ray Burkholder<ray@oneunified.net> wrote:

what resolution/accuracy do you need?

-----Original Message-----
From: Mag Gam [mailto:magawake@gmail.com]
Sent: Tuesday, June 16, 2009 08:27
To: hdf-forum@hdfgroup.org
Subject: [hdf-forum] time data

If I would like to store time series data in the x column, what is the
best data type to use?

My data looks like this:

2009-10-10 12:33:43.33242
2009-10-10 12:33:43.33245
2009-10-10 12:33:43.63433
2009-10-10 12:33:43.73242
2009-10-10 12:33:43.83242
2009-10-10 12:33:43.93242
2009-10-10 12:33:43.99443
2009-10-10 12:33:44.43242

Any thoughts?

TIA

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-
subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

--
Scanned for viruses and dangerous content at
http://www.oneunified.net and is believed to be clean.

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.339 / Virus Database: 270.12.63/2169 - Release Date:
06/15/09 17:54:00

--
Scanned for viruses and dangerous content at
http://www.oneunified.net and is believed to be clean.

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

Good points!

We will be using UTC.

Thanks again for the great responses!

TIA

···

On Tue, Jun 16, 2009 at 9:48 PM, Ger van Diepen<diepen@astron.nl> wrote:

To easily manipulate with dates/times (e.g. subtract from each other) it is easiest to convert them to numbers. Leapyears are always a bit nasty to handle.
You have to have some reference date though (like Unix counts from 1-Jan-1970).

An important question is the time span you think it will be used for.
You could use an 8-byte floating point counting seconds from 1-Jan-2020 on. This has an accuracy of 17 digits.
So for a 20 year time span, you have 10 years of positive and negative values. 10 years is 315360000 seconds, so you have about 8 digits left for decimal seconds. Seems enough for your case, but it's up to you.

For our astronomical work we use the ModifiedJulianDate as 8-byte floating point. A class takes care of all arithmetic and so involved with it.

Another option is to use two long integer values (for seconds and nanoseconds), but the arithmetic will require a bit more work.

BTW Ho do you deal with Daylight Saving Time? Or do you record all times in UTC?

Cheers,
Ger

Mag Gam <magawake@gmail.com> 06/17/09 3:17 AM >>>

The resolution should be the same.

The accuracy should be very high...

For instance: 43.33245-43.33242

12:33:43.33245 minus 12:33:43.33242 should equal .00003

Thanks again for the response...

On Tue, Jun 16, 2009 at 8:22 AM, Ray Burkholder<ray@oneunified.net> wrote:

what resolution/accuracy do you need?

-----Original Message-----
From: Mag Gam [mailto:magawake@gmail.com]
Sent: Tuesday, June 16, 2009 08:27
To: hdf-forum@hdfgroup.org
Subject: [hdf-forum] time data

If I would like to store time series data in the x column, what is the
best data type to use?

My data looks like this:

2009-10-10 12:33:43.33242
2009-10-10 12:33:43.33245
2009-10-10 12:33:43.63433
2009-10-10 12:33:43.73242
2009-10-10 12:33:43.83242
2009-10-10 12:33:43.93242
2009-10-10 12:33:43.99443
2009-10-10 12:33:44.43242

Any thoughts?

TIA

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-
subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

--
Scanned for viruses and dangerous content at
http://www.oneunified.net and is believed to be clean.

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.339 / Virus Database: 270.12.63/2169 - Release Date:
06/15/09 17:54:00

--
Scanned for viruses and dangerous content at
http://www.oneunified.net and is believed to be clean.

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

I use the boost::posix_time and boost::gregorian libraries for date/time
manipulation, and store the binary results in hdf5 files.

If you look at Boost::serialization, will serialize as text data, but no as
binary data. There isn't much storage difference between the two formats,
but something about which to be aware.

Ray

···

To easily manipulate with dates/times (e.g. subtract from
each other) it is easiest to convert them to numbers.
Leapyears are always a bit nasty to handle.
You have to have some reference date though (like Unix counts
from 1-Jan-1970).

An important question is the time span you think it will be used for.
You could use an 8-byte floating point counting seconds from
1-Jan-2020 on. This has an accuracy of 17 digits.
So for a 20 year time span, you have 10 years of positive and
negative values. 10 years is 315360000 seconds, so you have
about 8 digits left for decimal seconds. Seems enough for
your case, but it's up to you.

For our astronomical work we use the ModifiedJulianDate as
8-byte floating point. A class takes care of all arithmetic
and so involved with it.

Another option is to use two long integer values (for seconds
and nanoseconds), but the arithmetic will require a bit more work.

BTW Ho do you deal with Daylight Saving Time? Or do you
record all times in UTC?

>>> Mag Gam <magawake@gmail.com> 06/17/09 3:17 AM >>>
The resolution should be the same.

The accuracy should be very high...

For instance: 43.33245-43.33242

12:33:43.33245 minus 12:33:43.33242 should equal .00003

Thanks again for the response...

On Tue, Jun 16, 2009 at 8:22 AM, Ray > Burkholder<ray@oneunified.net> wrote:
> what resolution/accuracy do you need?
>
>> -----Original Message-----
>> From: Mag Gam [mailto:magawake@gmail.com]
>> Sent: Tuesday, June 16, 2009 08:27
>> To: hdf-forum@hdfgroup.org
>> Subject: [hdf-forum] time data
>>
>> If I would like to store time series data in the x column, what is
>> the best data type to use?
>>
>> My data looks like this:
>>
>> 2009-10-10 12:33:43.33242
>> 2009-10-10 12:33:43.33245
>> 2009-10-10 12:33:43.63433
>> 2009-10-10 12:33:43.73242
>> 2009-10-10 12:33:43.83242
>> 2009-10-10 12:33:43.93242
>> 2009-10-10 12:33:43.99443
>> 2009-10-10 12:33:44.43242
>>
>> Any thoughts?
>>
>> TIA
>>
>>
---------------------------------------------------------------------
>> - This mailing list is for HDF software users discussion.
>> To subscribe to this list, send a message to hdf-forum-
>> subscribe@hdfgroup.org.
>> To unsubscribe, send a message to
hdf-forum-unsubscribe@hdfgroup.org.
>>
>>
>> --
>> Scanned for viruses and dangerous content at
>> http://www.oneunified.net and is believed to be clean.
>>
>>
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com
>> Version: 8.5.339 / Virus Database: 270.12.63/2169 - Release Date:
>> 06/15/09 17:54:00
>
>
> --
> Scanned for viruses and dangerous content at
http://www.oneunified.net
> and is believed to be clean.
>
>

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to
hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to
hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

--
Scanned for viruses and dangerous content at
http://www.oneunified.net and is believed to be clean.

--
Scanned for viruses and dangerous content at
http://www.oneunified.net and is believed to be clean.

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

interesting you mentioned boost, because I am not able to compile C++
libraries for hdf5. I will start another thread for that so we don't
get confused...

···

On Tue, Jun 16, 2009 at 10:48 PM, Ray Burkholder<ray@oneunified.net> wrote:

I use the boost::posix_time and boost::gregorian libraries for date/time
manipulation, and store the binary results in hdf5 files.

If you look at Boost::serialization, will serialize as text data, but no as
binary data. There isn't much storage difference between the two formats,
but something about which to be aware.

Ray

To easily manipulate with dates/times (e.g. subtract from
each other) it is easiest to convert them to numbers.
Leapyears are always a bit nasty to handle.
You have to have some reference date though (like Unix counts
from 1-Jan-1970).

An important question is the time span you think it will be used for.
You could use an 8-byte floating point counting seconds from
1-Jan-2020 on. This has an accuracy of 17 digits.
So for a 20 year time span, you have 10 years of positive and
negative values. 10 years is 315360000 seconds, so you have
about 8 digits left for decimal seconds. Seems enough for
your case, but it's up to you.

For our astronomical work we use the ModifiedJulianDate as
8-byte floating point. A class takes care of all arithmetic
and so involved with it.

Another option is to use two long integer values (for seconds
and nanoseconds), but the arithmetic will require a bit more work.

BTW Ho do you deal with Daylight Saving Time? Or do you
record all times in UTC?

>>> Mag Gam <magawake@gmail.com> 06/17/09 3:17 AM >>>
The resolution should be the same.

The accuracy should be very high...

For instance: 43.33245-43.33242

12:33:43.33245 minus 12:33:43.33242 should equal .00003

Thanks again for the response...

On Tue, Jun 16, 2009 at 8:22 AM, Ray >> Burkholder<ray@oneunified.net> wrote:
> what resolution/accuracy do you need?
>
>> -----Original Message-----
>> From: Mag Gam [mailto:magawake@gmail.com]
>> Sent: Tuesday, June 16, 2009 08:27
>> To: hdf-forum@hdfgroup.org
>> Subject: [hdf-forum] time data
>>
>> If I would like to store time series data in the x column, what is
>> the best data type to use?
>>
>> My data looks like this:
>>
>> 2009-10-10 12:33:43.33242
>> 2009-10-10 12:33:43.33245
>> 2009-10-10 12:33:43.63433
>> 2009-10-10 12:33:43.73242
>> 2009-10-10 12:33:43.83242
>> 2009-10-10 12:33:43.93242
>> 2009-10-10 12:33:43.99443
>> 2009-10-10 12:33:44.43242
>>
>> Any thoughts?
>>
>> TIA
>>
>>
---------------------------------------------------------------------
>> - This mailing list is for HDF software users discussion.
>> To subscribe to this list, send a message to hdf-forum-
>> subscribe@hdfgroup.org.
>> To unsubscribe, send a message to
hdf-forum-unsubscribe@hdfgroup.org.
>>
>>
>> --
>> Scanned for viruses and dangerous content at
>> http://www.oneunified.net and is believed to be clean.
>>
>>
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com
>> Version: 8.5.339 / Virus Database: 270.12.63/2169 - Release Date:
>> 06/15/09 17:54:00
>
>
> --
> Scanned for viruses and dangerous content at
http://www.oneunified.net
> and is believed to be clean.
>
>

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to
hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to
hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

--
Scanned for viruses and dangerous content at
http://www.oneunified.net and is believed to be clean.

--
Scanned for viruses and dangerous content at
http://www.oneunified.net and is believed to be clean.

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

Hello,

Ger van Diepen wrote:

Another option is to use two long integer values (for seconds and nanoseconds),
but the arithmetic will require a bit more work.

We made a decision about timestamp format recently, favoring a 64-bit integer of microseconds, starting from Jan 1, 1970 (like the Unix time). That spans over 580000 years, and a common starting point with Unix time facilitates date functions. The same idea could be applied for a 580-year span of nanoseconds.

Best Regards,
Vesa

···

-----Original Message-----
From: Ger van Diepen [mailto:diepen@astron.nl]
Sent: 17. kesäkuuta 2009 4:49
To: magawake@gmail.com; ray@oneunified.net
Cc: hdf-forum@hdfgroup.org
Subject: Re: [hdf-forum] time data

To easily manipulate with dates/times (e.g. subtract from each other) it is easiest to convert them to numbers. Leapyears are always a bit nasty to handle.
You have to have some reference date though (like Unix counts from 1-Jan-1970).

An important question is the time span you think it will be used for.
You could use an 8-byte floating point counting seconds from 1-Jan-2020 on. This has an accuracy of 17 digits.
So for a 20 year time span, you have 10 years of positive and negative values. 10 years is 315360000 seconds, so you have about 8 digits left for decimal seconds. Seems enough for your case, but it's up to you.

For our astronomical work we use the ModifiedJulianDate as 8-byte floating point. A class takes care of all arithmetic and so involved with it.

BTW Ho do you deal with Daylight Saving Time? Or do you record all times in UTC?

Cheers,
Ger

Mag Gam <magawake@gmail.com> 06/17/09 3:17 AM >>>

The resolution should be the same.

The accuracy should be very high...

For instance: 43.33245-43.33242

12:33:43.33245 minus 12:33:43.33242 should equal .00003

Thanks again for the response...

On Tue, Jun 16, 2009 at 8:22 AM, Ray Burkholder<ray@oneunified.net> wrote:

what resolution/accuracy do you need?

-----Original Message-----
From: Mag Gam [mailto:magawake@gmail.com]
Sent: Tuesday, June 16, 2009 08:27
To: hdf-forum@hdfgroup.org
Subject: [hdf-forum] time data

If I would like to store time series data in the x column, what is the
best data type to use?

My data looks like this:

2009-10-10 12:33:43.33242
2009-10-10 12:33:43.33245
2009-10-10 12:33:43.63433
2009-10-10 12:33:43.73242
2009-10-10 12:33:43.83242
2009-10-10 12:33:43.93242
2009-10-10 12:33:43.99443
2009-10-10 12:33:44.43242

Any thoughts?

TIA

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-
subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

--
Scanned for viruses and dangerous content at
http://www.oneunified.net and is believed to be clean.

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.339 / Virus Database: 270.12.63/2169 - Release Date:
06/15/09 17:54:00

--
Scanned for viruses and dangerous content at
http://www.oneunified.net and is believed to be clean.

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

A Wednesday 17 June 2009 08:55:50 Vesa Paatero escrigué:

Hello,

Ger van Diepen wrote:
> Another option is to use two long integer values (for seconds and
> nanoseconds), but the arithmetic will require a bit more work.

We made a decision about timestamp format recently, favoring a 64-bit
integer of microseconds, starting from Jan 1, 1970 (like the Unix time).
That spans over 580000 years, and a common starting point with Unix time
facilitates date functions. The same idea could be applied for a 580-year
span of nanoseconds.

For more ideas about date/time formats, you may want to have a look at a
proposal [1] for implementing a couple of types (one for absolute times and
the other for relative) in NumPy [2]. It seems that the NumPy crew is already
in the implementation phase of it, so you may find it useful.

[1] http://projects.scipy.org/numpy/browser/trunk/doc/neps/datetime-
proposal3.rst
[2] http://numpy.scipy.org/

Regards,

···

--
Francesc Alted

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

I've been curious to see what other folks are using because I've just implemented a time axis in my Packet Tables.

Since I'm in the .Net world, I'm using the DateTime.Ticks property which is a long long. And represents the number of 100-ns since 1/1/0001 AD midnight. It has more than enough resolution and range for me. I can easily plot or compare results even without the help of .NET. And with it, all the date & time conversions are already built in.

Scott

···

-----Original Message-----
From: Ger van Diepen [mailto:diepen@astron.nl]
Sent: Tuesday, June 16, 2009 9:49 PM
To: magawake@gmail.com; ray@oneunified.net
Cc: hdf-forum@hdfgroup.org
Subject: Re: [hdf-forum] time data

To easily manipulate with dates/times (e.g. subtract from each other)
it is easiest to convert them to numbers. Leapyears are always a bit
nasty to handle.
You have to have some reference date though (like Unix counts from 1-
Jan-1970).

An important question is the time span you think it will be used for.
You could use an 8-byte floating point counting seconds from 1-Jan-2020
on. This has an accuracy of 17 digits.
So for a 20 year time span, you have 10 years of positive and negative
values. 10 years is 315360000 seconds, so you have about 8 digits left
for decimal seconds. Seems enough for your case, but it's up to you.

For our astronomical work we use the ModifiedJulianDate as 8-byte
floating point. A class takes care of all arithmetic and so involved
with it.

Another option is to use two long integer values (for seconds and
nanoseconds), but the arithmetic will require a bit more work.

BTW Ho do you deal with Daylight Saving Time? Or do you record all
times in UTC?

Cheers,
Ger

>>> Mag Gam <magawake@gmail.com> 06/17/09 3:17 AM >>>
The resolution should be the same.

The accuracy should be very high...

For instance: 43.33245-43.33242

12:33:43.33245 minus 12:33:43.33242 should equal .00003

Thanks again for the response...

On Tue, Jun 16, 2009 at 8:22 AM, Ray Burkholder<ray@oneunified.net> > wrote:
> what resolution/accuracy do you need?
>
>> -----Original Message-----
>> From: Mag Gam [mailto:magawake@gmail.com]
>> Sent: Tuesday, June 16, 2009 08:27
>> To: hdf-forum@hdfgroup.org
>> Subject: [hdf-forum] time data
>>
>> If I would like to store time series data in the x column, what is
the
>> best data type to use?
>>
>> My data looks like this:
>>
>> 2009-10-10 12:33:43.33242
>> 2009-10-10 12:33:43.33245
>> 2009-10-10 12:33:43.63433
>> 2009-10-10 12:33:43.73242
>> 2009-10-10 12:33:43.83242
>> 2009-10-10 12:33:43.93242
>> 2009-10-10 12:33:43.99443
>> 2009-10-10 12:33:44.43242
>>
>> Any thoughts?
>>
>> TIA
>>
>> --------------------------------------------------------------------
--
>> This mailing list is for HDF software users discussion.
>> To subscribe to this list, send a message to hdf-forum-
>> subscribe@hdfgroup.org.
>> To unsubscribe, send a message to hdf-forum-
unsubscribe@hdfgroup.org.
>>
>>
>> --
>> Scanned for viruses and dangerous content at
>> http://www.oneunified.net and is believed to be clean.
>>
>>
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com
>> Version: 8.5.339 / Virus Database: 270.12.63/2169 - Release Date:
>> 06/15/09 17:54:00
>
>
> --
> Scanned for viruses and dangerous content at
> http://www.oneunified.net and is believed to be clean.
>
>

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-
subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-
subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

This e-mail and any files transmitted with it may be proprietary and are intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the sender.
Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of ITT Corporation. The recipient should check this e-mail and any attachments for the presence of viruses. ITT accepts no liability for any damage caused by any virus transmitted by this e-mail.

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.