PyNIO Tutorial / SEA 2015

Dave Brown, Mary Haley, Wei Huang, Rick Brownrigg

April 16, 2015
10:30 AM - 12:30 PM
FL2-1022 Large Auditorium



Description

This two hour tutorial will introduce and demo the use of PyNIO for reading and writing geoscientific data in various formats (NetCDF 3/4, GRIB 1/2, HDF-EOS2/5, HDF4/5, Shapefile). We may also employ NumPy, matplotlib, and PyNGL to demonstrate how to visualize various grids and meshes.

Attendees will be given the opportunity to run the tutorial scripts on their own laptops, using example datasets. We'll provide example scripts and data files via the web and/or memory sticks.

The tutorial assumes no advanced knowledge of these data formats, but interested attendees are encouraged to bring their own geophysical datasets (in any of the above mentioned formats) for hands-on exploration.


Installation instructions

Here's the "InstallPyNXX.pdf" file that many of you requested.

If you have installation issues, send email to Mary Haley, haley@ucar.edu.

Attendees who want to participate in the tutorial should have Python 2.6.9 or later (not 3.0) installed on their system, and NumPy 1.7 or later. We highly recommend Python 2.7.9 and NumPy 1.9.2. We can't guarantee that PyNIO will work with older versions of Python or NumPy.

Instructions for Mac and Linux laptops

For users with Mac and Linux laptops, we recommend that you install Anaconda. This will give you Python 2.7.9, NumPy 1.9.2, IPython Notebook and Spyder. (Don't choose the Python 3.4 download).

You can download one of our precompiled PyNIO binaries for various Mac and Linux systems.

Once you have the PyNIO-1.5.0-beta.xxxx.tar.gz and/or PyNGL-1.5.0-beta.xxxx.tar.gz and/or files, you either need to extract the files it in your standard Python "site-packages" directory, or extract the files wherever you want and then set PYTHONPATH to point to the location. We suggest creating a directory specifically for extracting the files. For example:

mkdir /usr/home/haley/pynio_beta_test
cd /usr/home/haley/pynio_beta_test
tar -zxf /path/to/PyNIO-1.5.0-beta.xxxx.tar.gz
tar -zxf /path/to/PyNGL-1.5.0-beta.xxxx.tar.gz
export PYTHONPATH=/usr/home/haley/pynio_beta_test/lib/python2.7/site-packages/PyNIO:/usr/home/haley/pynio_beta_test/lib/python2.7/site-packages/PyNGL

Instructions for Windows laptops

For users with Windows laptops, we recommend installing VirtualBox on your system:

Download these two files from the precompiled binaries page:

PyNIO-1.5.0-beta.Linux-RHEL6.4-x86_64-py279-numpy192-gnu472.tar.gz
PyNGL-1.5.0-beta.Linux-RHEL6.4-x86_64-py279-numpy192-gnu472.tar.gz
and then use the installation instructions under the "Linux and Mac" section above for extracting the files and setting PYTHONPATH.


Running PyNIO on yellowstone

To get the proper python environment loaded to run the beta versions of PyNIO and PyNGL:

module load gnu/4.8.2 
module load python all-python-libs
export PYTHONPATH=/glade/u/ncldev/users/sea2015/PyNIO:/glade/u/ncldev/users/sea2015/PyNGL:$PYTHONPATH

or

module load gnu/4.8.2 
module load python all-python-libs
setenv PYTHONPATH /glade/u/ncldev/users/sea2015/PyNIO:/glade/u/ncldev/users/sea2015/PyNGL:$PYTHONPATH

To run these scripts on yellowstone, you can copy the data and scripts from:

/glade/u/ncldev/users/sea2015/scripts
/glade/u/ncldev/users/sea2015/data

Prerequisites

Attendees must have skill using Python, and some familiarity with NumPy. No climate sciences knowledge is assumed. Familiarity with NetCDF and/or other geoscientific data formats is helpful, but not required.