Visualization Control System Principles

VCS Allows scientists to produce highly customized plots. Everything can be precisely and logically controlled, without any guessing game

The CDAT software was developed by LLNL. This tutorial was written by Charles Doutriaux. This work was performed under the auspices of the U.S. Department of Energy by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344.

Download the Jupyter Notebook

In [1]:
# VCS Objects definitions
import vcs
import cdms2
import os
vcs.download_sample_data_files()
with cdms2.open(os.path.join(vcs.sample_data,"clt.nc")) as f:
    clt = f("clt")
    u = f("u")
    v = f("v")
with cdms2.open(os.path.join(vcs.sample_data,"sampleCurveGrid4.nc")) as f:
    curv = f("sample")
with cdms2.open(os.path.join(vcs.sample_data,"sampleGenGrid3.nc")) as f:
    gen = f("sample")

x = vcs.init(geometry=(600,400),bg=True)

# Styling for notebook
from IPython.core.display import HTML
HTML("""
<style>
.output_png {
    display: table-cell;
    text-align: center;
    vertical-align: middle;
}
</style>
""")
MD5: /home/nadeau1/.cache/Python-Eggs/vcs-v8.1_9_g266121be-py3.7.egg-tmp/share/vcs/sample_files.txt
Downloading: 'ts_da.nc' from 'https://cdat.llnl.gov/cdat/sample_data/' in: /software/anaconda53/envs/cdms2/share/cdat/sample_data/ts_da.nc
Downloading: 'tas_mo.nc' from 'https://cdat.llnl.gov/cdat/sample_data/' in: /software/anaconda53/envs/cdms2/share/cdat/sample_data/tas_mo.nc
Downloading: 'tas_6h.nc' from 'https://cdat.llnl.gov/cdat/sample_data/' in: /software/anaconda53/envs/cdms2/share/cdat/sample_data/tas_6h.nc
Downloading: 'th_yr.nc' from 'https://cdat.llnl.gov/cdat/sample_data/' in: /software/anaconda53/envs/cdms2/share/cdat/sample_data/th_yr.nc
Downloading: 'th_yr.nc' from 'https://cdat.llnl.gov/cdat/sample_data/' in: /software/anaconda53/envs/cdms2/share/cdat/sample_data/th_yr.nc
Downloading: 'th_yr.nc' from 'https://cdat.llnl.gov/cdat/sample_data/' in: /software/anaconda53/envs/cdms2/share/cdat/sample_data/th_yr.nc
Downloading: 'geos5-sample.nc' from 'https://cdat.llnl.gov/cdat/sample_data/' in: /software/anaconda53/envs/cdms2/share/cdat/sample_data/geos5-sample.nc
Out[1]:

Introduction

Back to Top

VCS Allows scientists to produce highly customized plots. Everything can be precisely and logically controlled, without any guessing game

Essentially a vcs plot can be broken down into three parts

WHAT is plotted (e.g data and labels) HOW it is rendered (isolines, boxfill, isofill, vectors, etc...) and WHERE (location on the page each elements is to be plotted)

What

Back to Top

This is the scientific piece of information that the user is trying to represent for others (or self) to understand. It can be as raw as a simple numpy object. But it is recommended to use CDMS's transient variables. CDNS transient variables contain metadata such as name, units, geospatial information, that can be used by VCS to represent data better.

The [tutorials] section has many documents for CDMS. The CDMS documentation can be found here

How

Back to Top

This describe the data representation, at the highest level it is a graphics method i.e boxfill, isofill, vectors, streamlines, line plot, etc... But it also contains information to further control these plot types, e.g which colors to use, which levels, lines thickness, etc...

Graphic methods also describe how axes and labels show be represented (e.g which axes values to show and which text to use for it, the user might want to show the -20. longitude represented as 20S or the date 2020-01-15 shown as Jan 2020

Currently VCS supports the following graphic methods:

Boxfill

Back to Top

Boxfill is used to represent 2 dimensional arrays, filling each array cell with a color representing its value. In the case of rectilinear grids (x and y axes can be representing by a 1 dimension array) represented via CDMS, we use the axes bounds to determine the extends of each cell. This is especially useful if an axis is not increasing constantly (e.g, gaussian grid, pressure levels)

For more information on boxfill please see the dedicated tutorial.

In [2]:
gm = vcs.createboxfill()
x.plot(clt, gm)
Out[2]:

Isoline

Back to Top

Isoline is a line on a map, chart, or graph connecting points of equal value.

For more information on isolines please see the dedicated tutorial.

In [3]:
gm = vcs.createisoline()
x.clear()
x.plot(clt,gm)
Out[3]:

Isofill

Back to Top

Isofill is similar to isolines (and usually plotted in conjounction with it) except that the are between two consecutive isoline is filled with a color representing the range of values in this area.

For more information on boxfill please see the dedicated tutorial.

In [4]:
x.clear()
gm = vcs.createisofill()
x.plot(clt,gm)
Out[4]:

Meshfill

Back to Top

Meshfill is very similar to boxfill, but is used to represent data on generic grids (a.k.a native representation). Based on the input data and a mesh

For more information on meshfill please see the dedicated tutorial.

In [5]:
x.clear()
gm = x.createmeshfill()
gm.mesh = True
x.plot(gen, gm)
Out[5]:

Streamlines

Back to Top

For more information on streamlines please see the dedicated tutorial.

In [6]:
x.clear()
gm = vcs.createstreamline()
x.plot(u,v,gm)
Out[6]: