25
Supercomputing • Communications • NCAR Scientific Computing Div SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred Clare - and many project collaborators NCAR Scientific Computing Division Section Head, Visualization & Enabling Technologies January 11, 2005 85th AMS Annual Meeting January 9-14, 2005

SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Embed Size (px)

Citation preview

Page 1: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Supercomputing • Communications • Data

NCAR Scientific Computing Division

SCD User Briefing NCL and PyNGL

Visualization for the Geosciences

SCD User Briefing NCL and PyNGL

Visualization for the Geosciences

Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred Clare - and many project collaborators

NCAR Scientific Computing Division

Section Head, Visualization & Enabling Technologies

January 11, 2005

Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred Clare - and many project collaborators

NCAR Scientific Computing Division

Section Head, Visualization & Enabling Technologies

January 11, 2005

85th AMS Annual MeetingJanuary 9-14, 2005

Page 2: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Supercomputing • Communications • Data

NCAR Scientific Computing Division

NCL and PyNGLVisualization for the Geosciences

NCL and PyNGLVisualization for the Geosciences

Page 3: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Supercomputing • Communications • Data

NCAR Scientific Computing Division

TopicsTopics NCAR Command Language (NCL) GSUN (NCL visualization interface) PyNGL Example codes and visualizations Future plans

NCAR Command Language (NCL) GSUN (NCL visualization interface) PyNGL Example codes and visualizations Future plans

Page 4: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Supercomputing • Communications • Data

NCAR Scientific Computing Division

What is NCL?What is NCL? NCAR Command Language Scripting language, powerful in 3 areas:

- File input/output- Data processing- Publication-quality visualizations

• Runs on Linux, MacOSX, Solaris, IRIX, AIX, OSF1, Cygwin

Page 5: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Supercomputing • Communications • Data

NCAR Scientific Computing Division

NCL File I/ONCL File I/O

Based on the netCDF model:

• Read/write netCDF, HDF4, ASCII, binary

• Reads GRIB, including ECMWF complex coefficients

One interface for several data formats

Based on the netCDF model:

• Read/write netCDF, HDF4, ASCII, binary

• Reads GRIB, including ECMWF complex coefficients

One interface for several data formats

Page 6: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Supercomputing • Communications • Data

NCAR Scientific Computing Division

NCL Data ProcessingNCL Data ProcessingOver 600 functions and procedures:

• Spherical harmonic based calculations• Scalar and vector regridding• Vertical interpolation, including hybrid

coordinates to pressure level• Spectral/cross spectral and wavelet analysis

Can access Fortran and C routines directly from NCL

Over 600 functions and procedures:

• Spherical harmonic based calculations• Scalar and vector regridding• Vertical interpolation, including hybrid

coordinates to pressure level• Spectral/cross spectral and wavelet analysis

Can access Fortran and C routines directly from NCL

Page 7: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Supercomputing • Communications • Data

NCAR Scientific Computing Division

NCL VisualizationNCL Visualization

Publication-quality visualizations:

• Contour, line, vector, streamline, map

• Customization: hundreds of options

• Output to X11, PostScript, PDF

• Lots of examples

Publication-quality visualizations:

• Contour, line, vector, streamline, map

• Customization: hundreds of options

• Output to X11, PostScript, PDF

• Lots of examples

Page 8: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Supercomputing • Communications • Data

NCAR Scientific Computing Division

GSUN: interface to NCL visualizationGSUN: interface to NCL visualization

“Getting Started Using NCL” Successful collaboration w/CCSM users User-friendly, customized visualization

functions Extensive documentation and examples Interface of choice for NCL visualization GSUN used as a model for PyNGL

“Getting Started Using NCL” Successful collaboration w/CCSM users User-friendly, customized visualization

functions Extensive documentation and examples Interface of choice for NCL visualization GSUN used as a model for PyNGL

Page 9: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Supercomputing • Communications • Data

NCAR Scientific Computing Division

What is PyNGL?What is PyNGL?

Python NCL Graphics Library Python version of popular GSUN interface Same publication-quality graphics as NCL Utilizes existing Python modules Multiple output formats Extensive documentation

Python NCL Graphics Library Python version of popular GSUN interface Same publication-quality graphics as NCL Utilizes existing Python modules Multiple output formats Extensive documentation

Page 10: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Supercomputing • Communications • Data

NCAR Scientific Computing Division

import Nglfrom Scientific.IO.NetCDF import *

# Open the NetCDF file.nfile = NetCDFFile("meccatemp.cdf","r")

# Get lat/lon/temperature variables.lat = nfile.variables["lat"][:]lon = nfile.variables["lon"][:]T = nfile.variables["t"][0,:,:]

# Open a PS workstation.wks = Ngl.open_wks("ps","mecca")

# Set contour & scalar field resources.res = Resources()res.sfXArray = lonres.sfYArray = lat# Tickmarks displayed by default.# Size maximized by default.

# Draw contours over a mapcontour = Ngl.contour_map(wks,T,res)

Ngl.end()

PyNGL

load "gsn_code.ncl"

begin; Open the NetCDF file. nfile = addfile("meccatemp.cdf","r")

; Get lat/lon/temperature variables. lat = nfile->lat lon = nfile->lon T = nfile->t(0,:,:)

; Open a PS workstation. wks = gsn_open_wks("ps","mecca")

; Set contour & scalar field resources. res = True res@sfXArray = lon res@sfYArray = lat res@pmTickMarkDisplayMode = “Always” res@gsnMaximize = True

; Draw contours over a map. contour = gsn_contour_map(wks,T,res)

end

GSUN

Page 11: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Data from the MECCA Project

Page 12: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

From a presentation of Jeff Kiehl (NCAR) and Tim Schneider (NOAA)

Page 13: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Wind velocity vectorsWind velocity vectors

Data from the MECCA Project

Page 14: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Data from the MECCA Project

Page 15: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Courtesy Sylvia Murphy, NCAR CGD

Page 16: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

From John Ertl, FNMOC

Page 17: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Based on a visualization of Joel Norris (Scripps) using synthetic data

Page 18: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Climate division data courtesy Mark Stevens, NCAR CGD

Page 19: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Courtesy Mark Stevens, NCAR CGD

Page 20: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Supercomputing • Communications • Data

NCAR Scientific Computing Division

Contouring on arbitrary triangular meshes

Image from Jonathan Shewchuk, author of Triangle

Page 21: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Grid from Tom Gross, NOAA/NOS/CSDL/MMAP

Page 22: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Data and grid from Tom Gross, NOAA/NOS/CSDL/MMAP

Page 23: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Supercomputing • Communications • Data

NCAR Scientific Computing Division

Future PyNGL plansFuture PyNGL plans

Pythonize NCL’s powerful I/O module and climate and interpolation functions

Add more functionality and examples

Pythonize NCL’s powerful I/O module and climate and interpolation functions

Add more functionality and examples

Page 24: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Supercomputing • Communications • Data

NCAR Scientific Computing Division

PyNGL/NCL Documentation:http://www.pyngl.ucar.edu/http://ngwww.ucar.edu/ncl/

PyNGL/NCL talk email lists:http://www.pyngl.ucar.edu/pyngl-talk/http://ngwww.ucar.edu/ncl/ncl-talk/

Download PyNGL/NCL:http://www.pyngl.ucar.edu/download.htmlhttp://ngwww.ucar.edu/ncl/download.html

Page 25: SCD User Briefing NCL and PyNGL Visualization for the Geosciences Don Middleton with presentation material developed by Luca Cinquini, Mary Haley, Fred

Supercomputing • Communications • Data

NCAR Scientific Computing Division

ENDEND