Skip to main content

ocean-plot

CI Python License: MIT PyPI

中文 · Downloads · Report a problem

Ocean NetCDF plotting from the command line: SST maps, wind vectors and point time series, powered by xarray.

A small Python CLI for students and researchers who need repeatable figures from rectilinear ocean datasets. Tested with local NOAA OISST and RSS CCMP subsets; includes an offline synthetic demo. It preserves missing values, requires explicit selection of multiple time/depth records, and rejects unsupported grids.

NOAA OISST subset: Yellow Sea, January 1, 2025

Install and try

Requires Python 3.10+. Use a virtual environment.

python -m pip install "ocean-plot[netcdf4,maps]"
ocean-plot demo --output-dir demo

The demo requires no network or observational data. Its figures are explicitly marked SYNTHETIC — not observations. The package is available on PyPI and GitHub Releases. For the lighter core installation, use python -m pip install ocean-plot.

Development install:

python -m pip install "git+https://github.com/1460197441-web/ocean-plot.git"

The basic installation uses SciPy for NetCDF3. Add netCDF4 for NetCDF4/HDF5 and cartopy for coastlines, or use the extras in the release installation above.

Your own data

ocean-plot inspect input.nc
ocean-plot sst oisst.nc --time-index 0 --bbox 118 126 30 40 --cartopy --output sst.png
ocean-plot wind ccmp.nc --time-index 0 --u uwnd --v vwnd --cartopy --output wind.pdf
ocean-plot timeseries oisst.nc --point 124 35 --output point.png --csv point.csv
  • Recognizes common latitude/longitude, SST, and wind variable names; explicit overrides are available.
  • Converts known Kelvin units to Celsius and validates geographic wind components in m/s. Arrows show where the wind blows toward, with a reference vector.
  • Exports PNG/PDF at 300 dpi and CSV with actual selected coordinates and unrounded numeric values.
  • Missing values stay missing. The tool does not interpolate or silently average extra dimensions.

RSS CCMP wind subset: January 20, 2024

Scope and limitations

Only 1D rectilinear geographic coordinates are supported. Reversed latitude and ordinary 0–360 longitude grids are reordered with their data. Dateline-crossing regional domains that become discontinuous are rejected before plotting; split the input first. A conservative gap check can also reject strongly irregular global grids. Curvilinear, staggered and rotated grids are unsupported.

Default output is a latitude/longitude coordinate plot without a coastline. --cartopy adds Natural Earth 50m coastlines and a visual land overlay; its first use downloads map data. The overlay does not change source values or replace the product's land mask.

Time series use the nearest in-range grid cell and support standard NumPy datetime calendars. NaN observations break the line; entirely absent timestamps do not. No sampling frequency is inferred and no dates are manufactured. See the Chinese reference for full selection and validation rules.

Development and feedback

python -m pip install -e ".[dev,netcdf4]"
pytest
python -m build

CI tests Python 3.10, 3.12 and 3.13. The current suite includes 42 tests covering scientific and CLI regressions.

If it helps your work, a Star or a reproducible issue is welcome. Include dataset/product metadata, coordinate names, units and the exact command; do not upload private data. Contributions are welcome.

MIT applies to the code. External datasets retain their own licenses and attribution requirements.

Metadata

Release files for ocean-plot 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ocean-plot 0.1.1
File Size Uploaded Provenance
ocean_plot-0.1.1.tar.gz 472.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ocean-plot 0.1.1
File Interpreter ABI Platform
ocean_plot-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 485.8 kB

Release files / ocean_plot-0.1.1.tar.gz

Download URL ocean_plot-0.1.1.tar.gz
Size 472.9 kB
Tags Source
SHA-256 checksum
How to use checksums
48e7f17568c90c57be1d6a2db98366149f695ca8cf997314e116507d3bf3446d
BLAKE2b-256 checksum
How to use checksums
0ff17c113065f9d273cae46a9dbc15e24aed723e06edc318795c3f0774bbfc03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / ocean_plot-0.1.1-py3-none-any.whl

Download URL ocean_plot-0.1.1-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af3982b32b63cd056d749d293acf9aa0615566dfb7d4347403f15176e4c7db23
BLAKE2b-256 checksum
How to use checksums
85bd8d484b0a634f9eacb4b2e6430a66dd219794fb79d89044ad7222cc468f8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for ocean-plot 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ocean_plot-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page