[LEAPSECS] A new use for Pre-1972 UTC

Rob Seaman seaman at noao.edu
Tue Feb 17 16:27:31 EST 2009


Poul-Henning Kamp wrote:


> They are trying to make a unique pseudo-random number, not a

> timestamp.


Well, it's both. So it turns out that I'm responsible for capturing
data from a couple of dozen cameras on eleven telescopes on three
mountaintops in two hemispheres. Without belaboring all the astronomy
stuff that has entertained us, lo these many years, there are many
identifiers and timestamps (and checksums and ...) attached to each
image file. One thing we decided to add many years ago was a unique
ID from each camera. The format is some variation of:

<telescope>.<camera>.<iso_8601>.<serial_number>

The precise formatting of the ISO timestamp varies depending on who
implemented the particular software for that camera, but all are
standard variations. The serial number is usually omitted, but it
permits distinguishing images from cameras that can take very quick
(or simultaneous) exposures.

I'm guessing that they want to do something similar here.


> To decrease the probability of two persons or programs choosing the

> same number, then include a timestamp in it.

>

> time_t values are readily available in all POSIX filesystems,

> so they use that.


ISO is readily available, too:

$ date -u +'%Y%m%dT%H%M%S'
20090217T211132


> This is a variant of the UUID madness that somebody came up with

> because they didn't want to run a registry or use the existing

> well-structured process (ISO OID's) and though that the eventual

> collisions "probably doesn't matter much".


Yeah - it all comes down to use cases and whether the requirements
address them properly.

Creating an ID that is guaranteed unique is not a trivial task,
especially if (as one suspects is true here) a central server is out
of the question. For example, I control the context for those eleven
telescopes. If eleven different organizations were assigning IDs,
then you have to somehow guarantee that they don't choose the same
telescope or camera names - because it is a frequent occurrence that
the timestamps will coincide (no matter what format is chosen).

Hmmm. I'll have to run the statistics on that - it's the Birthday
Problem. A classroom of more than 23 students has a better than even
chance of some pair of students sharing a birthday. Similarly, eleven
telescopes producing a couple of hundred images each per night have a
high probability of coincidence.

Rob



More information about the LEAPSECS mailing list