pymgp.crstrans.xyz2plh#
- pymgp.crstrans.xyz2plh(xyz, ellipsoid='current', method='Bowring', unit='rad')[source]#
Convert Cartesian XYZ coordinates to Ellipsoidal latitude, longitude and height coordinates.
- Parameters:
- xyzarray_like with shape (…,3)
Cartesian XYZ coordinates.
- ellipsoidstr or list of floats, default = ‘current’
Text string with the name of the ellipse or a list
[a, 1/f]
with the semi-major axis a and inverse flattening 1/f. The current ellipsoid can be set by setell. Default for the current ellips is ‘WGS-84’.- method{‘Bowring’, ‘iterative’}, default = ‘Bowring’
Bowring’s method is uded by default. Bowring’s method is faster, but can only be used on the surface of the Earth. The iterative method is slower and less precise on the surface of the earth, but should be used above 10-20 km of altitude.
- unit{‘rad’, ‘deg’}, default = ‘rad’
Units for the output latitude and longitude.
- Returns:
- plhndarray with the same shape (…,3) as xyz
Ellipsoidal coordinates (geographic latitude, longitude and height above the ellipsoid).
Examples
>>> plh = xyz2plh([3925375.1007 , 274488.9665, 5002803.3455], unit='deg') >>> print(np.round(plh,4)) [52. 4. 0.]
>>> plhin = [ [50, 0, 0], [51, 1, -4], [52, 4, 2], [53, 3, 3] ] >>> xyz = plh2xyz(plhin, unit='deg') >>> plh = xyz2plh(xyz, unit='deg') >>> print( np.max(np.abs(plh-plhin)) < 1e-9) True