Department of Geosciences

GEOS F493 / F693 - Geodetic Methods

Note that you could work locally on your machines today if you Matlab or Python, but it's also fine to log into badger and then hare to work there.

We know that GPS coordinates are given in Earth-centered-Earth-fixed (ECEF) reference frame / coordinate system. However, those Cartesian coordinates are very hard to interpret and we need to be able to convert these back into ellipsoidal coordinates (and vice-versa). Today you'll be implementing 2 functions (in your favorite programming language) that do exactly this. You will need these in the following labs for your conversions.

For this exercise use the WGS84 ellipsoid definition:

semi-major a = 6378137.0 m

flattening f = 1/298.257223563

semi-minor b = -f*a+a

The handout from Hoffmann-Wellenhof, 2nd Ed., that I distributed as PDF via blackboard lays out the formulas. What you need to do is write some code that takes in arguments, applies the formulas, returns the results.

**Background:**

- How to write a function in Matlab
- How to write a function in Python
- some more general background on programming and functions in detail (see Sep 18 slides and code)

In your preferred language, write a function that takes WGS84 latitude, longitude, and height
(above the ellipsoid!) and returns cartesian X,Y,Z coordinates. The formulas given in the handout
are fairly straight forward. **Note that you need to convert degrees to radians!**

In your preferred language, write a function that takes ECEF cartesian coordinates X,Y,Z and returns
WGS84 ellipsoid latitude, longitude, and height. I recommend to implement the iterative algorithm from the handouts! **Again, note that you'll need to convert radians to degrees!**

Your code should convert between these ECEF and WGS84 coordinates for a GPS station in McMurdo, Antarctica station:

ECEF | WGS84 | ||

X (m) | -1311703.172 | lat (deg) | -77.8383494704 |

Y (m) | 310814.982 | lon (deg) | 166.669329308 |

Z (m) | -6213255.16 | height (m) | 98.0221867058 |

The GPS station is MCMD. I grabbed the approximate XYZ coordinates from a receiver file (rinex) from 2014-12-31. This is by no means its precise position.

Note that this code will be utilized in future labs.

- All code should be well-commented! All code should be straightforward to execute. If there's anything I need to know about running this, please include a README textfile.
- The 2 functions / scripts / programs that do the conversion
- Code that uses these 2 function to test them (ECEF->WGS84), (WGS84->ECEF) on the coordinates above.
- Everything in
**ONE**zip file

rg <at> alaska <dot> edu | Last modified: September 11 2019 19:32.