ComPlot: Comparison Plotter to visually evaluate ocean model simulations

ComPlot is a library of Ferret scripts that aims to create intuitive plots comparing one or more model outputs with one or more observational datasets. The main purpose of ComPlot is to compare model results with data by plotting the data onto the model output as dots. It is meant for oceanographers who want to compare ocean model output with observations, and do so in freedom. ComPlot is free software. This means you are free to run it, to study and change it, and to redistribute copies with or without changes.


Background
There is a lot of visualisation software available, ranging from general plotting languages and programs with low-level visualisation libraries, to more specific programs and libraries specialised for specific purposes.Popular visualisation libraries include matplotlib (Hunter 2007) (Python) and ggplot2 (R) (W.2016).There are also many web solutions available, typically written in JavaScript.One example of such a solution is D3.js, and a more specialised example is a clickable, sortable, stacked bar chart based on the Stacked Bar Chart.
Ocean and atmosphere model output is typically saved on irregular grids in NetCDF files.Many languages and packages can load NetCDF files, and often it is also possible, albeit with some effort, to convert this to a regular lon-lat grid and plot it on the screen.One approach is using Python with one of the NetCDF packages and matplotlib.If the grid data is stored in the NetCDF file, it should be possible to plot the model data from an irregular grid onto a regular grid.With some effort observational data could be plotted onto that for comparison, but the author does not know of user-ready libraries that have that capability.
Plotting of ocean and atmosphere model data should be easy.For quick viewing there is ncview(1), but that does not regrid the data, and it is very limited otherwise as well (it is Figure 1 meant for quickly viewing the data on the screen).Here comes in Ferret, a visualisation and analysis tool for oceanography and meteorology (Hankin et al. 1996).Ferret can easily convert an irregular grid to a regular lon-lat (or polar) grid by including the argument ,nav_lon,nav_lat if the map is stored in the variables nav_lon and nav_lat.The default plotting settings are quite sane but usually not beautiful enough for a paper or a slide.With some effort one can make plot beautiful, and through the PPLUS (PLOT PLUS) library, included in the standard Ferret distribution, one can change many of the visualisation properties of the plot.However, a quick search through the Ferret mailinglist shows that the interaction between PPLUS and Ferret is unpredictable, at least for those who are no experts in PPLUS.
PyFerret is a wrapper, written in Python, around Ferret.This brings Python functionality to Ferret, and the graphics backend is modernised.Both Ferret and Python users may want to have a look at this software.
Arguably, another shortcoming of visualisation software, when used by ocean and atmosphere modellers, is that there is no generic way to load model output files and obervational datasets (if one wants to compare model with data).One may of course define the right data structures themselves, be it within the classical Ferret language or PyFerret, but that does not provide the user with a ready, standard way to (meta)structure the data.
That is where ComPlot comes in.ComPlot is a collection of Ferret scripts to easily plot model output and data as coloured dots on top of it.The following figure from (van Hulten et al. 2017) is an example of a ComPlot plot.This is a rather specific capability, but one that is very useful for visual inspection of the goodness-of-fit of the model.Plots made with ComPlot should always be amended with statistical goodness-of-fits, like a correlation coefficient or a reliability index (Stow et al. 2009).One should realise that such statistical numbers try to reduce the full complexity of a model-data comparison to a single number; ComPlot presents much more, albeit at a single section of the ocean and with an uncertainty of the discretisation used of the key (or the human eye if the key is finer than that) and the resolution defined by ComPlot (zonal, latitudinal or depth range).
. Other features/advantages of ComPlot include: • model files and observational data are loaded in a structured manner; • plotting of profile with render_profile.jnl; • plotting of horizontal section with render_layer.jnl;• plotting of arbitrary vertical transects with render_transect.jnl;• adjustable delta to include more or less observations near the section or profile (model data averages over same region); • higher-level user scripts c2d_*.jnl(compare to data); • adjustable visual properties through init_visuals.jnl.
See README.mdfrom the ComPlot repository for further details.