smerckel / glidersim

Slocum glider hardware/software simulator
MIT License
2 stars 1 forks source link

Latitude/Longitude representation #1

Closed thopri closed 2 months ago

thopri commented 3 months ago

Hello,

I am wondering what the representation of latitude and longitude in this library is? I have managed to generate a glider trajectory I wish to use elsewhere but I am unfamiliar with the units. e.g.

Latitude 5418.0000 Longitude: 725.800

I am used to decimal degrees e.g. 54.18000 and 7.258000 is that what these would represent? or is it something else e.g. degrees mins seconds.

smerckel commented 3 months ago

Hi @thopri,

The representation of latitude and longitude follows the NMEA convention, which is also used in Slocum gliders. I believe this format stems from saving space in NMEA strings as output by GPS devices. The coordinate 5418.000 breaks down like this: 54 degrees 18.000 minutes North

and similarly,

725.800 gives

7 degrees 25.8 minutes (or 25 minutes and 48 seconds). East

In GPS NMEA strings there is a separate field that indicates N/S and E/W. In gliders N and E coordinates are positive, the S and W are negative.

You could use my latlon package, also on github, to convert between the two, but it is also easy write your own.

As a note of caution, the glidersim package is not very polished, and it does for me what it needs to do. If there is a serious interest from other users, it would make sense to write some documentation etc.

thopri commented 3 months ago

Ha ok cool, that makes sense! yeah I had a feeling it was something like that it being decimal degrees as 1000's rather than 10's didn't make much sense. Thanks for the clarification!

Your readme is pretty reasonable to be honest, there is a nice little script in it that I got to work. I was going to clarify a few things as I had to make some changes to your code to get it to work (some seem fine others less so). I will start a seperate issue for that tho.

Oh and I spent some time trying to get a reaosnable looking glider profile, yours is so much better! :)