ncplot 0.4.1__tar.gz → 0.4.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. {ncplot-0.4.1 → ncplot-0.4.3}/PKG-INFO +32 -6
  2. {ncplot-0.4.1 → ncplot-0.4.3}/README.md +21 -3
  3. ncplot-0.4.3/docs-site/archive/v0.4.1/api.html +172 -0
  4. ncplot-0.4.3/docs-site/archive/v0.4.2/api.html +172 -0
  5. ncplot-0.4.3/docs-site/archive/v0.4.2/assets/css/style.css +926 -0
  6. ncplot-0.4.3/docs-site/archive/v0.4.2/assets/img/favicon.svg +15 -0
  7. ncplot-0.4.3/docs-site/archive/v0.4.2/assets/img/ncplot_wordmark.svg +4 -0
  8. ncplot-0.4.3/docs-site/archive/v0.4.2/assets/img/pml_logo.jpg +0 -0
  9. ncplot-0.4.3/docs-site/archive/v0.4.2/assets/js/main.js +105 -0
  10. ncplot-0.4.3/docs-site/archive/versions.json +4 -0
  11. ncplot-0.4.3/docs-site/assets/css/style.css +926 -0
  12. ncplot-0.4.3/docs-site/assets/img/favicon.svg +15 -0
  13. ncplot-0.4.3/docs-site/assets/img/ncplot_wordmark.svg +4 -0
  14. ncplot-0.4.3/docs-site/assets/img/pml_logo.jpg +0 -0
  15. ncplot-0.4.3/docs-site/assets/js/main.js +105 -0
  16. {ncplot-0.4.1 → ncplot-0.4.3}/docs-site/version-history.html +4 -1
  17. {ncplot-0.4.1 → ncplot-0.4.3}/ncplot/command_line.py +20 -13
  18. ncplot-0.4.3/ncplot/grid.py +266 -0
  19. ncplot-0.4.3/ncplot/loading.py +38 -0
  20. ncplot-0.4.3/ncplot/mesh.py +197 -0
  21. {ncplot-0.4.1 → ncplot-0.4.3}/ncplot/plot.py +70 -10
  22. ncplot-0.4.3/ncplot/regrid.py +286 -0
  23. {ncplot-0.4.1 → ncplot-0.4.3}/ncplot/utils.py +26 -0
  24. ncplot-0.4.3/ncplot.egg-info/SOURCES.txt +43 -0
  25. {ncplot-0.4.1 → ncplot-0.4.3}/requirements.txt +1 -1
  26. {ncplot-0.4.1 → ncplot-0.4.3}/setup.py +7 -4
  27. ncplot-0.4.1/docs-site/archive/versions.json +0 -1
  28. ncplot-0.4.1/ncplot.egg-info/SOURCES.txt +0 -27
  29. {ncplot-0.4.1 → ncplot-0.4.3}/LICENSE +0 -0
  30. {ncplot-0.4.1 → ncplot-0.4.3}/MANIFEST.in +0 -0
  31. {ncplot-0.4.1 → ncplot-0.4.3}/docs-site/.nojekyll +0 -0
  32. {ncplot-0.4.1 → ncplot-0.4.3}/docs-site/README.md +0 -0
  33. {ncplot-0.4.1 → ncplot-0.4.3}/docs-site/about.html +0 -0
  34. {ncplot-0.4.1 → ncplot-0.4.3}/docs-site/api.html +0 -0
  35. {ncplot-0.4.1/docs-site → ncplot-0.4.3/docs-site/archive/v0.4.1}/assets/css/style.css +0 -0
  36. {ncplot-0.4.1/docs-site → ncplot-0.4.3/docs-site/archive/v0.4.1}/assets/img/favicon.svg +0 -0
  37. {ncplot-0.4.1/docs-site → ncplot-0.4.3/docs-site/archive/v0.4.1}/assets/img/ncplot_wordmark.svg +0 -0
  38. {ncplot-0.4.1/docs-site → ncplot-0.4.3/docs-site/archive/v0.4.1}/assets/img/pml_logo.jpg +0 -0
  39. {ncplot-0.4.1/docs-site → ncplot-0.4.3/docs-site/archive/v0.4.1}/assets/js/main.js +0 -0
  40. {ncplot-0.4.1 → ncplot-0.4.3}/docs-site/example/plot.html +0 -0
  41. {ncplot-0.4.1 → ncplot-0.4.3}/docs-site/index.html +0 -0
  42. {ncplot-0.4.1 → ncplot-0.4.3}/docs-site/installing.html +0 -0
  43. {ncplot-0.4.1 → ncplot-0.4.3}/docs-site/quickstart.html +0 -0
  44. {ncplot-0.4.1 → ncplot-0.4.3}/ncplot/__init__.py +0 -0
  45. {ncplot-0.4.1 → ncplot-0.4.3}/ncplot/deprecated.py +0 -0
  46. {ncplot-0.4.1 → ncplot-0.4.3}/ncplot/xarray.py +0 -0
  47. {ncplot-0.4.1 → ncplot-0.4.3}/pyproject.toml +0 -0
  48. {ncplot-0.4.1 → ncplot-0.4.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ncplot
3
- Version: 0.4.1
3
+ Version: 0.4.3
4
4
  Summary: Interactive viewing of NetCDF data
5
5
  Home-page: https://github.com/pmlmodelling/ncplot
6
6
  Author: Robert Wilson
@@ -10,12 +10,12 @@ Project-URL: Bug Tracker, https://github.com/pmlmodelling/ncplot/issues
10
10
  Project-URL: Documentation, https://ncplot.readthedocs.io/en/stable
11
11
  Project-URL: Source Code, https://github.com/pmlmodelling/ncplot
12
12
  Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
13
- Classifier: Programming Language :: Python :: 3.8
14
13
  Classifier: Programming Language :: Python :: 3.9
15
14
  Classifier: Programming Language :: Python :: 3.10
16
15
  Classifier: Programming Language :: Python :: 3.11
17
16
  Classifier: Programming Language :: Python :: 3.12
18
- Requires-Python: >=3.6.1
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Requires-Python: >=3.9
19
19
  Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
21
  Requires-Dist: numpy
@@ -28,9 +28,17 @@ Requires-Dist: panel
28
28
  Requires-Dist: pandas
29
29
  Requires-Dist: metpy
30
30
  Requires-Dist: jupyter_bokeh
31
+ Requires-Dist: scipy
31
32
  Requires-Dist: datashader; python_version <= "3.10"
32
33
  Provides-Extra: complete
33
34
  Requires-Dist: geoviews; extra == "complete"
35
+ Requires-Dist: cartopy; extra == "complete"
36
+ Requires-Dist: datashader; extra == "complete"
37
+ Provides-Extra: test
38
+ Requires-Dist: pytest; extra == "test"
39
+ Requires-Dist: geoviews; extra == "test"
40
+ Requires-Dist: cartopy; extra == "test"
41
+ Requires-Dist: datashader; extra == "test"
34
42
  Dynamic: author
35
43
  Dynamic: author-email
36
44
  Dynamic: classifier
@@ -51,7 +59,7 @@ Dynamic: summary
51
59
  </p>
52
60
 
53
61
  > [!TIP]
54
- > 📖 **New here?** The NCPlot website — installing, a quickstart, the API reference, and more — lives at **[pmlmodelling.github.io/ncplot](https://pmlmodelling.github.io/ncplot/)**.
62
+ > 📖 **New here?** The NCPlot website — installing, a quickstart, the API reference, and more — lives at **[plymouthmarinelaboratory.github.io/ncplot](https://plymouthmarinelaboratory.github.io/ncplot/)**.
55
63
 
56
64
  [![pypi](https://img.shields.io/pypi/v/ncplot.svg)](https://pypi.python.org/pypi/ncplot/)
57
65
  [![Documentation Status](https://readthedocs.org/projects/ncplot/badge/?version=latest)](https://ncplot.readthedocs.io/en/latest/?badge=latest)
@@ -61,7 +69,7 @@ Dynamic: summary
61
69
 
62
70
  Easy interactive viewing of NetCDF files in Python.
63
71
 
64
- An easy to use Python (3.6 and above) package for quickly plotting the contents of NetCDF files or xarray datasets in Python or on the command line.
72
+ 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.
65
73
 
66
74
  This package is designed to work with [CF](https://cfconventions.org/) compliant NetCDF data.
67
75
 
@@ -125,6 +133,24 @@ ds.ncplot.view()
125
133
 
126
134
 
127
135
 
136
+ ## Model grids
137
+
138
+ Regular longitude-latitude grids are plotted as they are. Other grids are put on a regular longitude-latitude
139
+ grid first, so that they are plotted in the same way, with the same sliders:
140
+
141
+ * **Curvilinear grids** with 2-D longitudes and latitudes, such as the native ocean grids of CMIP6 models, including
142
+ those with a seam where the longitudes jump by 360 degrees and a tripolar north fold.
143
+ * **Unstructured grids**, whose cells run along one dimension with a longitude and latitude each.
144
+ * **[FVCOM](https://github.com/FVCOM-GitHub/FVCOM) output**: the triangular mesh, with variables on its nodes or its elements, and
145
+ sigma layers as an extra slider.
146
+
147
+ 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,
148
+ e.g. `view("fvcom_output.nc", vars="temp")`: with several variables (the default is all of them) ncplot has to read every
149
+ time step of each to set its colour scale.
150
+
151
+ Coastlines (`view("example.nc", coast=True)`) need geoviews and cartopy, and datashader draws large regular grids
152
+ quickly: `pip install "ncplot[complete]"`.
153
+
128
154
  ## How to use on the command line
129
155
 
130
156
  Command line usage is as simple as:
@@ -150,7 +176,7 @@ ncplot example.nc
150
176
 
151
177
  # Reference and tutorials
152
178
 
153
- A full API reference, and a how-to guide are available at the [NCPlot website](https://pmlmodelling.github.io/ncplot/) and on [readthedocs](https://ncplot.readthedocs.io/en/latest/).
179
+ A full API reference, and a how-to guide are available at the [NCPlot website](https://plymouthmarinelaboratory.github.io/ncplot/) and on [readthedocs](https://ncplot.readthedocs.io/en/latest/).
154
180
 
155
181
 
156
182
 
@@ -3,7 +3,7 @@
3
3
  </p>
4
4
 
5
5
  > [!TIP]
6
- > 📖 **New here?** The NCPlot website — installing, a quickstart, the API reference, and more — lives at **[pmlmodelling.github.io/ncplot](https://pmlmodelling.github.io/ncplot/)**.
6
+ > 📖 **New here?** The NCPlot website — installing, a quickstart, the API reference, and more — lives at **[plymouthmarinelaboratory.github.io/ncplot](https://plymouthmarinelaboratory.github.io/ncplot/)**.
7
7
 
8
8
  [![pypi](https://img.shields.io/pypi/v/ncplot.svg)](https://pypi.python.org/pypi/ncplot/)
9
9
  [![Documentation Status](https://readthedocs.org/projects/ncplot/badge/?version=latest)](https://ncplot.readthedocs.io/en/latest/?badge=latest)
@@ -13,7 +13,7 @@
13
13
 
14
14
  Easy interactive viewing of NetCDF files in Python.
15
15
 
16
- An easy to use Python (3.6 and above) package for quickly plotting the contents of NetCDF files or xarray datasets in Python or on the command line.
16
+ 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.
17
17
 
18
18
  This package is designed to work with [CF](https://cfconventions.org/) compliant NetCDF data.
19
19
 
@@ -77,6 +77,24 @@ ds.ncplot.view()
77
77
 
78
78
 
79
79
 
80
+ ## Model grids
81
+
82
+ Regular longitude-latitude grids are plotted as they are. Other grids are put on a regular longitude-latitude
83
+ grid first, so that they are plotted in the same way, with the same sliders:
84
+
85
+ * **Curvilinear grids** with 2-D longitudes and latitudes, such as the native ocean grids of CMIP6 models, including
86
+ those with a seam where the longitudes jump by 360 degrees and a tripolar north fold.
87
+ * **Unstructured grids**, whose cells run along one dimension with a longitude and latitude each.
88
+ * **[FVCOM](https://github.com/FVCOM-GitHub/FVCOM) output**: the triangular mesh, with variables on its nodes or its elements, and
89
+ sigma layers as an extra slider.
90
+
91
+ 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,
92
+ e.g. `view("fvcom_output.nc", vars="temp")`: with several variables (the default is all of them) ncplot has to read every
93
+ time step of each to set its colour scale.
94
+
95
+ Coastlines (`view("example.nc", coast=True)`) need geoviews and cartopy, and datashader draws large regular grids
96
+ quickly: `pip install "ncplot[complete]"`.
97
+
80
98
  ## How to use on the command line
81
99
 
82
100
  Command line usage is as simple as:
@@ -102,7 +120,7 @@ ncplot example.nc
102
120
 
103
121
  # Reference and tutorials
104
122
 
105
- A full API reference, and a how-to guide are available at the [NCPlot website](https://pmlmodelling.github.io/ncplot/) and on [readthedocs](https://ncplot.readthedocs.io/en/latest/).
123
+ A full API reference, and a how-to guide are available at the [NCPlot website](https://plymouthmarinelaboratory.github.io/ncplot/) and on [readthedocs](https://ncplot.readthedocs.io/en/latest/).
106
124
 
107
125
 
108
126
 
@@ -0,0 +1,172 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="robots" content="noindex, follow">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <title>API Reference — NCPlot</title>
8
+ <meta name="description" content="Function reference for ncplot: view(), the ncplot.xarray accessor, and the ncplot command line tool.">
9
+ <link rel="icon" type="image/svg+xml" href="assets/img/favicon.svg">
10
+ <link rel="preconnect" href="https://fonts.googleapis.com">
11
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
12
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
13
+ <link rel="stylesheet" href="assets/css/style.css">
14
+ </head>
15
+ <body>
16
+
17
+ <header class="site-header">
18
+ <div class="container nav">
19
+ <a class="brand" href="../../index.html">
20
+ <img src="assets/img/ncplot_wordmark.svg" alt="NCPlot">
21
+ <span class="brand-version">v0.4.1 (archived)</span>
22
+ </a>
23
+ <nav class="nav-links" id="nav-links">
24
+ <a href="../../version-history.html" data-page="version-history.html">Version history</a>
25
+ </nav>
26
+ <div class="nav-actions">
27
+ <a class="icon-btn" href="https://github.com/pmlmodelling/ncplot" target="_blank" rel="noopener" aria-label="NCPlot on GitHub">
28
+ <svg viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M12 .5C5.73.5.5 5.74.5 12.09c0 5.08 3.29 9.38 7.86 10.9.57.1.79-.25.79-.55 0-.27-.01-1.17-.02-2.12-3.2.7-3.88-1.36-3.88-1.36-.53-1.34-1.29-1.7-1.29-1.7-1.05-.72.08-.71.08-.71 1.17.08 1.78 1.2 1.78 1.2 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.26-1.28-5.26-5.71 0-1.26.45-2.29 1.19-3.09-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.18 1.18a11.1 11.1 0 0 1 5.79 0c2.2-1.49 3.17-1.18 3.17-1.18.64 1.59.24 2.76.12 3.05.74.8 1.18 1.83 1.18 3.09 0 4.44-2.7 5.42-5.28 5.7.42.36.78 1.08.78 2.17 0 1.57-.01 2.83-.01 3.22 0 .3.21.66.8.55A10.6 10.6 0 0 0 23.5 12.1C23.5 5.74 18.27.5 12 .5Z"/></svg>
29
+ </a>
30
+ <button class="nav-toggle" id="nav-toggle" aria-label="Toggle menu" aria-expanded="false">
31
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="18" x2="21" y2="18"/></svg>
32
+ </button>
33
+ </div>
34
+ </div>
35
+ </header>
36
+
37
+ <div class="page-hero">
38
+ <div class="container">
39
+ <div class="breadcrumb"><a href="../../index.html">Home</a> / API</div>
40
+ <h1>API reference</h1>
41
+ <p class="lead">NCPlot has one core function — <code>view()</code> — reachable three ways: directly from the top-level <code>ncplot</code> namespace, via the <code>ncplot.xarray</code> accessor, or from the <code>ncplot</code> command line tool.</p>
42
+ </div>
43
+ </div>
44
+
45
+ <div class="container docs-layout">
46
+ <aside class="docs-toc">
47
+ <div class="docs-toc-title">Reference</div>
48
+ <ul>
49
+ <li><a href="#view">view</a></li>
50
+ <li><a href="#xarray-accessor">ncplot.xarray accessor</a></li>
51
+ <li><a href="#cli">Command line</a></li>
52
+ </ul>
53
+ </aside>
54
+
55
+ <div class="docs-content">
56
+
57
+ <span class="kicker">Plotting</span>
58
+
59
+ <div class="api-card" id="view">
60
+ <div class="api-card__head"><div class="sig">ncplot.view(x, vars=None, autoscale=True, out=None, **kwargs)</div></div>
61
+ <div class="api-card__body">
62
+ <p>Plot the contents of a netCDF file, directory, remote URL, or xarray object.</p>
63
+ <details class="param-details" open>
64
+ <summary>Parameters</summary>
65
+ <p>Required:</p>
66
+ <ul class="param-list">
67
+ <li><code class="param-name">x</code><span class="param-tag">required</span><p>An xarray <code>Dataset</code>/<code>DataArray</code>, or a file path, directory, or remote (OPeNDAP/THREDDS) URL pointing to netCDF data.</p></li>
68
+ </ul>
69
+ <p>Optional:</p>
70
+ <ul class="param-list">
71
+ <li><code class="param-name">vars</code><p>A variable name, or list of variable names, to plot. If omitted, every variable in <code>x</code> is plotted.</p></li>
72
+ <li><code class="param-name">autoscale</code><p>Whether colour scales are set automatically from each variable's minimum and maximum values. Default <code>True</code>. Set to <code>False</code> to keep scales fixed, e.g. when comparing several plots.</p></li>
73
+ <li><code class="param-name">out</code><p>Path to save the plot to, instead of displaying it inline. Must end in <code>.html</code>.</p></li>
74
+ <li><code class="param-name">coast</code><p>Draw coastlines on map plots. Default <code>False</code>. Looks best with the optional <code>cartopy</code> dependency installed (see <a href="../../installing.html">Installing</a>).</p></li>
75
+ <li><code class="param-name">clim</code><p>A <code>(min, max)</code> tuple fixing the colour scale range, overriding <code>autoscale</code> for that call.</p></li>
76
+ </ul>
77
+ </details>
78
+ </div>
79
+ </div>
80
+
81
+ <span class="kicker">Accessors</span>
82
+
83
+ <div class="api-card" id="xarray-accessor">
84
+ <div class="api-card__head"><div class="sig">ncplot.xarray — Dataset.ncplot.view() / DataArray.ncplot.view()</div></div>
85
+ <div class="api-card__body">
86
+ <p>Importing <code>ncplot.xarray</code> registers a <code>.ncplot</code> accessor on every xarray <code>Dataset</code> and <code>DataArray</code>, mirroring xarray's own <code>.plot</code> accessor:</p>
87
+ <div class="code-block">
88
+ <div class="code-card__bar">
89
+ <div class="code-card__dots"><span></span><span></span><span></span></div>
90
+ <span class="code-card__label">python</span>
91
+ </div>
92
+ <pre><span class="tok-kw">import</span> ncplot.xarray
93
+ <span class="tok-kw">import</span> xarray <span class="tok-kw">as</span> xr
94
+
95
+ ds = xr.<span class="tok-fn">open_dataset</span>(<span class="tok-str">"example.nc"</span>)
96
+ ds.ncplot.<span class="tok-fn">view</span>(vars=<span class="tok-str">"sst"</span>, coast=<span class="tok-kw">True</span>)</pre>
97
+ </div>
98
+ <p><code>Dataset.ncplot.view(vars=None, **kwargs)</code> and <code>DataArray.ncplot.view(vars=None, **kwargs)</code> both call <a href="#view"><code>view()</code></a> underneath with <code>self</code> as <code>x</code> — every keyword argument documented above works here too.</p>
99
+ </div>
100
+ </div>
101
+
102
+ <span class="kicker">Command line</span>
103
+
104
+ <div class="api-card" id="cli">
105
+ <div class="api-card__head"><div class="sig">ncplot &lt;file [file ...]&gt;</div></div>
106
+ <div class="api-card__body">
107
+ <p>Installing NCPlot adds an <code>ncplot</code> console command. Give it one or more existing file paths or URLs and it opens an interactive view — a single argument is passed straight to <a href="#view"><code>view()</code></a>, multiple arguments are passed as a list:</p>
108
+ <div class="code-block">
109
+ <div class="code-card__bar">
110
+ <div class="code-card__dots"><span></span><span></span><span></span></div>
111
+ <span class="code-card__label">console</span>
112
+ </div>
113
+ <pre>$ ncplot example.nc
114
+ $ ncplot one.nc two.nc</pre>
115
+ </div>
116
+ </div>
117
+ </div>
118
+
119
+ </div>
120
+ </div>
121
+
122
+ <footer class="site-footer">
123
+ <div class="container footer-pml">
124
+ <a href="https://pml.ac.uk/" target="_blank" rel="noopener"><img src="assets/img/pml_logo.jpg" alt="Plymouth Marine Laboratory"></a>
125
+ <span>Developed by the Environmental Intelligence group at Plymouth Marine Laboratory</span>
126
+ </div>
127
+ <div class="container footer-top">
128
+ <div class="footer-brand">
129
+ <img src="assets/img/ncplot_wordmark.svg" alt="NCPlot">
130
+ <p>Instant, interactive viewing of netCDF files in Python or on the command line.</p>
131
+ <div class="footer-social">
132
+ <a href="https://github.com/pmlmodelling/ncplot" target="_blank" rel="noopener" aria-label="GitHub">
133
+ <svg viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M12 .5C5.73.5.5 5.74.5 12.09c0 5.08 3.29 9.38 7.86 10.9.57.1.79-.25.79-.55 0-.27-.01-1.17-.02-2.12-3.2.7-3.88-1.36-3.88-1.36-.53-1.34-1.29-1.7-1.29-1.7-1.05-.72.08-.71.08-.71 1.17.08 1.78 1.2 1.78 1.2 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.26-1.28-5.26-5.71 0-1.26.45-2.29 1.19-3.09-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.18 1.18a11.1 11.1 0 0 1 5.79 0c2.2-1.49 3.17-1.18 3.17-1.18.64 1.59.24 2.76.12 3.05.74.8 1.18 1.83 1.18 3.09 0 4.44-2.7 5.42-5.28 5.7.42.36.78 1.08.78 2.17 0 1.57-.01 2.83-.01 3.22 0 .3.21.66.8.55A10.6 10.6 0 0 0 23.5 12.1C23.5 5.74 18.27.5 12 .5Z"/></svg>
134
+ </a>
135
+ <a href="mailto:rwi@pml.ac.uk" aria-label="Email">
136
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/><polyline points="22,6 12,13 2,6"/></svg>
137
+ </a>
138
+ </div>
139
+ </div>
140
+ <div class="footer-col">
141
+ <h4>Documentation</h4>
142
+ <ul>
143
+ <li><a href="../../installing.html">Installing</a></li>
144
+ <li><a href="../../quickstart.html">Quickstart</a></li>
145
+ <li><a href="api.html">API reference</a></li>
146
+ </ul>
147
+ </div>
148
+ <div class="footer-col">
149
+ <h4>Project</h4>
150
+ <ul>
151
+ <li><a href="../../about.html">About &amp; contact</a></li>
152
+ <li><a href="../../version-history.html">Version history</a></li>
153
+ <li><a href="https://github.com/pmlmodelling/ncplot" target="_blank" rel="noopener">GitHub repository</a></li>
154
+ <li><a href="https://github.com/pmlmodelling/ncplot/issues" target="_blank" rel="noopener">Report an issue</a></li>
155
+ <li><a href="https://pypi.org/project/ncplot/" target="_blank" rel="noopener">PyPI package</a></li>
156
+ <li><a href="https://anaconda.org/conda-forge/ncplot" target="_blank" rel="noopener">conda-forge package</a></li>
157
+ </ul>
158
+ </div>
159
+ </div>
160
+ <div class="container footer-bottom">
161
+ <span>© 2026 Plymouth Marine Laboratory. Released under the GNU GPLv3 license.</span>
162
+ <span>Built for quick, no-fuss netCDF viewing.</span>
163
+ </div>
164
+ </footer>
165
+
166
+ <button class="back-to-top" aria-label="Back to top">
167
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="19" x2="12" y2="5"/><polyline points="5 12 12 5 19 12"/></svg>
168
+ </button>
169
+
170
+ <script src="assets/js/main.js"></script>
171
+ </body>
172
+ </html>
@@ -0,0 +1,172 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="robots" content="noindex, follow">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <title>API Reference — NCPlot</title>
8
+ <meta name="description" content="Function reference for ncplot: view(), the ncplot.xarray accessor, and the ncplot command line tool.">
9
+ <link rel="icon" type="image/svg+xml" href="assets/img/favicon.svg">
10
+ <link rel="preconnect" href="https://fonts.googleapis.com">
11
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
12
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
13
+ <link rel="stylesheet" href="assets/css/style.css">
14
+ </head>
15
+ <body>
16
+
17
+ <header class="site-header">
18
+ <div class="container nav">
19
+ <a class="brand" href="../../index.html">
20
+ <img src="assets/img/ncplot_wordmark.svg" alt="NCPlot">
21
+ <span class="brand-version">v0.4.2 (archived)</span>
22
+ </a>
23
+ <nav class="nav-links" id="nav-links">
24
+ <a href="../../version-history.html" data-page="version-history.html">Version history</a>
25
+ </nav>
26
+ <div class="nav-actions">
27
+ <a class="icon-btn" href="https://github.com/pmlmodelling/ncplot" target="_blank" rel="noopener" aria-label="NCPlot on GitHub">
28
+ <svg viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M12 .5C5.73.5.5 5.74.5 12.09c0 5.08 3.29 9.38 7.86 10.9.57.1.79-.25.79-.55 0-.27-.01-1.17-.02-2.12-3.2.7-3.88-1.36-3.88-1.36-.53-1.34-1.29-1.7-1.29-1.7-1.05-.72.08-.71.08-.71 1.17.08 1.78 1.2 1.78 1.2 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.26-1.28-5.26-5.71 0-1.26.45-2.29 1.19-3.09-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.18 1.18a11.1 11.1 0 0 1 5.79 0c2.2-1.49 3.17-1.18 3.17-1.18.64 1.59.24 2.76.12 3.05.74.8 1.18 1.83 1.18 3.09 0 4.44-2.7 5.42-5.28 5.7.42.36.78 1.08.78 2.17 0 1.57-.01 2.83-.01 3.22 0 .3.21.66.8.55A10.6 10.6 0 0 0 23.5 12.1C23.5 5.74 18.27.5 12 .5Z"/></svg>
29
+ </a>
30
+ <button class="nav-toggle" id="nav-toggle" aria-label="Toggle menu" aria-expanded="false">
31
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="18" x2="21" y2="18"/></svg>
32
+ </button>
33
+ </div>
34
+ </div>
35
+ </header>
36
+
37
+ <div class="page-hero">
38
+ <div class="container">
39
+ <div class="breadcrumb"><a href="../../index.html">Home</a> / API</div>
40
+ <h1>API reference</h1>
41
+ <p class="lead">NCPlot has one core function — <code>view()</code> — reachable three ways: directly from the top-level <code>ncplot</code> namespace, via the <code>ncplot.xarray</code> accessor, or from the <code>ncplot</code> command line tool.</p>
42
+ </div>
43
+ </div>
44
+
45
+ <div class="container docs-layout">
46
+ <aside class="docs-toc">
47
+ <div class="docs-toc-title">Reference</div>
48
+ <ul>
49
+ <li><a href="#view">view</a></li>
50
+ <li><a href="#xarray-accessor">ncplot.xarray accessor</a></li>
51
+ <li><a href="#cli">Command line</a></li>
52
+ </ul>
53
+ </aside>
54
+
55
+ <div class="docs-content">
56
+
57
+ <span class="kicker">Plotting</span>
58
+
59
+ <div class="api-card" id="view">
60
+ <div class="api-card__head"><div class="sig">ncplot.view(x, vars=None, autoscale=True, out=None, **kwargs)</div></div>
61
+ <div class="api-card__body">
62
+ <p>Plot the contents of a netCDF file, directory, remote URL, or xarray object.</p>
63
+ <details class="param-details" open>
64
+ <summary>Parameters</summary>
65
+ <p>Required:</p>
66
+ <ul class="param-list">
67
+ <li><code class="param-name">x</code><span class="param-tag">required</span><p>An xarray <code>Dataset</code>/<code>DataArray</code>, or a file path, directory, or remote (OPeNDAP/THREDDS) URL pointing to netCDF data.</p></li>
68
+ </ul>
69
+ <p>Optional:</p>
70
+ <ul class="param-list">
71
+ <li><code class="param-name">vars</code><p>A variable name, or list of variable names, to plot. If omitted, every variable in <code>x</code> is plotted.</p></li>
72
+ <li><code class="param-name">autoscale</code><p>Whether colour scales are set automatically from each variable's minimum and maximum values. Default <code>True</code>. Set to <code>False</code> to keep scales fixed, e.g. when comparing several plots.</p></li>
73
+ <li><code class="param-name">out</code><p>Path to save the plot to, instead of displaying it inline. Must end in <code>.html</code>.</p></li>
74
+ <li><code class="param-name">coast</code><p>Draw coastlines on map plots. Default <code>False</code>. Looks best with the optional <code>cartopy</code> dependency installed (see <a href="../../installing.html">Installing</a>).</p></li>
75
+ <li><code class="param-name">clim</code><p>A <code>(min, max)</code> tuple fixing the colour scale range, overriding <code>autoscale</code> for that call.</p></li>
76
+ </ul>
77
+ </details>
78
+ </div>
79
+ </div>
80
+
81
+ <span class="kicker">Accessors</span>
82
+
83
+ <div class="api-card" id="xarray-accessor">
84
+ <div class="api-card__head"><div class="sig">ncplot.xarray — Dataset.ncplot.view() / DataArray.ncplot.view()</div></div>
85
+ <div class="api-card__body">
86
+ <p>Importing <code>ncplot.xarray</code> registers a <code>.ncplot</code> accessor on every xarray <code>Dataset</code> and <code>DataArray</code>, mirroring xarray's own <code>.plot</code> accessor:</p>
87
+ <div class="code-block">
88
+ <div class="code-card__bar">
89
+ <div class="code-card__dots"><span></span><span></span><span></span></div>
90
+ <span class="code-card__label">python</span>
91
+ </div>
92
+ <pre><span class="tok-kw">import</span> ncplot.xarray
93
+ <span class="tok-kw">import</span> xarray <span class="tok-kw">as</span> xr
94
+
95
+ ds = xr.<span class="tok-fn">open_dataset</span>(<span class="tok-str">"example.nc"</span>)
96
+ ds.ncplot.<span class="tok-fn">view</span>(vars=<span class="tok-str">"sst"</span>, coast=<span class="tok-kw">True</span>)</pre>
97
+ </div>
98
+ <p><code>Dataset.ncplot.view(vars=None, **kwargs)</code> and <code>DataArray.ncplot.view(vars=None, **kwargs)</code> both call <a href="#view"><code>view()</code></a> underneath with <code>self</code> as <code>x</code> — every keyword argument documented above works here too.</p>
99
+ </div>
100
+ </div>
101
+
102
+ <span class="kicker">Command line</span>
103
+
104
+ <div class="api-card" id="cli">
105
+ <div class="api-card__head"><div class="sig">ncplot &lt;file [file ...]&gt;</div></div>
106
+ <div class="api-card__body">
107
+ <p>Installing NCPlot adds an <code>ncplot</code> console command. Give it one or more existing file paths or URLs and it opens an interactive view — a single argument is passed straight to <a href="#view"><code>view()</code></a>, multiple arguments are passed as a list:</p>
108
+ <div class="code-block">
109
+ <div class="code-card__bar">
110
+ <div class="code-card__dots"><span></span><span></span><span></span></div>
111
+ <span class="code-card__label">console</span>
112
+ </div>
113
+ <pre>$ ncplot example.nc
114
+ $ ncplot one.nc two.nc</pre>
115
+ </div>
116
+ </div>
117
+ </div>
118
+
119
+ </div>
120
+ </div>
121
+
122
+ <footer class="site-footer">
123
+ <div class="container footer-pml">
124
+ <a href="https://pml.ac.uk/" target="_blank" rel="noopener"><img src="assets/img/pml_logo.jpg" alt="Plymouth Marine Laboratory"></a>
125
+ <span>Developed by the Environmental Intelligence group at Plymouth Marine Laboratory</span>
126
+ </div>
127
+ <div class="container footer-top">
128
+ <div class="footer-brand">
129
+ <img src="assets/img/ncplot_wordmark.svg" alt="NCPlot">
130
+ <p>Instant, interactive viewing of netCDF files in Python or on the command line.</p>
131
+ <div class="footer-social">
132
+ <a href="https://github.com/pmlmodelling/ncplot" target="_blank" rel="noopener" aria-label="GitHub">
133
+ <svg viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M12 .5C5.73.5.5 5.74.5 12.09c0 5.08 3.29 9.38 7.86 10.9.57.1.79-.25.79-.55 0-.27-.01-1.17-.02-2.12-3.2.7-3.88-1.36-3.88-1.36-.53-1.34-1.29-1.7-1.29-1.7-1.05-.72.08-.71.08-.71 1.17.08 1.78 1.2 1.78 1.2 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.26-1.28-5.26-5.71 0-1.26.45-2.29 1.19-3.09-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.18 1.18a11.1 11.1 0 0 1 5.79 0c2.2-1.49 3.17-1.18 3.17-1.18.64 1.59.24 2.76.12 3.05.74.8 1.18 1.83 1.18 3.09 0 4.44-2.7 5.42-5.28 5.7.42.36.78 1.08.78 2.17 0 1.57-.01 2.83-.01 3.22 0 .3.21.66.8.55A10.6 10.6 0 0 0 23.5 12.1C23.5 5.74 18.27.5 12 .5Z"/></svg>
134
+ </a>
135
+ <a href="mailto:rwi@pml.ac.uk" aria-label="Email">
136
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/><polyline points="22,6 12,13 2,6"/></svg>
137
+ </a>
138
+ </div>
139
+ </div>
140
+ <div class="footer-col">
141
+ <h4>Documentation</h4>
142
+ <ul>
143
+ <li><a href="../../installing.html">Installing</a></li>
144
+ <li><a href="../../quickstart.html">Quickstart</a></li>
145
+ <li><a href="api.html">API reference</a></li>
146
+ </ul>
147
+ </div>
148
+ <div class="footer-col">
149
+ <h4>Project</h4>
150
+ <ul>
151
+ <li><a href="../../about.html">About &amp; contact</a></li>
152
+ <li><a href="../../version-history.html">Version history</a></li>
153
+ <li><a href="https://github.com/pmlmodelling/ncplot" target="_blank" rel="noopener">GitHub repository</a></li>
154
+ <li><a href="https://github.com/pmlmodelling/ncplot/issues" target="_blank" rel="noopener">Report an issue</a></li>
155
+ <li><a href="https://pypi.org/project/ncplot/" target="_blank" rel="noopener">PyPI package</a></li>
156
+ <li><a href="https://anaconda.org/conda-forge/ncplot" target="_blank" rel="noopener">conda-forge package</a></li>
157
+ </ul>
158
+ </div>
159
+ </div>
160
+ <div class="container footer-bottom">
161
+ <span>© 2026 Plymouth Marine Laboratory. Released under the GNU GPLv3 license.</span>
162
+ <span>Built for quick, no-fuss netCDF viewing.</span>
163
+ </div>
164
+ </footer>
165
+
166
+ <button class="back-to-top" aria-label="Back to top">
167
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="19" x2="12" y2="5"/><polyline points="5 12 12 5 19 12"/></svg>
168
+ </button>
169
+
170
+ <script src="assets/js/main.js"></script>
171
+ </body>
172
+ </html>