Upload
dwight-webster
View
217
Download
0
Tags:
Embed Size (px)
Citation preview
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
Supercomputing • Communications • Data
NCAR Scientific Computing Division
NCL and PyNGLVisualization for the Geosciences
NCL and PyNGLVisualization for the Geosciences
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
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
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
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
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
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
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
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
Data from the MECCA Project
From a presentation of Jeff Kiehl (NCAR) and Tim Schneider (NOAA)
Wind velocity vectorsWind velocity vectors
Data from the MECCA Project
Data from the MECCA Project
Courtesy Sylvia Murphy, NCAR CGD
From John Ertl, FNMOC
Based on a visualization of Joel Norris (Scripps) using synthetic data
Climate division data courtesy Mark Stevens, NCAR CGD
Courtesy Mark Stevens, NCAR CGD
Supercomputing • Communications • Data
NCAR Scientific Computing Division
Contouring on arbitrary triangular meshes
Image from Jonathan Shewchuk, author of Triangle
Grid from Tom Gross, NOAA/NOS/CSDL/MMAP
Data and grid from Tom Gross, NOAA/NOS/CSDL/MMAP
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
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
Supercomputing • Communications • Data
NCAR Scientific Computing Division
ENDEND