--- id: gsw version: "3.6.23" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # gsw — Gibbs Seawater Oceanographic Package of TEOS-10 License: permissive · Maintenance: active · Downloads: 114.9K/mo ## What it is and what it does GSW-Python is a scientific library that implements the TEOS-10 (Thermodynamic Equation of Seawater 2010) standard for oceanographic calculations. It wraps 165 scalar C functions as numpy ufuncs, exposing 158 of them in the main namespace alongside Python implementations of additional functions. The library replaces an earlier pure-Python implementation with a C-based approach that trades build-time compilation for gains in speed, memory efficiency, and function coverage. The package is designed for oceanographers and marine scientists who need to compute seawater properties—salinity, temperature, density, sound speed, and related quantities—from field measurements. It depends only on numpy and supports Python >=3.11 across macOS, Linux, Windows, and WebAssembly platforms via pre-built wheels. The core use case is converting between different oceanographic measurement conventions and deriving quantities used in ocean modeling and data analysis. Use it for: - Convert practical salinity and in-situ temperature to absolute salinity and potential temperature for ocean model initialization - Calculate seawater density and sound speed from CTD sensor data for water mass classification - Derive conservative temperature and other thermodynamic properties for oceanographic research - Batch process large arrays of oceanographic measurements using numpy ufunc broadcasting - Integrate TEOS-10 calculations into xarray-based ocean data pipelines via gsw-xarray wrapper ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. GSW-Python wraps the TEOS-10 seawater thermodynamic equations as numpy ufuncs, providing fast oceanographic calculations for properties like salinity, temperature, and density from in-situ measurements. Yes, if you work with oceanographic data or seawater thermodynamics. The package is stable (Production/Stable status), actively maintained, has no known vulnerabilities, and provides the standard reference implementation of TEOS-10. The C-based approach offers substantial performance gains. The main constraint is the Python >=3.11 requirement and C compiler dependency for source builds, but pre-built wheels mitigate friction on common platforms. ## Install pip install gsw uv add gsw poetry add gsw ## Installing gsw Before you install: Medium install friction due to C compilation requirement; pre-built wheels available for common platforms (macOS, Linux x86_64/aarch64, Windows). Active maintenance with recent release (54 days ago) and ongoing repository activity. License in practice: BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; attribution required. Quickstart: pip install gsw import gsw import numpy as np # Calculate absolute salinity from practical salinity and temperature SA = gsw.SA_from_SP(SP, t, p, lon) # Calculate potential temperature pt = gsw.pt_from_t(SA, t, p) Requires C compiler (gcc/clang on Unix, MSVC on Windows) when building from source; pre-built wheels available for Python >=3.11 on common platforms. Verify before relying: - Performance improvements quantified relative to the original pure-Python implementation - Compatibility with masked arrays and edge cases in real oceanographic datasets - Whether all 158 wrapped ufuncs are fully documented with equivalent detail ## Package facts - License: BSD-3-Clause (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 114.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags oceanographic thermodynamics, seawater properties calculator, TEOS-10 implementation, salinity temperature density, ocean water equations, gsw oceanography, seawater equation of state, oceanography, thermodynamics, numpy-ufunc [View on SkillFed](https://skillfed.io/packages/gsw) · [View on PyPI](https://pypi.org/project/gsw/)