NetCDF and Panoply tutorial

Updated March 2024

NetCDF

NetCDF (Network Common Data Form) is a file format for storing multidimensional scientific data (variables), including satellite observations of variable we wll use in the course such as sea surface temperature, salinity, chlorophyll concentration, and wind speed. Many organizations and scientific groups in different countries have adopted netCDF as a standard way to represent some forms of scientific data.

The NetCDF format has many advantages, the most important of which is that it is self-describing, meaning that software packages can directly read the data and determine its structure, the variable names and essential metadata such as the units. This self-describing aspect of the netCDF file format means that the information needed to ensure accurate work (reduce the incidence of errors) is available within the data itself (no need for additional files). Secondly, it means that different analysis software, like Matlab, R, Python or ArcGIS (among many others), have utilities to read and work with NetCDF files. Thirdly, plotting software (e.g. Ferret, Panoply, ncview) can directly read the netCDF files for visualization.

Example of metadata and data within a NetDCF file

Example structure of a NetCDF file containing SST and Sea Ice over 8 time steps

NASA Panoply

NASA developed the Panoply viewer that allows users to view and visualize data held in NetCDF files. Some feature is the software include:

  • Visualize data from netCDF and HDF files
  • View the metadata
  • View the data
  • Display the data in many different map projections
  • Download visualization as images
  • Create animations
  • Freeware

Panoply visualization, data, and Metadata interfaces

Panoply is available for download at: https://www.giss.nasa.gov/tools/panoply/ and can be run on Windows, Mac and Linux computers.

A set of “how to” instructions can be found to the following URL
https://www.giss.nasa.gov/tools/panoply/help/
Below are a few examples to try out to get you used to visualizing data with the Panoply Viewer.

:bulb: Panoply Version: The examples provided here are based on Panoply Version 5.3.3. Please note that the interface may vary depending on the version you have installed.

Example #1. Make a map of global chlorophyll a concentration

Panoply interface
  • You can visualize the chlor_a variable data.
    • On the leftside of the screen, double-click on the chlor_a variable. Keep the default settings and click Create.(this will take a minute, it’s a big file)
    • Panoply generates an image of the chlorophyll data contained in the file, and opens a popup window “Plot Controls”.

Panoply Create Plot interface

Panoply generated an image of the chlorophyll data contained in the file.
  • View the Data
    • Above the image, click on the “Array 1” tab. This shows you all the values of chlorophyll concentration contained in the file for each longitude/latitude pixel.
  • Adjust the Plot Scale
    • Navigate back to the “Plot” tab.
    • Within the Plot Controls popup window, proceed to the “Show” section and select “Scale”
    • Modify the “Units” setting, changing it from “scalar” to “log10.”
    • Update the “Range” settings to a minimum of 0.02 and a maximum of 2.0.
    • Under the “Color Table” section, you can explore various color palettes. For visualizing chlorophyll concentration, the “MPL_viridis.rgb” palette is recommended, but feel free to select any palette.

:bulb: Plot Controls Window In case the “Plot Controls” popup window is not visible, navigate to the “Windows” option in the top menu. There select “Plot Controls” to bring the window back into view.

  • Modify the Map projection
    • Within the Plot Controls, proceed to the “Show” and select “Map Projection”
    • Select “Mollweide (Oblique)”.
    • Modify the “Center on”: Lon to 180, and Lat to 0 to center the map on the Pacific ocean.
  • Modify the Map Label
    • Within the Plot Controls, proceed to the “Show” and select “Labels”
    • Modify the Title to “VIIRS SNPP Chlorophyll Concentration, March 2021”
  • Save the image to your computer
    • Go to the top menu and choose the “File” option.
    • From the dropdown menu, select “Save Image” (File > Save Image).

:bulb: Additional Color Palettes Additional Panoply color palettes are available to download at https://www.giss.nasa.gov/tools/panoply/colorbars/

Example #2. Make a map of global SST

  • Download data from the West Coast ERDDAP https://coastwatch.pfeg.noaa.gov/erddap/griddap/nesdisBLENDEDsstDNDaily.nc?analysed_sst%5B(2024-03-16T12:00:00Z):1:(2024-03-16T12:00:00Z)%5D%5B(-89.975):1:(89.975)%5D%5B(-179.975):1:(179.975)%5D ​

  • Open the file in Panoply. Scroll down the list of metadata. You can see it looks different from the metadata for the previous file.

    • This is a blended product. Identify the name of the instruments and satellites the data come from. How many satellites were used to create this gap-free SST dataset?
  • Following the same steps as above, create an image of the “analysed_sst” variable with an appropriate color scale. (You do not need to use a log scale for SST though).

    • Change the units to ºC or ºF.
    • Click on “Fit to Data” to adjust the color scale or adjust the range of values manually.
    • Adjust the title with the file’s date.
    • Save to your computer.

Example #3. Zooming in on a region

  • Close any windows showing maps.
  • Double-click on “analysed_sst” again and click ok.
  • To zoom in on a region, push the “Ctrl” key with Windows and the “command” key on Mac. You will see that your cursor changes to a magnifying glass. While keeping the “Ctrl” key down, click and drag over a region of interest. This will generate a plot of SST for that region only.

Example #4: Working with time series data

  • Download monthly wind speed data from the ASCAT instrument on the MetOps satellite for the Alaska region during September through December, 2020.

  • Open the downloaded file in Panoply

  • Create the global map by double clicking on the “mod” variable (“Modulus of Wind Speed). Keep the default settings and click”Create” to create the map.

  • Zoom in on the region with data by holding down the “Ctrl” key with Windows and the “command” key on Mac. While keeping the “Ctrl” key down, click and drag over the data region in the Gulf of Alaska.

  • Within the Plot Controls, proceed to Show and select “Array”.

    • Select a specific date/time to view the data. Try repeatedly clicking on the up arrow next to “Centered time” to animate the Gulf of Alaska entering the windy season.

Four months of wind speed data of Gulf of Alaska

References