Package: ncvue
A minimal GUI for a quick view of netCDF files. Aiming to be a drop-in
replacement forncviewandpanoply.About ncvuencvueis a minimal GUI for a quick view of netCDF files. It is
aiming to be a drop-in replacement forncviewandpanoply, being
slightly more general than ncview targeting maps but providing
animations, zooming and panning capabilities unlike panoply. Ifncvueis used with maps, it supports mostly structured grids, more
precisely the grids supported bycartopy.ncvueis a Python script that can be called from within Python or
as a command line tool. It is not supposed to produce
publication-ready plots but rather provide a quick overview of the
netCDF file.The complete documentation forncvueis available from:https://mcuntz.github.io/ncvue/Quick usage guidencvuecan be run from the command line:ncvuenetcdf_file.ncncvuenetcdf_file1.ncnetcdf_file2.ncor from within Python:fromncvueimportncvuencvue(['netcdf_file.nc'])where the netCDF file is optional. The latter can also be left out and
a netCDF file can be opened with the “Open File” button from withinncvue. The netCDF has to be given in a list because several netcdf
files can be given as in the second example from the command line.Note,ncvueuses theTkAggbackend ofmatplotlib. It must be
called before any other call tomatplotlib. This also means that you
cannot launch it from withiniPythonif it was launched with–pylab. It can be called from within a standardiPython, though,
or usingipython –gui tk.General layoutOn opening,ncvuepresents three panels for different plotting
types: Scatter or Line plots, Contour plots, and Maps. This is the
look in macOS light mode (higher resolution images can be found in thedocumentation):All three panes are organised in this fashion: the plotting canvas,
the Matplotlib navigation toolbar and the pane, where one can choose
the plotting variables and dimensions, as well as plotting
options. You can always choose another panel on top, and open another,
identical window for the same netCDF file with the button “New Window”
on the top right.Map panelIfncvuedetects latitude and longitude variables with a size
greater than 1, it opens the Map panel by default. This is the Map
panel in macOS dark mode, describing all buttons, sliders, entry
boxes, spinboxes, and menus:If it happens that the detection of latitudes and longitudes did not
work automatically, you can choose the correct variables manually. Or
you might use the empty entries on top of the dropdown menus of the
latitudes and longitudes, which uses the index and one can hence
display the matrix within the netCDF file. You might want to switch of
the coastlines in this case.You might want to switch off the automatically detected “global”
option sometimes if your data is on a rotated grid or excludes some
regions such as below minus -60 °S.All dimensions can be set from 0 to the size of the dimension-1, to
“all”, or to any of the arithmetic operators “mean”, “std” (standard
deviation), “min”, “max”, “ptp” (point-to-point amplitude,
i.e. max-min), “sum”, “median”, “var” (variance).Be aware that the underlying cartopy/matplotlib may (or may not) need
a long time to plot the data (with the pseudocolor ‘mesh’ option) if
you change the central longitude of the projection from the central
longitude of your data, which is automatically detected if “central
lon” is set to None. Setting “central lon” to the central longitude of
the input data normally eliminates the problem.Scatter/Line panelIfncvuedoes not detect latitude and longitude variables with a
size greater than 1, it opens the Scatter/Line panel by default. This
is the Scatter/Line panel in macOS dark mode, describing all buttons,
sliders, entry boxes, spinboxes, and menus:The default plot is a line plot with solid lines (line style ‘ls’ is
‘-‘). One can set line style ‘ls’ to None and set a marker symbol,
e.g. ‘o’ for circles, to get a scatter plot. A large variety of line
styles, marker symbols and color notations are supported.ncvuebuilds automatically adatetimevariable from the time
axis. This is correctly interpreted by the underlying Matplotlib also
when zooming into or panning the axes. But it is also much slower than
using the index. Selecting the empty entry on top of the dropdown menu
forxuses the index for the x-axis and is very fast. Plotting a
line plot with 52608 time points takes about 2.2 s on my Macbook Pro
using thedatetimevariable and about 0.3 s using the index
(i.e. empty x-variable). This is especially true if one plots multiple
lines with ‘all’ entries from a specific dimension. Plotting all 10
depths of soil water content for the 52608 time points, as in the
example below, takes also about 0.3 s if using the index as x-variable
but more than 11.1 s when using thedatetimevariable.Contour panelThe last panel provide byncvuedraws contour plots. This is the
Contour panel in macOS dark mode, describing all buttons, sliders,
entry boxes, spinboxes, and menus:This produces also either pseudocolor plots (‘mesh’ ticked) or filled
contour plots (‘mesh’ unticked) just as the Map panel but without any
map projection.Installationncvueis an application written in Python. If you have Python
installed, then the best is to installncvuewithin the Python
universe. The easiest way to installncvueis thence viapipif
you havecartopyinstalled already:pipinstallncvueCartopycan, however, be more elaborate toinstall. The easiest way
to installCartopyor directlyncvueis by usingConda. After
installing, for example,Miniconda:condainstall-cconda-forgencvueSee the installationinstructionsin thedocumentationfor more
information on installingCartopyandncvue with pip.Licensencvueis distributed under the MIT License. See theLICENSEfile
for details.Copyright (c) 2020-2024 Matthias Cuntzncvueuses theAzure2.0 theme byrdbendeon Linux and Windows.The project structure ofncvuewas very originally based on atemplateprovided bySebastian Müllerbut has evolved
considerably.Different netCDF test files were provided byJuliane Mai.