Narwhal
Oceanographic data analysis in Python
Install / Use
/learn @njwilson23/NarwhalREADME
Narwhal
Oceanographic data analysis in Python
Narwhal is a Python module built on pandas and matplotlib. Narwhal is designed for manipulating and visualizing oceanographic data.
Data are organized into self-describing Cast and CastCollection data
structures. Convenience methods and functions are included for:
- interpolation
- density and depth calculation
- buoyancy frequency estimation
- baroclinic mode analysis
- water type fraction inversion
Quickly visualize results
The narwhal.plotting submodule contains convenience methods for creating T-S
diagrams, cast plots, and section plots. Here's some data from off the coast of
northeastern Greenland:


Python wrapper for the thermodynamic equation of state
Narwhal provides a ctypes wrapper for the
Gibbs Seawater Toolbox
in the narwhal.gsw submodule, making things like the following possible:
density = narwhal.gsw.rho(cast["sa"], cast["ct"], cast["p"])
Currently, GSW 3.05 is packaged with Narwhal.
Data should not be tied to software
For storage, data is serialized to JSON or HDF files. These common formats are open and easily imported into other analysis packages (such as MATLAB), or visualization libraries (such as D3).
Installation
git clone https://github.com/njwilson23/narwhal.git
pip install -r narwhal/requirements.txt
pip install narwhal
Dependencies
- Python 2.7+ or Python 3.4+
- pandas
- matplotlib
- scipy
- requests
- dateutil
- six
- C-compiler (for GSW)
- h5py (optional, required for HDF read/write)
If Karta is installed, it will be used for fast and accurate geographical calculations.
Narwhal is experimental. See also python-oceans and oce (R).
Related Skills
feishu-drive
353.1k|
things-mac
353.1kManage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database)
clawhub
353.1kUse the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com
postkit
PostgreSQL-native identity, configuration, metering, and job queues. SQL functions that work with any language or driver
