NCPlot
Easy interactive viewing of NetCDF files in Python.
An easy to use Python (3.9 and above) package for quickly plotting the contents of NetCDF files or xarray datasets in Python or on the command line.
This package is designed to work with CF compliant NetCDF data.
Installation
To install from conda:
conda install -c conda-forge ncplot
To install from pypi:
pip install ncplot
Install the development version using using pip:
pip install git+https://github.com/pmlmodelling/ncplot.git
How to use in Python
The package is made up of a simple and easy to use function: view. To visualize everything in a file:
from ncplot import view
view("example.nc")
or to visualize a specific variable or list of variables:
from ncplot import view
view("example.nc", vars)
where vars is either a string representing a variable or a list of variables.
If you want to plot xarray datasets dataarrays, first import the xarray accessor, then plot in a similar way to xarray's built in plotting method:
import ncplot.xarray
import xarray as xr
ds = xr.open_dataset("example.nc")
ds.ncplot.view()
Model grids
Regular longitude-latitude grids are plotted as they are. Other grids are put on a regular longitude-latitude grid first, so that they are plotted in the same way, with the same sliders:
- Curvilinear grids with 2-D longitudes and latitudes, such as the native ocean grids of CMIP6 models, including those with a seam where the longitudes jump by 360 degrees and a tripolar north fold.
- Unstructured grids, whose cells run along one dimension with a longitude and latitude each.
- FVCOM output: the triangular mesh, with variables on its nodes or its elements, and sigma layers as an extra slider.
Each time step and level is put on the regular grid only when it is shown. For a large file name the variable you want,
e.g. view("fvcom_output.nc", vars="temp"): with several variables (the default is all of them) ncplot has to read every
time step of each to set its colour scale.
Coastlines (view("example.nc", coast=True)) need geoviews and cartopy, and datashader draws large regular grids
quickly: pip install "ncplot[complete]".
How to use on the command line
Command line usage is as simple as:
ncplot example.nc
Reference and tutorials
A full API reference, and a how-to guide are available at the NCPlot website and on readthedocs.
Metadata
Release files for ncplot 0.4.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ncplot-0.4.3.tar.gz | 3.1 MB | Without provenance | Details for ncplot-0.4.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ncplot-0.4.3-py3-none-any.whl | Python 3 | none | any | Details for ncplot-0.4.3-py3-none-any.whl |
Total release size: 3.2 MB
Release files / ncplot-0.4.3.tar.gz
| Download URL | ncplot-0.4.3.tar.gz |
|---|---|
| Size | 3.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
528b59bf276e70742edea924746624878afb8ab2ec62b20e43032a422650b8ab
|
|
BLAKE2b-256 checksum How to use checksums |
8fcdda3b81578ce5203f5417e833fda8ac36865418274b61cf1678b55656e522
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.2
|
Release files / ncplot-0.4.3-py3-none-any.whl
| Download URL | ncplot-0.4.3-py3-none-any.whl |
|---|---|
| Size | 40.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
81d0dc6e212ccc93306653c77e143d0e0c692c51a67ebf33deb44cd9dd063248
|
|
BLAKE2b-256 checksum How to use checksums |
aea1ca162d7dc51cef3b4622ce7946ebd16c642466e88ae31e3519d46a8f0c44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.2
|
Security for ncplot 0.4.3
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.