Find Year, Month, Day hour:minute:seconds from GPSTIME

20 views
Skip to first unread message

bruce.s...@gmail.com

unread,
Oct 1, 2022, 4:37:10 AM10/1/22
to LAStools - efficient tools for LiDAR processing
Hello,

This probably has been visited on this forum, but it's been a while since I looked into gpstimes.

As an example, one particular LAZ file, (one of many collected near Juneau Alaska in 2013), has a minimum/maximum gpstime of:

  gps_time 53123086.773900 53123530.731859

The data were collected in 2013, sometime between May 1, 2013 and June 30, 2013.

What is the algorithm for converting a gpstime into readable Year, Month, Day HH:MM:SS.SSSS?

Juneau's time is UTC -8:00, and we observe daylight savings time.

Can someone help me with this?

------

For this particular LAZ file, the attached file was generated by lasinfo.

Juneau_Alaska_2013_file_0611.txt

Stuart Edwards

unread,
Oct 1, 2022, 11:50:11 AM10/1/22
to last...@googlegroups.com, bruce.s...@gmail.com
Interesting puzzle.  gpstime should be measured in seconds from Jan 6, 1980 - adjusted for leap seconds.  But the gpstime in your file would only account for about 2 years.  Very strange.  

Looking at some other gpstimes, seems maybe that that the lasmonkey software (and maybe others too) truncate the second count by removing an initial 10 for storage or speed efficiency. This makes no real difference when considering short time periods  during processing, but for your purposes, not too useful.

So here's a test using the gpstime that you provided and adding back the 10.  (this is using R, a statistical software, but the math is quite simple for most applications)




and you can see that the date falls within the range that you specified.  You can figure the local time. The leap second adjustment is only about 15seconds for that time frame and probably not important.

HTH

Stu








On Sep 30, 2022, at 7:33 PM, bruce.s...@gmail.com <bruce


--
Download LAStools at
https://rapidlasso.de
Manage your settings at
https://groups.google.com/g/lastools/membership
---
You received this message because you are subscribed to the Google Groups "LAStools - efficient tools for LiDAR processing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lastools+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lastools/b0a2b4d9-3523-4784-bdaa-9821bac5c7b6n%40googlegroups.com.
<Juneau_Alaska_2013_file_0611.txt>

Kirk Waters - NOAA Federal

unread,
Oct 1, 2022, 11:50:31 AM10/1/22
to last...@googlegroups.com

--
Download LAStools at
https://rapidlasso.de
Manage your settings at
https://groups.google.com/g/lastools/membership
---
You received this message because you are subscribed to the Google Groups "LAStools - efficient tools for LiDAR processing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lastools+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lastools/b0a2b4d9-3523-4784-bdaa-9821bac5c7b6n%40googlegroups.com.
--
Sent from a mobile device subject to autocorrect errors.

Bruce Simonson

unread,
Oct 2, 2022, 3:50:33 AM10/2/22
to last...@googlegroups.com
Well, now, this is embarrassing.  It turns out I asked this question, some 8 or so years ago, but had completely forgotten it.

I suggest you follow the link provided by Kirk for details and a discussion of the problem and its solution.

In brief,

  • If the gps_time values are greater than 604800 (a week's worth of seconds), as they are in my case, I needed to add 1 billion to the gps_time value, and enter the resulting number into a website like the following, for the gps_time value, to calculate the calendar date and time of collection:

       https://www.andrews.edu/~tzs/timeconv/timeconvert.php?

  • If your gps_time values are less than 604800, you'll need to find out the week that the lidar data were collected -- this is very likely not in the file itself, but might be in a separate metadata file -- then you'll need to manually compute the number of weeks (and seconds) since January 6, 1980. The link provided by Kirk talks through how to do this.

Also, the good news is that LiDAR collected in format 1.2 or later should have gps_time values that avoid the "number of weeks since Jan 1980" problem, but may still need to "add 1 billion" to the gps_time value before putting it through an online tool like the one above.

Thanks.

You received this message because you are subscribed to a topic in the Google Groups "LAStools - efficient tools for LiDAR processing" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lastools/6pydG4gsq9c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lastools+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lastools/CADm%3DQrRb4EA1gOnocWGQYOa0C_Ju65vy7t4OASyFduoz%3DZdFbw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages