Revision: 3959
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3959&view=rev
Author:   jdh2358
Date:     2007-10-16 18:15:48 -0700 (Tue, 16 Oct 2007)

Log Message:
-----------
made a classes dir for course specific items

Modified Paths:
--------------
    trunk/py4science/examples/distributions.py
    trunk/py4science/examples/logistic/maplib.pyc

Added Paths:
-----------
    trunk/py4science/classes/
    trunk/py4science/classes/course_checklist_umich.py
    trunk/py4science/classes/pomona_agenda.doc
    trunk/py4science/classes/pomona_agenda.txt

Copied: trunk/py4science/classes/course_checklist_umich.py (from rev 3942, 
trunk/py4science/course_checklist_umich.py)
===================================================================
--- trunk/py4science/classes/course_checklist_umich.py                          
(rev 0)
+++ trunk/py4science/classes/course_checklist_umich.py  2007-10-17 01:15:48 UTC 
(rev 3959)
@@ -0,0 +1,15 @@
+#!/usr/bin/env python
+"""Minimal test script to check for modules needed in python course"""
+
+modules = ['numpy','scipy','matplotlib','IPython']
+
+
+for mname in modules:
+    try:
+        exec "import %s" % mname
+    except ImportError:
+        print '*** ERROR: module %s could not be imported.' % mname
+    else:
+        print '%s: OK' % mname
+
+print 'Also remember to check that SPE is installed.'

Added: trunk/py4science/classes/pomona_agenda.doc
===================================================================
(Binary files differ)


Property changes on: trunk/py4science/classes/pomona_agenda.doc
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/py4science/classes/pomona_agenda.txt
===================================================================
--- trunk/py4science/classes/pomona_agenda.txt                          (rev 0)
+++ trunk/py4science/classes/pomona_agenda.txt  2007-10-17 01:15:48 UTC (rev 
3959)
@@ -0,0 +1,45 @@
+DAY 1:
+
+Introduction:
+
+  35 min : Scientific computing in python (standard overhead talk)
+
+  45 min: The core tools -- ipython, numpy, matplotlib and scipy.  (type along)
+
+Break: 15 min
+
+Exercises session 1:
+
+  45 min: Working with data files, web based resources, date handling,
+          CSV files, and record arrays.  Word counting exercise.
+          (urllib, csv, dateutils, matplotlib.mlab)
+
+  45 min: Numerical integration, trapz and Newton's quadrature 
(scipy.integrate)
+
+Lunch Break:  45 min
+
+Exercises session 2:
+
+  45 min: Linear algebra: Moire Glass patterns
+
+  45 min: Statisical distributions, random numbers, central limit theorem 
(scipy.stats)
+
+  45 min: Descriptive statistics and graphs: mean, variance, skew,
+          kurtosis, histograms, autocorrelation, power spectra,
+          spectrogram (scipy.stats, matplotlib.mlab and pylab)
+
+Break:  15 min
+
+Exercises session 3:
+
+  60 min: Interpolation, data modeling and optimization  (scipy.interpolate 
and scipy.optimize)
+
+  45 min: Using code from other languages (FORTRAN, C, C++) --
+          Presentation (pyrex, weave, f2py, ctypes)
+
+
+DAY 2:
+
+Exercise Session 4:
+
+  45 minutes: screen scraping - extracting data from web pages (BeautifulSoup)
\ No newline at end of file

Modified: trunk/py4science/examples/distributions.py
===================================================================
--- trunk/py4science/examples/distributions.py  2007-10-16 19:39:57 UTC (rev 
3958)
+++ trunk/py4science/examples/distributions.py  2007-10-17 01:15:48 UTC (rev 
3959)
@@ -4,7 +4,7 @@
 source using the random number generator.  Verify the numerical
 results by plotting the analytical density functions from scipy.stats
 """
-import numpy
+import numpy as npy
 import scipy.stats
 from pylab import figure, show, close
 
@@ -18,14 +18,14 @@
 
 # in each time interval, the probability of an emission 
 rate = 20.  # the emission rate in Hz
-dx = 0.001  # the sampling interval in seconds
-t = numpy.arange(N)*dx  # the time vector
+dt = 0.001  # the sampling interval in seconds
+t = npy.arange(N)*dt  # the time vector
 
 # the probability of an emission is proportionate to the rate and the interval
-emit_times = t[uninse < rate*dx]
+emit_times = t[uninse < rate*dt]
 
 # the difference in the emission times is the wait time
-wait_times = numpy.diff(emit_times)  
+wait_times = npy.diff(emit_times)  
 
 # plot the distribution of waiting times and the expected exponential
 # density function lambda exp( lambda wt) where lambda is the rate
@@ -37,7 +37,7 @@
 fig = figure()
 ax = fig.add_subplot(111)
 p, bins, patches = ax.hist(wait_times, 100, normed=True)
-l1, = ax.plot(bins, rate*numpy.exp(-rate * bins), lw=2, color='red')
+l1, = ax.plot(bins, rate*npy.exp(-rate * bins), lw=2, color='red')
 l2, = ax.plot(bins, scipy.stats.expon.pdf(bins, 0, 1./rate),
         lw=2, ls='--', color='green')
 ax.set_xlabel('waiting time')
@@ -53,7 +53,7 @@
 # gamma distribution.  Use scipy.stats.gamma to compare the fits.
 # Hint: you can stride your emission times array to get every 2nd
 # emission
-wait_times2 = numpy.diff(emit_times[::2])
+wait_times2 = npy.diff(emit_times[::2])
 fig = figure()
 ax = fig.add_subplot(111)
 p, bins, patches = ax.hist(wait_times2, 100, normed=True)
@@ -79,8 +79,8 @@
 # variance
 expon_mean, expon_var = scipy.stats.expon(0, 1./rate).stats()
 mu, var = 10*expon_mean, 10*expon_var
-sigma = numpy.sqrt(var)
-wait_times10 = numpy.diff(emit_times[::10])
+sigma = npy.sqrt(var)
+wait_times10 = npy.diff(emit_times[::10])
 fig = figure()
 ax = fig.add_subplot(111)
 p, bins, patches = ax.hist(wait_times10, 100, normed=True)

Modified: trunk/py4science/examples/logistic/maplib.pyc
===================================================================
(Binary files differ)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to