Skip to content

Load Variables

Carlos Downie edited this page Jun 5, 2019 · 22 revisions

To load variables from a data file you have already accessed, open the VCDAT control panel if it is not already open by clicking on the CDAT logo on the left side of your screen.

Once the VCDAT control panel is open, click on the "Load Variables" button. Next double click on the data/netCDF file in which you are interested (for example the clt.nc netCDF file).

The JupyterLab file browser allows you to double click on a file to open it. Unfortunately this means loading the whole file into the browser. For netCDF files this is not practical (these files can be several Gb), so we kill the transfer to prevent the file from loading. Unfortunately this brings up the following error message. You can safely ignore the error message and move on. The creators of Jupyterlab are aware of the problem and are implementing a solution for big files.

File Loading Message In VCDAT

When a list of variables displays (it can take a few seconds the first time), select a variable in which you are interested and click on the red "Edit" button. Next move the sliders to create a subset of data from the file.

If you see the "not UTC-8 encoded" error and nothing happens after you click OK, follow these steps:

  1. Type import cdms2 in a Jupyter notebook cell.
  2. When prompted to turn on logging, type "Yes" (or "No" if you really don't want to save logging details). You may still see the error message about the data not being UTC-8 encoded, but the tool will work despite the error message.

Total Cloudiness (clt.nc) Example

In the downloaded sample data, you will find a total cloudiness netCDF file called clt.nc. It contains three variables:

  • clt: total cloudiness on a monthly basis for 10 years from January 1979 up to and including December 1988.
  • u: eastward component of wind speed (i.e. wind blowing from west to east)
  • v: northward component of wind speed (i.e. wind blowing from south to north)

To load the total cloudiness variable, clt, click on this variable and a red "Edit" button should appear.

Click on the "Edit" button to subset the data if desired by moving the blue dots at the ends of the sliders. When satisfied with the subset of data, click on the blue "Load" button in the lower right corner of the window.

The python code to load that subset of data shows up in the next cell of the notebook displayed in the main window. Now you'll likely want to plot the variables.

You can’t perform that action at this time.