Package pygeodesy :: Module ups |
[frames] | no frames]

# Module ups

Universal Polar Stereographic (UPS) classes Ups and UPSError and functions parseUPS5, toUps8 and upsZoneBand5.

A pure Python implementation, partially transcribed from C++ class PolarStereographic by Charles Karney.

The UPS system is used in conjuction with UTM to location on the polar regions of the earth. UPS covers areas south of 79.5°S and north of 83.5°N (slightly overlapping the UTM range from 80°S to 84°N).

Version: 19.04.26

Classes
| UPSError UPS parse or other error.
| Ups Universal Polar Stereographic (UPS) coordinate.

Functions
parseUPS5(strUPS, datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran`...`, Ups=<class 'pygeodesy.ups.Ups'>, falsed=True, name=`'````'`) Parse a string representing a UPS coordinate, consisting of "[zone][band] pole easting northing" where zone is pseudo zone "00"|"0"|"" and band is 'A'|'B'|'Y'|'Z'|''. |
toUps8(latlon, lon=None, datum=None, Ups=<class 'pygeodesy.ups.Ups'>, pole=`'````'`, falsed=True, strict=True, name=`'````'`) Convert a lat-/longitude point to a UPS coordinate. |
upsZoneBand5(lat, lon, strict=True) Return the UTM/UPS zone number, (polar) Band letter, pole and clipped lat- and longitude for a given location. |

Variables
| __all__ = `_ALL_LAZY.ups`

Function Details

### parseUPS5(strUPS, datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran`...`, Ups=<class 'pygeodesy.ups.Ups'>, falsed=True, name=`'````'`) |
Parse a string representing a UPS coordinate, consisting of "[zone][band] pole easting northing" where zone is pseudo zone "00"|"0"|"" and band is 'A'|'B'|'Y'|'Z'|''. Parameters: `strUPS` - A UPS coordinate (`str`). `datum` - Optional datum to use (Datum). `Ups` - Optional (sub-)class to return the UPS coordinate (Ups) or `None`. `falsed` - Both easting and northing are falsed (`bool`). `name` - Optional Ups name (`str`). Returns: The UPS coordinate (Ups) or 5-tuple (`zone, pole, easting, northing, band`) if Ups is `None`. Raises: `UPSError` - Invalid strUPS.

### toUps8(latlon, lon=None, datum=None, Ups=<class 'pygeodesy.ups.Ups'>, pole=`'````'`, falsed=True, strict=True, name=`'````'`) |
Convert a lat-/longitude point to a UPS coordinate. Parameters: `latlon` - Latitude (`degrees`) or an (ellipsoidal) geodetic `LatLon` point. `lon` - Optional longitude (`degrees`) or `None` if latlon is a `LatLon`. `datum` - Optional datum for this UPS coordinate, overriding latlon's datum (`Datum`). `Ups` - Optional (sub-)class to return the UPS coordinate (Ups) or `None`. `pole` - Optional top/center of (stereographic) projection (`str`, `'N[orth]'` or `'S[outh]'`). `falsed` - False both easting and northing (`bool`). `strict` - Restrict lat to UPS ranges (`bool`). `name` - Optional Ups name (`str`). Returns: The UPS coordinate (Ups) or a 8-tuple (zone, hemisphere, easting, northing, band, datum, convergence, scale) if Ups is `None`. Raises: `RangeError` - If strict and lat outside the valid UPS bands or if lat or lon outside the valid range and rangerrrors set to `True`. `TypeError` - If latlon is not ellipsoidal. `ValueError` - If lon value is missing or if latlon is invalid. See Also: Karney's C++ class UPS.

### upsZoneBand5(lat, lon, strict=True) |
Return the UTM/UPS zone number, (polar) Band letter, pole and clipped lat- and longitude for a given location. Parameters: `lat` - Latitude in degrees (`scalar` or `str`). `lon` - Longitude in degrees (`scalar` or `str`). `strict` - Restrict lat to UPS ranges (`bool`). Returns: 5-Tuple (`zone, Band, hemisphere, lat, lon`) as (`int, str, 'N'|'S', degrees90, degrees180`) where `zone` is always `0` for UPS and polar `Band` is `""` or `'A'|'B'|'Y'|'Z'`. Raises: `RangeError` - If strict and lat in UTM and not UPS range or if lat or lon outside the valid range and rangerrrors set to `True`. `ValueError` - Invalid lat or lon.