|
From: <jd...@us...> - 2008-10-25 03:37:18
|
Revision: 6330
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6330&view=rev
Author: jdh2358
Date: 2008-10-25 03:37:12 +0000 (Sat, 25 Oct 2008)
Log Message:
-----------
reorg talk dir
Modified Paths:
--------------
trunk/py4science/examples/convolution_demo.py
trunk/py4science/examples/lotka_volterra.py
trunk/py4science/examples/mkprob.py
trunk/py4science/examples/skel/lotka_volterra_skel.py
trunk/py4science/workbook/README
trunk/py4science/workbook/add_problem
Added Paths:
-----------
trunk/py4science/talks/
trunk/py4science/talks/0712_ncar_intro.lyx
trunk/py4science/talks/0810_berkeley_intro.lyx
trunk/py4science/talks/fig/
trunk/py4science/talks/fig/Fluidlab5.png
trunk/py4science/talks/fig/Fluidlab6.png
trunk/py4science/talks/fig/ipython_parallel.eps
trunk/py4science/talks/fig/ipython_parallel.png
trunk/py4science/talks/fig/jpl_lander_comm_power.png
trunk/py4science/talks/fig/jpl_nav_summary.png
trunk/py4science/talks/fig/kernel2p.eps
trunk/py4science/talks/fig/kernel2p.png
trunk/py4science/talks/fig/mayavi_comb_vol.png
trunk/py4science/talks/fig/mlab-screen-black.png
trunk/py4science/talks/fig/mpl_brain1.png
trunk/py4science/talks/fig/mpl_brain2.png
trunk/py4science/talks/fig/mpl_brain3.png
trunk/py4science/talks/fig/mpl_brain4.png
trunk/py4science/talks/fig/mpl_brain5.png
trunk/py4science/talks/fig/ncar-world-seam.3.png
trunk/py4science/talks/fig/pmv.png
trunk/py4science/talks/fig/pylab-screen.png
trunk/py4science/talks/fig/rho_2d_skel.eps
trunk/py4science/talks/fig/rho_2d_surf.png
trunk/py4science/talks/fig/sage_notebook-medium.jpg
trunk/py4science/talks/fig/vision_beam_pattern.png
trunk/py4science/talks/fig/xkcd_python.png
trunk/py4science/talks/intro_python_scicomp.lyx
trunk/py4science/talks/matplotlib_intro.ppt
trunk/py4science/talks/pydap/
trunk/py4science/talks/pydap/pydap.lyx
trunk/py4science/talks/pydap/pydap.pdf
trunk/py4science/talks/pydap/pydap_arch.png
trunk/py4science/workbook/problems_skel/detect_action_potentials.py
trunk/py4science/workbook/problems_soln/detect_action_potentials.py
Removed Paths:
-------------
trunk/py4science/intro_talk/
trunk/py4science/slides/
trunk/py4science/talks/fig/Fluidlab5.png
trunk/py4science/talks/fig/Fluidlab6.png
trunk/py4science/talks/fig/ipython_parallel.eps
trunk/py4science/talks/fig/ipython_parallel.png
trunk/py4science/talks/fig/jpl_lander_comm_power.png
trunk/py4science/talks/fig/jpl_nav_summary.png
trunk/py4science/talks/fig/kernel2p.eps
trunk/py4science/talks/fig/kernel2p.png
trunk/py4science/talks/fig/mayavi_comb_vol.png
trunk/py4science/talks/fig/mlab-screen-black.png
trunk/py4science/talks/fig/mpl_brain1.png
trunk/py4science/talks/fig/mpl_brain2.png
trunk/py4science/talks/fig/mpl_brain3.png
trunk/py4science/talks/fig/mpl_brain4.png
trunk/py4science/talks/fig/mpl_brain5.png
trunk/py4science/talks/fig/ncar-world-seam.3.png
trunk/py4science/talks/fig/pmv.png
trunk/py4science/talks/fig/pylab-screen.png
trunk/py4science/talks/fig/rho_2d_skel.eps
trunk/py4science/talks/fig/rho_2d_surf.png
trunk/py4science/talks/fig/sage_notebook-medium.jpg
trunk/py4science/talks/fig/vision_beam_pattern.png
trunk/py4science/talks/fig/xkcd_python.png
trunk/py4science/talks/pydap/pydap.lyx
trunk/py4science/talks/pydap/pydap.pdf
trunk/py4science/talks/pydap/pydap_arch.png
Modified: trunk/py4science/examples/convolution_demo.py
===================================================================
--- trunk/py4science/examples/convolution_demo.py 2008-10-24 22:35:25 UTC (rev 6329)
+++ trunk/py4science/examples/convolution_demo.py 2008-10-25 03:37:12 UTC (rev 6330)
@@ -13,7 +13,7 @@
In this exercise, we will compute investigate the convolution of a
white noise process with a double exponential impulse response
-function, and compute the results
+function, and compute the results
* using numpy.convolve
@@ -21,40 +21,40 @@
temporal domain is a multiplication in the fourier domain
"""
-import numpy as npy
+import numpy as np
import matplotlib.mlab as mlab
-from pylab import figure, show
+import matplotlib.pyplot as plt
# build the time, input, output and response arrays
dt = 0.01
-t = npy.arange(0.0, 20.0, dt) # the time vector from 0..20
+t = np.arange(0.0, 20.0, dt) # the time vector from 0..20
Nt = len(t)
def impulse_response(t):
'double exponential response function'
- return (npy.exp(-t) - npy.exp(-5*t))*dt
+ return (np.exp(-t) - np.exp(-5*t))*dt
-x = npy.random.randn(Nt) # gaussian white noise
+x = np.random.randn(Nt) # gaussian white noise
# evaluate the impulse response function, and numerically convolve it
# with the input x
r = impulse_response(t) # evaluate the impulse function
-y = npy.convolve(x, r, mode='full') # convultion of x with r
+y = np.convolve(x, r, mode='full') # convultion of x with r
y = y[:Nt]
# compute y by applying F^-1[F(x) * F(r)]. The fft assumes the signal
# is periodic, so to avoid edge artificats, pad the fft with zeros up
# to the length of r + x do avoid circular convolution artifacts
-R = npy.fft.fft(r, len(r)+len(x)-1)
-X = npy.fft.fft(x, len(r)+len(x)-1)
+R = np.fft.fft(r, len(r)+len(x)-1)
+X = np.fft.fft(x, len(r)+len(x)-1)
Y = R*X
# now inverse fft and extract just the part up to len(x)
-yi = npy.fft.ifft(Y)[:len(x)].real
+yi = np.fft.ifft(Y)[:len(x)].real
# plot t vs x, t vs y and yi, and t vs r in three subplots
-fig = figure()
+fig = plt.figure()
ax1 = fig.add_subplot(311)
ax1.plot(t, x)
ax1.set_ylabel('input x')
@@ -73,4 +73,4 @@
fig.savefig('convolution_demo.png', dpi=150)
fig.savefig('convolution_demo.eps')
-show()
+plt.show()
Modified: trunk/py4science/examples/lotka_volterra.py
===================================================================
--- trunk/py4science/examples/lotka_volterra.py 2008-10-24 22:35:25 UTC (rev 6329)
+++ trunk/py4science/examples/lotka_volterra.py 2008-10-25 03:37:12 UTC (rev 6330)
@@ -1,24 +1,40 @@
-import numpy as n
-import pylab as p
+import numpy as np
+import matplotlib.pyplot as plt
import scipy.integrate as integrate
def dr(r, f):
- return alpha*r - beta*r*f
-
+ """
+ return the derivative of *r* (the rabbit population) evaulated as a
+ function of *r* and *f*. The function should work whether *r* and *f*
+ are scalars, 1D arrays or 2D arrays. The return value should have
+ the same dimensionality (shape) as the inputs *r* and *f*.
+ """
+ return alpha*r - beta*r*f #@
+
def df(r, f):
- return gamma*r*f - delta*f
+ """
+ return the derivative of *f* (the fox population) evaulated as a
+ function of *r* and *f*. The function should work whether *r* and *f*
+ are scalars, 1D arrays or 2D arrays. The return value should have
+ the same dimensionality (shape) as the inputs *r* and *f*.
+ """
+ return gamma*r*f - delta*f #@
def derivs(state, t):
"""
- Map the state variable [rabbits, foxes] to the derivitives
- [deltar, deltaf] at time t
+ Return the derivatives of r and f, stored in the *state* vector::
+
+ state = [r, f]
+
+ The return data should be [dr, df] which are the derivatives of r
+ and f at position state and time *t*
"""
- #print t, state
- r, f = state # rabbits and foxes
- deltar = dr(r, f) # change in rabbits
- deltaf = df(r, f) # change in foxes
- return deltar, deltaf
+ r, f = state # and foxes #@
+ deltar = dr(r, f) # in rabbits #@
+ deltaf = df(r, f) # in foxes #@
+ return deltar, deltaf #@
+# the parameters for rabbit and fox growth and interactions
alpha, delta = 1, .25
beta, gamma = .2, .05
@@ -26,53 +42,71 @@
r0 = 20
f0 = 10
-t = n.arange(0.0, 100, 0.1)
+# create a time array from 0..100 sampled at 0.1 second steps
+t = np.arange(0.0, 100, 0.1) #@
+
y0 = [r0, f0] # the initial [rabbits, foxes] state vector
-y = integrate.odeint(derivs, y0, t)
-r = y[:,0] # extract the rabbits vector
-f = y[:,1] # extract the foxes vector
-p.figure()
-p.plot(t, r, label='rabbits')
-p.plot(t, f, label='foxes')
-p.xlabel('time (years)')
-p.ylabel('population')
-p.title('population trajectories')
-p.grid()
-p.legend()
-p.savefig('lotka_volterra.png', dpi=150)
-p.savefig('lotka_volterra.eps')
+# integrate your ODE using scipy.integrate. Read the help to see what
+# is available
+#@ HINT: see scipy.integrate.odeint
+y = integrate.odeint(derivs, y0, t) #@
+# the return value from the integration is a Nx2 array. Extract it
+# into two 1D arrays caled r and f using numpy slice indexing
+r = y[:,0] # extract the rabbits vector #@
+f = y[:,1] # extract the foxes vector #@
-p.figure()
-p.plot(r, f, color='red')
-p.xlabel('rabbits')
-p.ylabel('foxes')
-p.title('phase plane')
+# time series plot: plot the population of rabbits and foxes as a
+# funciton of time
+plt.figure()
+plt.plot(t, r, label='rabbits')
+plt.plot(t, f, label='foxes')
+plt.xlabel('time (years)')
+plt.ylabel('population')
+plt.title('population trajectories')
+plt.grid()
+plt.legend()
+plt.savefig('lotka_volterra.png', dpi=150)
+plt.savefig('lotka_volterra.eps')
+# phase-plane plot: plot the population of foxes versus rabbits
+# make sure you include and xlabel, ylabel and title
+plt.figure() #@
+plt.plot(r, f, color='red') #@
+plt.xlabel('rabbits') #@
+plt.ylabel('foxes') #@
+plt.title('phase plane') #@
-# make a direction field plot with quiver
-rmax = 1.1 * r.max()
-fmax = 1.1 * f.max()
-R, F = n.meshgrid(n.arange(-1, rmax), n.arange(-1, fmax))
-dR = dr(R, F)
-dF = df(R, F)
-p.quiver(R, F, dR, dF)
+# Create 2D arrays for R and F to represent the entire phase plane --
+# the point (R[i,j], F[i,j]) is a single (rabbit, fox) combinations.
+# pass these arrays to the functions dr and df above to get 2D arrays
+# of dR and dF evaluated at every point in the phase plance.
+rmax = 1.1 * r.max() #@
+fmax = 1.1 * f.max() #@
+R, F = np.meshgrid(np.arange(-1, rmax), np.arange(-1, fmax)) #@
+dR = dr(R, F) #@
+dF = df(R, F) #@
+plt.quiver(R, F, dR, dF) #@
-R, F = n.meshgrid(n.arange(-1, rmax, .1), n.arange(-1, fmax, .1))
-dR = dr(R, F)
-dF = df(R, F)
-p.contour(R, F, dR, levels=[0], linewidths=3, colors='blue')
-p.contour(R, F, dF, levels=[0], linewidths=3, colors='green')
-p.ylabel('foxes')
-p.title('trajectory, direction field and null clines')
+# Now find the nul-clines, for dR and dF respectively. These are the
+# points where dR=0 and dF=0 in the (R, F) phase plane. You can use
+# matplotlib's countour routine to find the zero level. See the
+# levels keyword to contour. You will need a fine mesh of R and F,
+# reevaluate dr and df on the finer grid, and use contour to find the
+# level curves
+R, F = np.meshgrid(np.arange(-1, rmax, 0.1), np.arange(-1, fmax, 0.1)) #@
+dR = dr(R, F) #@
+dF = df(R, F) #@
+plt.contour(R, F, dR, levels=[0], linewidths=3, colors='blue') #@
+plt.contour(R, F, dF, levels=[0], linewidths=3, colors='green') #@
+plt.ylabel('foxes') #@
+plt.title('trajectory, direction field and null clines') #@
-p.savefig('lotka_volterra_pplane.png', dpi=150)
-p.savefig('lotka_volterra_pplane.eps')
+plt.savefig('lotka_volterra_pplane.png', dpi=150)
+plt.savefig('lotka_volterra_pplane.eps')
+plt.show()
-
-p.show()
-
Modified: trunk/py4science/examples/mkprob.py
===================================================================
--- trunk/py4science/examples/mkprob.py 2008-10-24 22:35:25 UTC (rev 6329)
+++ trunk/py4science/examples/mkprob.py 2008-10-25 03:37:12 UTC (rev 6330)
@@ -35,14 +35,14 @@
import sys
# Third-party imports
-import nose
+#import nose
# Constants
MARKER = '#@'
DEL_RE = re.compile(r'''^((\s*)(.*?))\s*%s\s*$''' % MARKER)
HINT_RE = re.compile(r'''^(?P<space>\s*)%s\s+(?P<hint>.*)$''' % MARKER)
-
+
#-----------------------------------------------------------------------------
# Main code begins
@@ -52,7 +52,7 @@
Inputs:
src : sequence of lines (file-like objects work out of the box)
"""
-
+
out = []
addline = out.append
for line in src:
@@ -66,7 +66,7 @@
# if marker is matched in code, strip it and leave the code
line = mdel.group(1)+'\n'
addline(line)
-
+
return ''.join(out)
@@ -94,19 +94,19 @@
#msg = '1 line' if del_lines==1 else ('%s lines' % del_lines)
#exc = exc_tpl % msg
exc = exc_tpl
-
+
# Use the last value of 'space'
line = '%s%s' % (spaces[0],exc)
out.append(line)
del_lines = 0
spaces[:] = []
-
+
return del_lines
-
+
# used to report actual # of lines removed - disabled
- #exc_tpl = "raise NotImplementedError('%s missing')\n"
+ #exc_tpl = "raise NotImplementedError('%s missing')\n"
exc_tpl = "raise NotImplementedError('insert missing code here')\n"
-
+
# states for state machine and other initialization
normal,delete = 0,1
state_cur = normal
@@ -114,7 +114,7 @@
spaces = []
normal_lines = []
out = []
-
+
# To remove multiple consecutive lines of input marked for deletion, we
# need a small state machine.
for line in src:
@@ -134,7 +134,7 @@
state_new = delete
del_lines += 1
spaces.append(mdel.group(2))
-
+
# Flush output only when there's a change of state
if state_new != state_cur:
del_lines = flush_buffers(normal_lines,del_lines)
@@ -144,7 +144,7 @@
# Final buffer flush is unconditional
flush_buffers(normal_lines)
-
+
return ''.join(out)
@@ -155,14 +155,14 @@
# get the mode of the input so that we can create the output files with the
# same mode
fmode = os.stat(fpath).st_mode
-
+
with open(fpath) as infile:
# Generate the skeleton
skel = src2skel(infile)
with open(fname_skel,'w') as fskel:
fskel.write(skel)
os.chmod(fname_skel,fmode)
-
+
# Reset the input file pointer and generate the solution
infile.seek(0)
soln = src2soln(infile)
@@ -193,7 +193,7 @@
def main(argv=None):
"""Main entry point as a command line script for normal execution"""
-
+
if argv is None:
argv = sys.argv
@@ -229,8 +229,8 @@
"""Check that two strings are equal ignoring trailing whitespace."""
#print '***S1\n',s1,'\n***S2\n',s2 # dbg
nose.tools.assert_equal(s1.rstrip(),s2.rstrip())
-
+
def test_simple():
src = """
first line
@@ -238,13 +238,13 @@
second line
"""
srclines = src.splitlines(True)
-
+
clean = """
first line
raise NotImplementedError('insert missing code here')
second line
"""
-
+
cleaned = src2skel(srclines)
yield str_match,cleaned,clean
@@ -255,8 +255,8 @@
"""
cleaned = src2soln(src.splitlines(True))
yield str_match,cleaned,clean
-
+
def test_multi():
src = """
first line
@@ -306,7 +306,7 @@
yield str_match,cleaned,clean
-@nose.tools.nottest
+#@nose.tools.nottest
def test():
"""Simple self-contained test runner."""
nose.runmodule(__name__,exit=False,
Modified: trunk/py4science/examples/skel/lotka_volterra_skel.py
===================================================================
--- trunk/py4science/examples/skel/lotka_volterra_skel.py 2008-10-24 22:35:25 UTC (rev 6329)
+++ trunk/py4science/examples/skel/lotka_volterra_skel.py 2008-10-25 03:37:12 UTC (rev 6330)
@@ -1,24 +1,37 @@
-import numpy as n
-import pylab as p
+import numpy as np
+import matplotlib.pyplot as plt
import scipy.integrate as integrate
def dr(r, f):
- return alpha*r - beta*r*f
-
+ """
+ return the derivative of *r* (the rabbit population) evaulated as a
+ function of *r* and *f*. The function should work whether *r* and *f*
+ are scalars, 1D arrays or 2D arrays. The return value should have
+ the same dimensionality (shape) as the inputs *r* and *f*.
+ """
+ raise NotImplementedError('insert missing code here')
+
def df(r, f):
- return gamma*r*f - delta*f
+ """
+ return the derivative of *f* (the fox population) evaulated as a
+ function of *r* and *f*. The function should work whether *r* and *f*
+ are scalars, 1D arrays or 2D arrays. The return value should have
+ the same dimensionality (shape) as the inputs *r* and *f*.
+ """
+ raise NotImplementedError('insert missing code here')
def derivs(state, t):
"""
- Map the state variable [rabbits, foxes] to the derivitives
- [deltar, deltaf] at time t
+ Return the derivatives of r and f, stored in the *state* vector::
+
+ state = [r, f]
+
+ The return data should be [dr, df] which are the derivatives of r
+ and f at position state and time *t*
"""
- #print t, state
- r, f = state # rabbits and foxes
- deltar = dr(r, f) # change in rabbits
- deltaf = df(r, f) # change in foxes
- return deltar, deltaf
+ raise NotImplementedError('insert missing code here')
+
alpha, delta = 1, .25
beta, gamma = .2, .05
@@ -26,53 +39,53 @@
r0 = 20
f0 = 10
-t = n.arange(0.0, 100, 0.1)
+t = np.arange(0.0, 100, 0.1)
y0 = [r0, f0] # the initial [rabbits, foxes] state vector
y = integrate.odeint(derivs, y0, t)
r = y[:,0] # extract the rabbits vector
f = y[:,1] # extract the foxes vector
-p.figure()
-p.plot(t, r, label='rabbits')
-p.plot(t, f, label='foxes')
-p.xlabel('time (years)')
-p.ylabel('population')
-p.title('population trajectories')
-p.grid()
-p.legend()
-p.savefig('lotka_volterra.png', dpi=150)
-p.savefig('lotka_volterra.eps')
+plt.figure()
+plt.plot(t, r, label='rabbits')
+plt.plot(t, f, label='foxes')
+plt.xlabel('time (years)')
+plt.ylabel('population')
+plt.title('population trajectories')
+plt.grid()
+plt.legend()
+plt.savefig('lotka_volterra.png', dpi=150)
+plt.savefig('lotka_volterra.eps')
-p.figure()
-p.plot(r, f, color='red')
-p.xlabel('rabbits')
-p.ylabel('foxes')
-p.title('phase plane')
+plt.figure()
+plt.plot(r, f, color='red')
+plt.xlabel('rabbits')
+plt.ylabel('foxes')
+plt.title('phase plane')
# make a direction field plot with quiver
rmax = 1.1 * r.max()
fmax = 1.1 * f.max()
-R, F = n.meshgrid(n.arange(-1, rmax), n.arange(-1, fmax))
+R, F = np.meshgrid(np.arange(-1, rmax), np.arange(-1, fmax))
dR = dr(R, F)
dF = df(R, F)
-p.quiver(R, F, dR, dF)
+plt.quiver(R, F, dR, dF)
-R, F = n.meshgrid(n.arange(-1, rmax, .1), n.arange(-1, fmax, .1))
+R, F = np.meshgrid(np.arange(-1, rmax, .1), np.arange(-1, fmax, .1))
dR = dr(R, F)
dF = df(R, F)
-p.contour(R, F, dR, levels=[0], linewidths=3, colors='blue')
-p.contour(R, F, dF, levels=[0], linewidths=3, colors='green')
-p.ylabel('foxes')
-p.title('trajectory, direction field and null clines')
+plt.contour(R, F, dR, levels=[0], linewidths=3, colors='blue')
+plt.contour(R, F, dF, levels=[0], linewidths=3, colors='green')
+plt.ylabel('foxes')
+plt.title('trajectory, direction field and null clines')
-p.savefig('lotka_volterra_pplane.png', dpi=150)
-p.savefig('lotka_volterra_pplane.eps')
+plt.savefig('lotka_volterra_pplane.png', dpi=150)
+plt.savefig('lotka_volterra_pplane.eps')
-p.show()
+plt.show()
Copied: trunk/py4science/talks/0712_ncar_intro.lyx (from rev 6308, trunk/py4science/intro_talk/0712_ncar_intro.lyx)
===================================================================
--- trunk/py4science/talks/0712_ncar_intro.lyx (rev 0)
+++ trunk/py4science/talks/0712_ncar_intro.lyx 2008-10-25 03:37:12 UTC (rev 6330)
@@ -0,0 +1,2400 @@
+#LyX 1.5.1 created this file. For more info see http://www.lyx.org/
+\lyxformat 276
+\begin_document
+\begin_header
+\textclass beamer
+\begin_preamble
+% Include only certain frames - this speeds up compilation
+% The frames to be included need to be labeled, by using ERT
+% as [label=LABELNAME] (no backslashes or {})
+%\includeonlyframes{currentt}
+
+% To make a printable handout (one page per frame), pass
+% the handout option to the doc class (Layout menu)
+
+% For good fonts in PDFs, use pslatex fonts (Layout menu)
+
+% Colors and symbols
+\usepackage{latexsym}
+\usepackage{color}
+
+% Display covered items in transparent form (as opposed
+% to not showing them at all)
+\newcommand{\coveredinvisible}{
+ \setbeamercovered{invisible}
+}
+\newcommand{\coveredvisible}{
+ \setbeamercovered{highly dynamic}
+}
+
+% Choose default setting here:
+\coveredvisible
+
+\newcommand{\ps}{\vspace{-4mm} }
+
+% Theme configuration. I've basically built a custom theme out of
+% Warsaw, adding infoline and changing the nav. symbol bar
+
+% Warning: the commands below are order-sensitive!
+
+% load the infolines theme, b/c I want the headline Warsaw
+% uses (split), but the footline from infolines.
+% In the document body, these will be deactivated for the title and
+% turned on later
+\useoutertheme{infolines}
+% Main theme
+\usetheme{Warsaw}
+% Adjust the color for the center (title) box to be that of
+% infolines, which Warsaw changes
+\setbeamercolor*{title in head/foot}{parent=palette secondary}
+
+% Define a minimal set of navigation symbols
+\defbeamertemplate*{navigation symbols}{minmal}
+{%
+ \hbox{%
+ \hbox{\insertframenavigationsymbol}
+ \hbox{\insertdocnavigationsymbol}
+ \hbox{\insertbackfindforwardnavigationsymbol}%
+ }%
+}
+% activate the minimal navbar
+\setbeamertemplate{navigation symbols}[minimal]
+
+%%%%% HACK %%%%%
+% I started getting errors because LyX is emmitting a color 'none'
+% call, which confuses xcolor. I'm defining 'none' to be black here.
+\definecolor{none}{cmyk}{0,0,0,1}
+%%%%% /HACK %%%%%
+\end_preamble
+\options compress
+\language english
+\inputencoding auto
+\font_roman times
+\font_sans helvet
+\font_typewriter courier
+\font_default_family default
+\font_sc false
+\font_osf false
+\font_sf_scale 100
+\font_tt_scale 100
+\graphics default
+\paperfontsize default
+\spacing single
+\papersize default
+\use_geometry false
+\use_amsmath 2
+\use_esint 0
+\cite_engine basic
+\use_bibtopic false
+\paperorientation landscape
+\secnumdepth 2
+\tocdepth 2
+\paragraph_separation indent
+\defskip medskip
+\quotes_language english
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tracking_changes false
+\output_changes false
+\author ""
+\author ""
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Standard
+Some things to fix in a future version:
+\end_layout
+
+\begin_layout Standard
+- trim a bit of time
+\end_layout
+
+\begin_layout Standard
+- add more about ipython and my own python work, reduce that of others
+\end_layout
+
+\begin_layout Standard
+- add a final python pros/cons, esp.
+ the cons part.
+ It will make things more balanced.
+\end_layout
+
+\begin_layout Standard
+- the PDE part repeats a bit the 'python benefits' which were already pounded
+ on.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+% disable the bottom bar for the title and outline pages
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+
+\backslash
+setbeamertemplate{footline}{}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+vspace*{-5mm}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Title
+Python in Scientific Computing
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+Python & Scientific Computing
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subtitle
+An Introduction
+\end_layout
+
+\begin_layout Author
+Fernando\InsetSpace ~
+Pérez
+\newline
+
+\family typewriter
+\size scriptsize
+<Fer...@co...>
+\family default
+\size default
+
+\newline
+John Hunter
+\newline
+
+\family typewriter
+\size scriptsize
+<jd...@gm...>
+\family default
+\size default
+
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+FP/JDH
+\begin_inset Note Note
+status collapsed
+
+\begin_layout Standard
+This is used by the 'split' footline theme on the left side of the page
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+vspace{5mm}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Institute
+Applied Mathematics, U.
+ of Colorado at Boulder
+\newline
+Tradelink
+\begin_inset Note Note
+status open
+
+\begin_layout Standard
+- Use the
+\backslash
+inst command only if there are several affiliations.
+\end_layout
+
+\begin_layout Standard
+- Keep it simple, no one is interested in your street address.
+\end_layout
+
+\end_inset
+
+
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+CU\InsetSpace ~
+Boulder/Tradelink
+\begin_inset Note Note
+status open
+
+\begin_layout Standard
+optional, but mostly needed
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+vspace{5mm}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Date
+NCAR, Boulder
+\newline
+Dec 7, 2007
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+NCAR, 12/7/07
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Standard
+If you have a file called "institution-logo-filename.xxx", where xxx is a
+ graphic format that can be processed by latex or pdflatex, resp., then you
+ can add a logo by uncommenting the following:
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+%
+\backslash
+pgfdeclareimage[height=0.5cm]{institution-logo}{institution-logo-filename}
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+%
+\backslash
+logo{
+\backslash
+pgfuseimage{institution-logo}}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Standard
+The following causes the table of contents to be shown at the beginning
+ of every Section.
+ Delete this, if you do not want it.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+AtBeginSection[]{
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+
+\backslash
+frame<beamer>{
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+
+\backslash
+frametitle{Outline}
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+
+\backslash
+tableofcontents[currentsection]
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+}
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Standard
+If you wish to uncover everything in a step-wise fashion, uncomment the
+ following command:
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+%
+\backslash
+beamerdefaultoverlayspecification{<+->}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+% reactivate the footline
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+
+\backslash
+setbeamertemplate{footline}[infolines theme]
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+Outline
+\end_layout
+
+\begin_layout Standard
+\begin_inset LatexCommand tableofcontents
+
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+[pausesections]
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Scientific Computing
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+SciComp
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Traditional approaches
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+Status quo
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+FORTRAN, C and C++
+\end_layout
+
+\begin_layout Itemize
+Tools optimized for CPUs, not humans.
+\end_layout
+
+\begin_layout Itemize
+Low-level:
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+Primitive data types (no good strings, sets, hash tables,
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+ldots
+\end_layout
+
+\end_inset
+
+).
+\end_layout
+
+\begin_layout Itemize
+Manual memory management: bugs, bugs, bugs.
+ Hard ones.
+\end_layout
+
+\begin_layout Itemize
+Slow edit/compile/test cycle.
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
+Clumsy access to visualization, quick profiling, text processing,
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+ldots
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+No interactive facilities - scientific work is inherently exploratory.
+\end_layout
+
+\begin_layout Pause
+
+\end_layout
+
+\begin_layout Standard
+
+\series bold
+\color blue
+However!
+\end_layout
+
+\begin_layout Itemize
+They deliver excellent performance.
+\end_layout
+
+\begin_layout Itemize
+Millions of LOC in proven scientific codes.
+
+\end_layout
+
+\begin_layout Itemize
+We need to
+\emph on
+\color blue
+work with these tools
+\emph default
+\color inherit
+, not replace them!
+\end_layout
+
+\begin_layout BeginFrame
+Higher level tools in the last decade
+\end_layout
+
+\begin_layout Itemize
+Mathematica and Maple: a unique niche we won't address today.
+\end_layout
+
+\begin_layout Itemize
+IDL and Matlab: extremely popular, for good reasons.
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+Great interactivity, visualization, and extensive libraries.
+\end_layout
+
+\begin_layout Itemize
+Unpleasant languages for large-scale programs and non-numerical tasks.
+\end_layout
+
+\begin_layout Itemize
+Expensive/proprietary: lock-in.
+\end_layout
+
+\begin_layout Itemize
+Often considered `prototyping' tools: this leads to a lot of code rewriting.
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
+A common approach (I've been there): mix and match multiple tools:
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+FORTRAN, C, C++ programs ...
+\end_layout
+
+\begin_layout Itemize
+driven by Bash/awk/sed/Perl scripts ...
+\end_layout
+
+\begin_layout Itemize
+which feed them input and take their outputs ...
+\end_layout
+
+\begin_layout Itemize
+and pass them to Gnuplot, Grace, OpenDX, etc.
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
+Many different syntaxes:
+\color none
+
+\color red
+huge context switching overhead!
+\end_layout
+
+\begin_layout Subsection
+Python?
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+Python
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+Python in this context
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+Free
+\color none
+ (BSD license), highly portable (Linux, OSX, Solaris, Windows, ...).
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+Interactive
+\color none
+ interpreter provided.
+\end_layout
+
+\begin_layout Itemize
+Extremely readable syntax (
+\color blue
+
+\begin_inset Quotes eld
+\end_inset
+
+executable pseudo-code
+\begin_inset Quotes erd
+\end_inset
+
+
+\color none
+).
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+Simple
+\color none
+: non-professional programmers can become (and remain) proficient with a
+ very small effort (c.f.
+ C++).
+\end_layout
+
+\begin_layout Itemize
+Clean object oriented model, but
+\color none
+
+\color blue
+not mandatory
+\color none
+.
+\end_layout
+
+\begin_layout Itemize
+Rich built-in types: lists, sets, dictionaries (hash tables), strings, ...
+\end_layout
+
+\begin_layout Itemize
+Very comprehensive standard library (
+\color blue
+batteries included
+\color none
+)
+\end_layout
+
+\begin_layout Itemize
+Standard libraries for IDL/Matlab-like arrays (NumPy)
+\end_layout
+
+\begin_layout Itemize
+Easy to wrap existing C, C++ and FORTRAN codes.
+\end_layout
+
+\begin_layout Section
+Interlude: Python in the real world
+\begin_inset OptArg
+status collapsed
+
+\begin_layout Standard
+Examples
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+EEG analysis for epilepsy
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+EEG
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+Data analysis for epilepsy surgery
+\end_layout
+
+\begin_layout FrameSubtitle
+Isolating the origin of drug-resistant epileptic seizures which require
+ surgery.
+\end_layout
+
+\begin_layout Standard
+John Hunter, Department of Pediatric Neurology, University of Chicago.
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/mpl_brain1.png
+ lyxscale 50
+ width 80text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+Electrode location in 3D, combined with MRI data
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/mpl_brain3.png
+ lyxscale 50
+ width 90text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+Correlation analysis of seizure data
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/mpl_brain4.png
+ lyxscale 50
+ width 90text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+Final location of epileptic foci for surgery
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/mpl_brain5.png
+ lyxscale 50
+ width 90text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Multiwavelets for PDEs
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+PDEs
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+Adaptive, multiwavelet algorithms for integral operators
+\end_layout
+
+\begin_layout Standard
+Gregory Beylkin, Vani Cheruvu, Fernando Perez.
+ Applied Math, U.
+ of Colorado at Boulder.
+\end_layout
+
+\begin_layout Itemize
+Fast application of integral kernels.
+ (Partial Differential Equations)
+\end_layout
+
+\begin_layout Itemize
+Implementation went from 1 to 3 dimensions directly (
+\emph on
+extremely
+\emph default
+ unusual).
+\end_layout
+
+\begin_layout Itemize
+Very complex algorithm that goes beyond pure numerics.
+\end_layout
+
+\begin_layout Itemize
+Very good performance, thanks to NumPy, F2PY and weave.
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/rho_2d_surf.png
+ lyxscale 80
+ width 35text%
+
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+hspace{1cm}
+\end_layout
+
+\end_inset
+
+
+\begin_inset Graphics
+ filename fig/rho_2d_skel.eps
+ lyxscale 80
+ width 25text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+JPL: Mars mission data visualization
+\begin_inset OptArg
+status collapsed
+
+\begin_layout Standard
+JPL - Mars
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+JPL: Mars mission trajectory design and nav data
+\end_layout
+
+\begin_layout FrameSubtitle
+Ted Drain and Lynn Craig, Jet Propulsion Laboratory (NASA/Caltech)
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size footnotesize
+From: Name Elided <nam...@jp...>
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size footnotesize
+Date: Oct 2, 2007 7:15 PM
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size footnotesize
+Subject: Fwd: matplotlib bug numbers
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size footnotesize
+To: John Hunter <jd...@gm...>
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+vspace{5mm}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size tiny
+One of my lead developers mentioned that they had sent a bug to you about
+ the annotations feature of MatPlotLib.
+ Would you be able to let me know what the timeline is to resolve that bug?
+ The reason is that the feature is needed for the Phoenix project and their
+ arrival at Mars will be in March sometime, but they are doing their testing
+ in the coming few months.
+ This annotation feature is used on reports that present the analysis of
+ the trajectory to the navigation team and it shows up on our schedule.
+ It would really help me to know approximately when it could be resolved.
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size tiny
+B-plane plots are used to show the trajectory of a spacecraft with respect
+ to the target body (specifically perpendicular to the incoming asymptote
+ of the spacecraft trajectory) and we plot them with the y-axis inverted.
+ The plot is used heavily in flight operations so it is important to our
+ customers.
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size tiny
+In addition, we have what is called a thundering heard plot where many different
+ trajectory solutions (determined from different measurement sources) are
+ plotted together.
+ The annotations are import there so we can see which plot corresponds to
+ each source of data.
+ I hope it helps to know how your code will be used in spacecraft navigation.
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+\size tiny
+Thanks for all your efforts.
+\end_layout
+
+\begin_layout BeginPlainFrame
+JPL: Mars mission data visualization
+\end_layout
+
+\begin_layout Standard
+Expected communication power levels between an orbiting spacecraft and a
+ lander as it goes through the atmosphere:
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/jpl_lander_comm_power.png
+ lyxscale 25
+ width 90text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+JPL: Mars mission data visualization (2)
+\end_layout
+
+\begin_layout Standard
+Summary of the current navigation team activities and modelling (data used,
+ event times etc):
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+vspace{-3mm}
+\end_layout
+
+\end_inset
+
+
+\begin_inset Graphics
+ filename fig/jpl_nav_summary.png
+ lyxscale 50
+ width 90text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+PMV: structural bioinformatics
+\begin_inset OptArg
+status collapsed
+
+\begin_layout Standard
+PMV
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+PMV: the Python Molecule Viewer
+\end_layout
+
+\begin_layout FrameSubtitle
+Michel F.
+ Sanner, Molecular Biology Department, The Scripps Research Institute.
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/pmv.png
+ lyxscale 50
+ width 100text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+MayaVi: customizable data visualization
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+MayaVi
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+MayaVi: sophisticated data visualization
+\end_layout
+
+\begin_layout Itemize
+Free, easy to use scientific data visualizer.
+\end_layout
+
+\begin_layout Itemize
+Heavy lifting of OpenGL-based rendering: VTK (a C++ library).
+\end_layout
+
+\begin_layout Itemize
+A very good example of how to properly use Python:
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+MayaVi is a standalone GUI program...
+\end_layout
+
+\begin_layout Itemize
+but also a Python library callable by any other Python program.
+\end_layout
+
+\begin_layout Itemize
+Python: very easy to modify, even by adding at runtime user-defined modules
+ which populate the GUI automatically.
+\end_layout
+
+\begin_layout Itemize
+C++: excellent rendering performance, fully hardware-accelerated OpenGL.
+\end_layout
+
+\end_deeper
+\begin_layout Pause
+
+\end_layout
+
+\begin_layout Standard
+
+\series bold
+\color blue
+The punchline:
+\series default
+\color none
+ fully programmable visualization, with builtin access to all kinds of numerical
+ (and other) libraries from within the viz tool.
+\end_layout
+
+\begin_layout BeginPlainFrame
+FluidLab: a MayaVi based CFD visualization tool
+\end_layout
+
+\begin_layout Standard
+K.
+ Julien, P.
+ Schmitt (now NCAR), B.
+ Barrow, F.
+ Pérez (App.
+ Math, CU).
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/Fluidlab5.png
+ lyxscale 50
+ width 90text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+Volumetric rendering with FluidLab
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/Fluidlab6.png
+ lyxscale 50
+ width 90text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+SAGE: System for Algebra and Geometry Experimentation
+\begin_inset OptArg
+status collapsed
+
+\begin_layout Standard
+SAGE
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+SAGE: open source mathematics
+\end_layout
+
+\begin_layout FrameSubtitle
+Winner of the 2007 Trophés du Libre, scientific software category
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/sage_notebook-medium.jpg
+ lyxscale 50
+ width 90text%
+ keepAspectRatio
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+IPython
+\end_layout
+
+\begin_layout BeginFrame
+IPython
+\end_layout
+
+\begin_layout FrameSubtitle
+Extensible interactive environment with parallel computing support
+\end_layout
+
+\begin_layout Enumerate
+
+\color blue
+A better Python shell
+\color none
+: object introspection, system access, 'magic' command system for adding
+ functionality when working interactively,
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+ldots
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+
+\color blue
+An embeddable interpreter
+\color none
+: useful for debugging and for mixing batch-processing with interactive
+ work.
+\end_layout
+
+\begin_layout Enumerate
+
+\color blue
+A flexible component
+\color none
+: you can use it as the base environment for other systems with Python as
+ the underlying language.
+ It is very configurable in this direction.
+\end_layout
+
+\begin_layout Enumerate
+
+\color blue
+A system for interactive control of distributed/parallel computing systems.
+
+\color none
+
+\end_layout
+
+\begin_layout Enumerate
+
+\color blue
+An interactive component
+\color none
+ we can plug into GUIs, browser-based shells, etc.
+\end_layout
+
+\begin_layout BeginPlainFrame
+IPython: IDL-like interactive use
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/pylab-screen.png
+ lyxscale 30
+ width 90text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+IPython: interactive control of VTK visualizations
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/mlab-screen-black.png
+ lyxscale 50
+ width 90text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+IPython's future
+\end_layout
+
+\begin_layout FrameSubtitle
+A 2-process kernel on the network
+\end_layout
+
+\begin_layout Standard
+Work with Brian Granger (Tech-X, Boulder) and Benjamin Ragan-Kelley (U.
+ C.
+ Berkeley physics).
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/kernel2p.png
+ lyxscale 50
+ width 80text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+Distributed/parallel computing
+\end_layout
+
+\begin_layout Itemize
+Think of Python as 'the CPU'
+\end_layout
+
+\begin_layout Itemize
+But these souped-up kernels let you talk to it conveniently.
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/ipython_parallel.png
+ lyxscale 50
+ width 80text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+PyNGL
+\end_layout
+
+\begin_layout BeginPlainFrame
+PyNGL - Python interface to NCAR's NCL
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+import
+\family default
+\color none
+
+\family typewriter
+\color blue
+numpy
+\color none
+, Ngl, Nio
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+dirc = Ngl.pynglpath("data")
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+cfile = Nio.open_file(dirc + "/cdf/seam.nc")
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+lon =
+\family default
+\color none
+
+\family typewriter
+\color blue
+numpy
+\color none
+.ravel(cfile.variables["lon2d"][:,:])
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+lat =
+\family default
+\color none
+
+\family typewriter
+\color blue
+numpy
+\color none
+.ravel(cfile.variables["lat2d"][:,:])
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+ps =
+\family default
+\color none
+
+\family typewriter
+\color blue
+numpy
+\color none
+.ravel(cfile.variables["ps"][0,:,:])/100.
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+rlist = Ngl.Resources()
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+rlist.wkColorMap = "BlAqGrYeOrReVi200"
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+wks_type = "ps"
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+wks = Ngl.open_wks(wks_type,"seam",rlist)
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+resources = Ngl.Resources()
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+resources.sfXArray = lon
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+resources.sfYArray = lat
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+map = Ngl.contour_map(wks,ps,resources)
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+Ngl.end()
+\end_layout
+
+\begin_layout BeginFrame
+PyNGL
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Graphics
+ filename fig/ncar-world-seam.3.png
+ lyxscale 50
+ width 90text%
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection*
+Others
+\end_layout
+
+\begin_layout BeginFrame
+A few other projects
+\end_layout
+
+\begin_layout FrameSubtitle
+Python is becoming very popular in many different scientific areas
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+PyDAP:
+\color none
+ Python implementation of the OpenDAP protocols (client
+\series bold
+and
+\series default
+ server).
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+PyTables:
+\color none
+ HDF-5 read-write support with excellent performance.
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+PyTrilinos:
+\color none
+ Python interface to Sandia's Trilinos parallel solvers.
+ Coupled with IPython, they can be used interactively.
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+PyRAF:
+\color none
+ Hubble Space Telescope interface to IRAF, a standard in astronomical image
+ processing.
+
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+VPython:
+\color none
+ easy, real-time 3D programming (Carnegie Mellon, used for an introductory
+ mechanics course).
+\end_layout
+
+\begin_layout Itemize
+
+\color blue
+Galaxy:
+\color none
+ integrated access to multiple tools in genomics research.
+
+\color blue
+Very impressive
+\color none
+.
+\end_layout
+
+\begin_layout Section
+Development in Python
+\begin_inset OptArg
+status collapsed
+
+\begin_layout Standard
+Development\InsetSpace ~
+Model
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+Python compared to IDL, Matlab, etc.
+\end_layout
+
+\begin_layout ExampleBlock
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+<+->{Pros}
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout ExampleBlock
+A general programming language:
+\series bold
+this is a feature
+\series default
+!
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+Free, open source, extremely portable: from the OLPC or a cellphone (Nokia)
+ to a supercomputer.
+\end_layout
+
+\begin_layout Itemize
+Networking, text processing, XML parsing, databases, etc
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+ldots
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+Integrated support for testing (
+\family typewriter
+unittest
+\family default
+,
+\family typewriter
+doctest
+\family default
+)
+\end_layout
+
+\begin_layout Itemize
+Automatic API documentation tools (
+\family typewriter
+epydoc, doxygen
+\family default
+).
+\end_layout
+
+\begin_layout Itemize
+Supports all major GUI toolkits.
+\end_layout
+
+\begin_layout Itemize
+Extremely expressive for complex algorithms.
+\end_layout
+
+\end_deeper
+\begin_layout Separator
+
+\end_layout
+
+\begin_layout AlertBlock
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+<+->{There are still rough edges!}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+Installation, deployment: harder than needed (but improving).
+\end_layout
+
+\begin_layout Itemize
+No good, single-point of entry integrated help system.
+\end_layout
+
+\begin_layout Itemize
+Lots of good documentation, but scattered all over.
+\end_layout
+
+\begin_layout Itemize
+Funding agency support for infrastructure work is difficult to get.
+\end_layout
+
+\end_deeper
+\begin_layout BeginFrame
+A different model of development
+\end_layout
+
+\begin_layout FrameSubtitle
+
+\emph on
+\color red
+Global optimization is the root of all evil
+\end_layout
+
+\begin_layout Itemize
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+<+->
+\end_layout
+
+\end_inset
+
+Never write `
+\family typewriter
+main()
+\family default
+' in C anymore:
+\color none
+
+\color red
+you are optimizing globally!
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+Prototype the code in Python.
+\end_layout
+
+\begin_layout Itemize
+Wrap existing libraries for Python access and reuse them (Numeric, LAPACK,
+ VTK, ...)
+\end_layout
+
+\begin_layout Itemize
+Identify remaining hot spots via
+\color none
+
+\color blue
+profiling
+\color none
+.
+\end_layout
+
+\begin_layout Itemize
+Rewrite
+\color none
+
+\color blue
+only
+\color none
+ the code for those hot spots in C/C++/FORTRAN.
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+<+->
+\end_layout
+
+\end_inset
+
+The resulting code will be production-ready:
+\color none
+
+\color blue
+no throw-away codes
+\color none
+.
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+Make your code available as a library for
+\color none
+
+\color blue
+interactive use
+\color none
+.
+\end_layout
+
+\begin_layout Itemize
+Integrate plotting, visualization, logging, ..., into your objects.
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+<+->
+\end_layout
+
+\end_inset
+
+
+\color blue
+Apply this to existing codes
+\color none
+
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+Break them into a library core and control layers.
+\end_layout
+
+\begin_layout Itemize
+Wrap the libraries and expose them to Python.
+\end_layout
+
+\begin_layout Itemize
+Write all new control as quick, light Python scripts.
+\end_layout
+
+\end_deeper
+\begin_layout Section*
+Wrapup
+\end_layout
+
+\begin_layout BeginFrame
+Summary
+\end_layout
+
+\begin_layout Itemize
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+<+->
+\end_layout
+
+\end_inset
+
+
+\color blue
+Python
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+An excellent language for scientific computing development.
+\end_layout
+
+\begin_layout Itemize
+Scales from interactive exploration to full-blown production codes.
+\end_layout
+
+\begin_layout Itemize
+Accessible to scientists who are not professional programmers.
+\end_layout
+
+\end_deeper
+\begin_layout Standard
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+vskip0pt plus.5fill
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+<+->
+\end_layout
+
+\end_inset
+
+
+\color red
+Outlook
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+NumPy, SciPy, matplotlib, IPython, MayaVi, Sage, etc
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+ldots
+\end_layout
+
+\end_inset
+
+:
+\series bold
+all
+\series default
+are moving forward and improving.
+\end_layout
+
+\begin_layout Itemize
+Major DOE, NSF, NiH projects are adopting it as a core technology.
+\end_layout
+
+\begin_layout Itemize
+Yearly conference at Caltech (August) growing.
+\end_layout
+
+\begin_layout Itemize
+These projects are all Open Source: if you find a flaw, a bug, or a missing
+ feature,
+\color none
+
+\emph on
+\color blue
+jump on board!
+\end_layout
+
+\begin_layout Itemize
+There are still many rough edges to which various projects can contribute.
+\end_layout
+
+\end_deeper
+\begin_layout BeginPlainFrame
+Thank you! Questions?
+\end_layout
+
+\begin_layout FrameSubtitle
+Credit: http://xkcd.com/353
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+vspace{-5mm}
+\end_layout
+
+\end_inset
+
+
+\begin_inset Graphics
+ filename fig/xkcd_python.png
+ lyxscale 50
+ height 85pheight%
+ BoundingBox -4bp -4bp 518bp 588bp
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginPlainFrame
+
+\end_layout
+
+\begin_layout Standard
+\align center
+
+\series bold
+\size largest
+\color blue
+We're done here!
+\end_layout
+
+\begin_layout EndFrame
+
+\end_layout
+
+\begin_layout Section*
+\start_of_appendix
+\begin_inset Note Note
+status collapsed
+
+\begin_layout Standard
+All of the following is optional and typically not needed.
+\end_layout
+
+\end_inset
+
+Appendix
+\end_layout
+
+\begin_layout Subsection*
+URLs
+\end_layout
+
+\begin_layout BeginFrame
+Some useful URLs
+\end_layout
+
+\begin_layout Itemize
+A collection of links on Python and Scientific Computing:
+\color blue
+
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://amath.colorado.edu/faculty/fperez/python/scicomp"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+SciPy:
+\color none
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://www.scipy.org"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+IPython, an improved interactive shell
+\color blue
+:
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://ipython.scipy.org"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+Matplotlib, 2d plotting with Matlab syntax
+\color blue
+:
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://matplotlib.sourceforge.net"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+MayaVi, 3d data visualization:
+\color blue
+
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://mayavi.sourceforge.net"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+PyX, programmatic PostScript generation (with
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+LaTeX
+\end_layout
+
+\end_inset
+
+ support)
+\color blue
+:
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://pyx.sourceforge.net"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+F2Py (FORTRAN):
+\color none
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://cens.ioc.ee/projects/f2py2e"
+
+\end_inset
+
+
+\color none
+
+\end_layout
+
+\begin_layout Itemize
+SWIG (C/C++ for Python):
+\color none
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://swig.org"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout BeginFrame
+URLs for projects mentioned earlier
+\end_layout
+
+\begin_layout Itemize
+VPython, real-time 3D:
+\color none
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://vpython.org"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+UCSF Chimera - interactive molecular graphics
+\color blue
+:
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://www.cgl.ucsf.edu/chimera"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+PyRAF - Hubble Space Telescope interface to IRAF
+\color blue
+:
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://www.stsci.edu/resources/software_hardware/pyraf"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+BioPython -
+\color none
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://biopython.org"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+VisionEgg - vision research experiments (OpenGL):
+\color blue
+
+\newline
+
+\begin_inset LatexCommand htmlurl
+target "http://www.visionegg.org"
+
+\end_inset
+
+
+\color none
+
+\end_layout
+
+\begin_layout Itemize
+Natural Language Toolkit:
+\newline
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://nltk.sourceforge.net"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+Neural Integrator - visual programming for neural networks:
+\newline
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://starship.python.net/crew/seehof/NeuralPython.html"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+Orange - component-based data mining:
+\newline
+
+\color blue
+
+\begin_inset LatexCommand htmlurl
+target "http://www.ailab.si/orange"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout EndFrame
+
+\end_layout
+
+\end_body
+\end_document
Copied: trunk/py4science/talks/0810_berkeley_intro.lyx (from rev 6308, trunk/py4science/intro_talk/0810_berkeley_intro.lyx)
===================================================================
--- trunk/py4science/talks/0810_berkeley_intro.lyx (rev 0)
+++ trunk/py4science/talks/0810_berkeley_intro.lyx 2008-10-25 03:37:12 UTC (rev 6330)
@@ -0,0 +1,2274 @@
+#LyX 1.5.5 created this file. For more info see http://www.lyx.org/
+\lyxformat 276
+\begin_document
+\begin_header
+\textclass beamer
+\begin_preamble
+% Include only certain frames - this speeds up compilation
+% The frames to be included need to be labeled, by using ERT
+% as [label=LABELNAME] (no backslashes or {})
+%\includeonlyframes{currentt}
+
+% To make a printable handout (one page per frame), pass
+% the handout option to the doc class (Layout menu)
+
+% For good fonts in PDFs, use pslatex fonts (Layout menu)
+
+% Colors and symbols
+\usepackage{latexsym}
+\usepackage{color}
+
+% Display covered items in transparent form (as opposed
+% to not showing them at all)
+\newcommand{\coveredinvisible}{
+ \setbeamercovered{invisible}
+}
+\newcommand{\coveredvisible}{
+ \setbeamercovered{highly dynamic}
+}
+
+% Choose default setting here:
+\coveredvisible
+
+\newcommand{\ps}{\vspace{-4mm} }
+
+% Theme configuration. I've basically built a custom theme out of
+% Warsaw, adding infoline and changing the nav. symbol bar
+
+% Warning: the commands below are order-sensitive!
+
+% load the infolines theme, b/c I want the headline Warsaw
+% uses (split), but the footline from infolines.
+% In the document body, these will be deactivated for the title and
+% turned on later
+\useoutertheme{infolines}
+% Main theme
+\usetheme{Warsaw}
+% Adjust the color for the center (title) box to be that of
+% infolines, which Warsaw changes
+\setbeamercolor*{title in head/foot}{parent=palette secondary}
+
+% Define a minimal set of navigation symbols
+\defbeamertemplate*{navigat...
[truncated message content] |