Martin, you are of course (as usual :-) ) correct when you state that
all time stamps should use the Adjusted Standard GPS time instead of
time of week, but I still think lasinfo has a bug when it reports that
number as if the "Adjusted" part could be omitted!
I.e. lasinfo should definitely add 1e9 to the number of seconds before
converting to YMD HMS representation.
Re. your claim about losing resolution:
When a timestamp is stored as a FP number, the specification is
seriously messed up IMHO. :-(
I've been working in the NTP Hackers team for many years and that
protocol always uses fixed-point format for all timestamps specifically
to avoid steps in the resolution as the integer field gets larger. As
you note a double with 53-bit mantissa and an integer (seconds) part
between 1 and 2G would require 31 bits for the seconds leaving just 22
fractional bits. The latter would correspond to a resolution of ~250 ns
which would be marginal for pulse timestamps so the "Adjusted" bias is
required.
For Adj GPS timestamps the easiest way to decode it would be something
like this:
int64_t seconds = (int64_t) agpstime;
agpstime -= (double) seconds;
int32_t nanoseconds = (int32_t) (agpstime * 1.0e9);
seconds += ADJGPSBIAS; // 1E9
seconds += TAI_to_UTC_offset(seconds);
Terje
> --
> Download LAStools at
>
http://lastools.org
>
http://rapidlasso.com
> Be social with LAStools at
>
http://facebook.com/LAStools
>
http://twitter.com/LAStools
>
http://linkedin.com/groups/LAStools-4408378
> Manage your settings at
>
http://groups.google.com/group/lastools/subscribe
--
- <
Terje.M...@tmsw.no>
"almost all programming can be viewed as an exercise in caching"