Metadata-Version: 2.4
Name: neutralocean
Version: 2.5.1
Summary: Neutral surfaces in the ocean
Author-email: Geoff Stanley <geoff.stanley@ec.gc.ca>
License: MIT License
        
        Copyright (c) 2021 Geoff Stanley
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/geoffstanley/neutralocean
Project-URL: Documentation, https://neutralocean.readthedocs.org
Project-URL: Repository, https://github.com/geoffstanley/neutralocean
Project-URL: Issue Tracker, https://github.com/geoffstanley/neutralocean/issues
Keywords: oceanography,physical-oceanography,neutral-surfaces,teos-10
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Education
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: numba
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: xarray
Requires-Dist: xgcm
Provides-Extra: examples
Requires-Dist: ecco_v4_py; extra == "examples"
Requires-Dist: matplotlib; extra == "examples"
Requires-Dist: netcdf4; extra == "examples"
Requires-Dist: pooch; extra == "examples"
Requires-Dist: xmitgcm; extra == "examples"
Dynamic: license-file

# neutralocean

<a href="https://neutralocean.readthedocs.org">
    <img alt="latest docs" src="https://img.shields.io/badge/documentation-latest-blue">
</a>

<a href="https://badge.fury.io/py/neutralocean">
    <img alt="pypi package" src="https://badge.fury.io/py/neutralocean.svg">
</a>

<a href="https://anaconda.org/conda-forge/neutralocean">
    <img alt="conda-forge package" src="https://img.shields.io/conda/vn/conda-forge/neutralocean.svg">
</a>

<a href="https://github.com/geoffstanley/neutralocean/actions/workflows/python-package.yml">
    <img alt="tests" src="https://github.com/geoffstanley/neutralocean/actions/workflows/python-package.yml/badge.svg">
</a>

Calculate neutral surfaces in the ocean, using Python.

The major task of this software is to calculate **omega-surfaces**, following the algorithm of [Stanley et al. (2021)](https://agupubs.onlinelibrary.wiley.com/doi/10.1029/2020MS002436).  Omega surfaces are highly accurate approximately neutral surfaces that work by iteratively reducing the neutrality error. 

There are also routines to calculate potential density surfaces, specific volume anomaly surfaces, neutral trajectories, the Veronis density label, and measures of neutrality error.

**Topobaric surfaces** [(Stanley, 2019a)](https://www.sciencedirect.com/science/article/pii/S1463500318302221) in their modified form [(Stanley 2019b)](https://www.sciencedirect.com/science/article/pii/S1463500318302233) are the most accurate approximately neutral surfaces that posses an exact geostrophic streamfunction (furnishing an Ertel potential vorticity with no baroclinic production term).  Software to compute topobaric surfaces is significantly more complicated and is currently only available in the original MATLAB [neutral-surfaces](https://github.com/geoffstanley/neutral-surfaces) toolbox.

**How to cite?** If you use this software, the most appropriate paper to cite is [Stanley et al. (2021)](https://agupubs.onlinelibrary.wiley.com/doi/10.1029/2020MS002436).

# Installation
This package is on [PyPI](https://pypi.org/project/neutralocean/) and [conda-forge](https://anaconda.org/conda-forge/neutralocean). Simply execute one of the following commands:
- `uv add neutralocean`
- `pixi add neutralocean`
- `pip install neutralocean`
- `conda install -c conda-forge neutralocean`

# Documentation
See <https://neutralocean.readthedocs.org>

# Quickstart

```python
import neutralocean as no

# Create synthetic hydrography (16 by 32 horizontally, 50 vertically)
S, T, Z, _ = no.data.synthocean((16, 32, 50), periodic=(False, False))
grid = no.grid.rectilinear.build_grid((16, 32), periodic=(False, False))

# Compute omega-surface initialized from a pinned depth at a chosen cast.
s, t, z, diags = no.omega_surf(S, T, Z, grid, pin_cast=(8, 16), p_init=2000.)
```
