Presentation is loading. Please wait.

Presentation is loading. Please wait.

Unidata TDS Workshop Python Overview 22-24 October 2012.

Similar presentations


Presentation on theme: "Unidata TDS Workshop Python Overview 22-24 October 2012."— Presentation transcript:

1 Unidata TDS Workshop Python Overview 22-24 October 2012

2 What is Python An interpreted, dynamic, multi-purpose high- level programming language. Can be used... – as a replacement for proprietary (and $$$) analysis tools. – to build GUI and web apps. – as a higher-level “glue” language to build interfaces to Fortran/C code. Modified from a slide created by Jeff Whitaker, NOAA Earth System Research Lab,

3 Python Open source libs Basic plotting: matplolib (gallery)matplolibgallery Maps: basemap (gallery)basemapgallery Numerics: NumPyNumPy Advanced/Domain Specific Numerics: ScipyScipy I/O: netcdf4-python, pupynere, pygrib, pydapnetcdf4-pythonpupynerepygribpydap Other goodies!goodies You know all that C and FORTRAN you have… Python can leverage it! f2py, ctypesf2pyctypes Must be able to compile the code…I’m looking at you, crufty FORTRAN 77

4 So…python… It slices, it dices, it makes julienne fries!

5 Python Simple syntax hello_world.py print(“hello, world!”) NumPy x = np.arange(10) y = x ** 2 Basic plotting: matplolib import matplotlib.pyplot as plt plt.plot(x,y)

6 Python Interaction with TDS Use pydap to access OPeNDAP urllib2 and netCDF Subset Service (NCSS) Global Ensemble Forecasting System (GEFS) temperature forecast using python and NCSS Ask user for zipcode Read CSV ‘database’ of zip, lat, lon, city, and state info Construct NCSS request URL Save response to disk Load CSV returned by NCSS Plot!


Download ppt "Unidata TDS Workshop Python Overview 22-24 October 2012."

Similar presentations


Ads by Google