[hdf-forum] time data

Mag Gam magawake at gmail.com
Tue Jun 16 23:03:59 EDT 2009


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 at 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 at 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 at oneunified.net> wrote:
>> > what resolution/accuracy do you need?
>> >
>> >> -----Original Message-----
>> >> From: Mag Gam [mailto:magawake at gmail.com]
>> >> Sent: Tuesday, June 16, 2009 08:27
>> >> To: hdf-forum at 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 at hdfgroup.org.
>> >> To unsubscribe, send a message to
>> hdf-forum-unsubscribe at 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 at hdfgroup.org.
>> To unsubscribe, send a message to hdf-forum-unsubscribe at hdfgroup.org.
>>
>>
>>
>> ----------------------------------------------------------------------
>> This mailing list is for HDF software users discussion.
>> To subscribe to this list, send a message to
>> hdf-forum-subscribe at hdfgroup.org.
>> To unsubscribe, send a message to hdf-forum-unsubscribe at 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 at hdfgroup.org.
> To unsubscribe, send a message to hdf-forum-unsubscribe at hdfgroup.org.
>
>

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





More information about the Hdf-forum mailing list