{"id":5021,"library":"pymap3d","title":"pymap3d Library","description":"pymap3d is a pure Python library (with no external prerequisites) providing various coordinate conversions. It follows the conventions of several popular Matlab routines for geospatial and attitude transformations. The current version is 3.2.0, and it maintains an active development status with regular updates.","status":"active","version":"3.2.0","language":"en","source_language":"en","source_url":"https://github.com/geospace-code/pymap3d","tags":["coordinate-conversion","geospatial","attitude","navigation","matlab-convention"],"install":[{"cmd":"pip install pymap3d","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"symbol":"geodetic2ecef","correct":"from pymap3d import geodetic2ecef"},{"symbol":"ecef2geodetic","correct":"from pymap3d import ecef2geodetic"},{"symbol":"ecef2eci","correct":"from pymap3d import ecef2eci"},{"symbol":"enu2uvw","correct":"from pymap3d import enu2uvw"}],"quickstart":{"code":"import pymap3d as pm\nimport datetime\n\n# Example Geodetic (Lat, Lon, Alt) to ECEF (Earth-Centered, Earth-Fixed) conversion\nlat, lon, alt = 42.0, -82.0, 200.0  # Latitude (deg), Longitude (deg), Altitude (meters)\nx, y, z = pm.geodetic2ecef(lat, lon, alt)\nprint(f\"ECEF coordinates: x={x:.2f}m, y={y:.2f}m, z={z:.2f}m\")\n\n# Example ECEF to Geodetic conversion\nlat2, lon2, alt2 = pm.ecef2geodetic(x, y, z)\nprint(f\"Geodetic coordinates: lat={lat2:.2f}deg, lon={lon2:.2f}deg, alt={alt2:.2f}m\")\n\n# Example ECEF to ECI (Earth-Centered Inertial) conversion (requires datetime)\n# For a specific time, you need the corresponding position and velocity.\ntime = datetime.datetime(2023, 1, 20, 12, 0, 0, tzinfo=datetime.timezone.utc)\nx_eci, y_eci, z_eci = pm.ecef2eci(x, y, z, time)\nprint(f\"ECI coordinates (at {time}): x={x_eci:.2f}m, y={y_eci:.2f}m, z={z_eci:.2f}m\")","lang":"python","description":"This quickstart demonstrates core coordinate conversion functionalities. It converts geodetic coordinates to ECEF, then converts ECEF back to geodetic to show round-trip consistency. Finally, it illustrates conversion from ECEF to ECI, highlighting the need for a specific timestamp."},"warnings":[{"fix":"Replace `pymap3d.aer.aer2enu(...)` with `pymap3d.aer2enu(...)` and similarly for other functions.","message":"The entire `pymap3d.aer` module was removed in v3.0.0. Functions like `aer2enu` and `enu2aer` must now be imported and used directly from `pymap3d`.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Review existing code using `aer2enu` and adjust expected altitude signs if upgrading from a version older than 3.1.0.","message":"The sign for altitude in `aer2enu` was corrected in v3.1.0. If you relied on the incorrect sign in previous versions, your altitude results will now be inverted.","severity":"breaking","affected_versions":">=3.1.0"},{"fix":"Always consult the function's docstring or the official documentation to confirm the exact input arguments, units, and output format. Do not assume compatibility with other libraries without verification.","message":"pymap3d explicitly follows Matlab's coordinate convention. This means input/output order (e.g., lat, lon, alt vs. lon, lat, alt), units (degrees vs. radians), and specific frame definitions might differ from other Python geospatial libraries.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure that if `geodetic2ecef` is called without a `height` argument, the implicit `0.0` meter height is the desired behavior for your application. Explicitly pass `height=...` if a different default is needed.","message":"In v3.0.0, the default value for the `height` parameter in `geodetic2ecef` changed from `NaN` to `0.0`. This can silently alter results if code implicitly relied on the previous `NaN` behavior without explicitly passing a `height` value.","severity":"gotcha","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}