Menu

Commit [r3167]  Maximize  Restore  History

added py4science

jdh2358 2007-04-07

1 2 3 .. 17 > >> (Page 1 of 17)
added /trunk/py4science
added /trunk/py4science/README
added /trunk/py4science/book
added /trunk/py4science/book/REQUIREMENTS
added /trunk/py4science/book/examples
added /trunk/py4science/book/examples/.matplotlibrc
added /trunk/py4science/book/examples/README
added /trunk/py4science/book/examples/WallisPi.py
added /trunk/py4science/book/examples/WindowLevelInterface.py
added /trunk/py4science/book/examples/__init__.py
added /trunk/py4science/book/examples/colors.py
added /trunk/py4science/book/examples/erathostenes.py
added /trunk/py4science/book/examples/error.py
added /trunk/py4science/book/examples/fft_demo.py
added /trunk/py4science/book/examples/ip_embed-short.py
added /trunk/py4science/book/examples/ip_embed.py
added /trunk/py4science/book/examples/ip_expensive_init.py
added /trunk/py4science/book/examples/ip_simple.py
added /trunk/py4science/book/examples/ip_simple2.py
added /trunk/py4science/book/examples/mayavi
added /trunk/py4science/book/examples/mayavi/3dsin.vtk
added /trunk/py4science/book/examples/mayavi/3dsin_vol.mv
added /trunk/py4science/book/examples/mayavi/faults
added /trunk/py4science/book/examples/mayavi/mayavi_4d_example
added /trunk/py4science/book/examples/mayavi/surf.py
/trunk/py4science
Directory.
/trunk/py4science/README Diff Switch to side-by-side view
--- a
+++ b/trunk/py4science/README
@@ -0,0 +1,37 @@
+============
+ Py4Science
+============
+
+This directory contains materials for a workshop on the uses of Python for
+scientific computing, as well as the draft of a full book on the same topic. 
+
+
+Workshop
+========
+
+This workshop has been presented, in various forms, at the following places
+(presenter legend below): 
+
+- University of California, Berkeley, Brain Imaging Laboratory. February
+  2005. JDH, FP.
+
+- Los Alamos National Laboratory, Math Division.  June 2005. JDH, FP.
+
+- University of Stellenbosch, South Africa, Depts of Applied Mathematics and
+  Biochemistry (jointly organized).  April 2006.  FP, SvdW.
+
+- University of Michigan, Ann Arbor, Mathematics Dept.  April 2007.  JDH, FP.
+
+Presenters:
+
+- JDH: John. D. Hunter <jdh2358@gmail.com>
+- FP: Fernando Perez <Fernando.Perez@colorado.edu>
+- SvdW: Stefan van der Walt <stefan@sun.ac.za>
+
+
+Book
+====
+
+The book contains material by a number of different authors, listed therein.
+In due time, we plan on this being developed as an open project for wider
+distribution.
/trunk/py4science/book/REQUIREMENTS Diff Switch to side-by-side view
--- a
+++ b/trunk/py4science/book/REQUIREMENTS
@@ -0,0 +1,18 @@
+To build the documentation
+
+  lyx and latex
+
+To run the code, you the following software with the recommended
+version nuber (or more recent)
+
+  python 2.2 with tkinget, readline
+  ipython 0.6.12
+  matplotlib  0.72.1 
+  Numeric 23.7.1
+  numarray 1.2.2
+  scipy 0.3.2
+  VTK 4.4 with patented, hybrid, tcl and python wrappers
+
+  
+
+
/trunk/py4science/book/examples/.matplotlibrc Diff Switch to side-by-side view
--- a
+++ b/trunk/py4science/book/examples/.matplotlibrc
@@ -0,0 +1,200 @@
+### MATPLOTLIBRC FORMAT 
+#
+# This is a sample matplotlib configuration file.   It should be placed
+# in your home dir (Linux and friends) or in the matplotlib data path,
+# ie, where matplotlib installs its data files (fonts, etc).  On
+# windows, this would be, for example, C:\Python23\share\matplotlib.
+# On OSX, using the python framework, it will be (depending on your
+# version number) in /System/Library/Frameworks/Python.framework/Versions/2.3/share/matplotlib/.matplotlibrc
+
+#
+# By default, the installer will overwrite the existing file in the
+# install path, so if you want to preserve your's, please move it to
+# your HOME dir and set the environment variable if necessary.
+#
+# This file is best viewed in a editor which supports python mode
+# syntax highlighting
+#
+# Blank lines, or lines starting with a comment symbol, are ignored,
+# as are trailing comments.  Other lines must have the format
+#
+#   key : val   # optional comment
+#
+# Colors: for the color values below, you can either use 
+#  - a matplotlib color string, such as r, k, or b
+#  - an rgb tuple, such as (1.0, 0.5, 0.0)
+#  - a hex string, such as ff00ff  (no '#' symbol)
+#  - a scalar grayscale intensity such as 0.75
+#  - a legal html color name, eg red, blue, darkslategray
+
+#### CONFIGURATION BEGINS HERE
+backend      : GTKAgg    # the default backend
+numerix      : Numeric   # Numeric or numarray
+interactive  : False     # see http://matplotlib.sourceforge.net/interactive.html
+toolbar      : toolbar2   # None | classic | toolbar2
+timezone     : UTC        # a pytz timezone string, eg US/Central or Europe/Paris
+
+# Where your matplotlib data lives if you installed to a non-default
+# location.  This is where the matplotlib fonts, bitmaps, etc reside
+#datapath : /home/jdhunter/mpldata
+
+
+### LINES
+# See http://matplotlib.sourceforge.net/matplotlib.lines.html for more
+# information on line properties.  Note antialiased rendering looks
+# better, but can be slower.  If you want fast antialiased rendering,
+# use the Agg backend (or TkAgg, GTKAgg, WxAgg)
+lines.linewidth   : 0.5     # line width in points
+lines.linestyle   : -       # solid line
+lines.color       : blue    
+lines.marker      : None    # the default marker
+lines.markerfacecolor  : blue
+lines.markeredgecolor  : black
+lines.markeredgewidth  : 0.5     # the line width around the marker symbol
+lines.markersize  : 6            # markersize, in points
+lines.antialiased : True         # render lines in antialised (no jaggies)
+lines.data_clipping : False      # Use data clipping in addition to viewport
+                                 # clipping.  Useful if you plot long data
+                                 # sets with only a fraction in the viewport
+
+### Patches 
+# Patches are graphical objects that fill 2D space, like polygons or
+# circles.  See
+# http://matplotlib.sourceforge.net/matplotlib.patches.html for more
+# information on patch properties
+patch.linewidth   	: 1.0     # edge width in points
+patch.facecolor  	: blue       
+patch.edgecolor  	: black
+patch.antialiased 	: True    # render patches in antialised (no jaggies)
+
+### FONT
+#
+# font properties used by text.Text.  see
+# http://matplotlib.sourceforge.net/matplotlib.fonts.html for more
+# information on font properties.  The 6 font properties used for font
+# matching are given below with their default values.
+#
+# The font.family property has five values: 'serif' (e.g. Times),
+# 'sans-serif' (e.g. Helvetica), 'cursive' (e.g. Zapf-Chancery),
+# 'fantasy' (e.g. Western), and 'monospace' (e.g. Courier).  Each of
+# these font families has a default list of font names in decreasing
+# order of priority associated with them.
+# 
+# The font.style property has three values: normal (or roman), italic
+# or oblique.  The oblique style will be used for italic, if it is not
+# present.
+#
+# The font.variant property has two values: normal or small-caps.  For
+# TrueType fonts, which are scalable fonts, small-caps is equivalent
+# to using a font size of 'smaller', or about 83% of the current font
+# size.
+#
+# The font.weight property has effectively 13 values: normal, bold,
+# bolder, lighter, 100, 200, 300, ..., 900.  Normal is the same as
+# 400, and bold is 700.  bolder and lighter are relative values with
+# respect to the current weight.
+#
+# The font.stretch property has 11 values: ultra-condensed,
+# extra-condensed, condensed, semi-condensed, normal, semi-expanded,
+# expanded, extra-expanded, ultra-expanded, wider, and narrower.  This
+# property is not currently implemented.
+#
+# The font.size property has 11 values: xx-small, x-small, small,
+# medium, large, x-large, xx-large, larger, smaller, length (such as
+# 12pt), and percentage.  larger and smaller are relative values.
+# percentage is not yet implemented.
+#
+font.family         : sans-serif
+font.style          : normal
+font.variant        : normal
+font.weight         : medium
+font.stretch        : normal
+font.size           : medium
+font.serif          : New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Bitstream Vera Serif, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
+font.sans-serif     : Lucida Grande, Verdana, Geneva, Lucida, Bitstream Vera Sans, Arial, Helvetica, sans-serif
+font.cursive        : Apple Chancery, Textile, Zapf Chancery, Sand, cursive
+font.fantasy        : Comic Sans MS, Chicago, Charcoal, Impact, Western, fantasy
+font.monospace      : Andale Mono, Bitstream Vera Sans Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace
+
+
+### TEXT
+# text properties used by text.Text.  See
+# http://matplotlib.sourceforge.net/matplotlib.Text.html for more
+# information on text properties
+text.color          : black
+
+### AXES
+# default face and edge color, default tick sizes,
+# default fontsizes for ticklabels, and so on
+axes.hold           : True    # whether to clear the axes by default on
+axes.facecolor      : white   # axes background color
+axes.edgecolor      : black   # axes edge color
+axes.linewidth      : 1.0     # edge linewidth
+axes.grid           : False   # display grid or not
+axes.titlesize      : 14      # fontsize of the axes title
+axes.labelsize      : 12      # fontsize of the x any y labels
+axes.labelcolor     : black
+
+polaraxes.grid      : True    # display grid on polar axes
+
+### TICKS
+tick.major.size     : 4      # major tick size in points
+tick.minor.size     : 2      # minor tick size in points
+tick.major.pad      : 4      # distance to major tick label in points
+tick.minor.pad      : 4      # distance to the minor tick label in points
+tick.color          : black  # color of the tick labels 
+tick.labelsize      : 10     # fontsize of the tick labels
+
+### Grids
+grid.color       :   black       # grid color
+grid.linestyle   :   :       # dotted
+grid.linewidth   :   0.5     # in points            
+
+### FIGURE
+figure.figsize   : 8, 6    # figure size in inches
+figure.dpi       : 80      # figure dots per inch
+figure.facecolor : 0.75    # figure facecolor; 0.75 is scalar gray
+figure.edgecolor : white   # figure edgecolor
+
+### images
+image.aspect : free              # free | preserve
+image.interpolation  : bilinear  # see help(imshow) for options
+image.cmap   : jet               # gray | jet
+image.lut    : 256               # the size of the colormap lookup table
+image.origin : upper             # lower | upper
+ 
+### SAVING FIGURES
+# the default savefig params can be different for the GUI backends.
+# Eg, you may want a higher resolution, or to make the figure
+# background white
+savefig.dpi       : 300      # figure dots per inch
+savefig.facecolor : white    # figure facecolor when saving
+savefig.edgecolor : white    # figure edgecolor when saving
+
+# tk backend params
+tk.window_focus   : False    # Maintain shell focus for TkAgg
+tk.pythoninspect  : False    # tk sets PYTHONINSEPCT
+
+# ps backend params
+ps.useafm         : False    # use of afm fonts -- breaks mathtext but results in small files
+
+# Set the verbose flags.  This controls how much information
+# matplotlib gives you at runtime and where it goes.  Ther verbosity
+# levels are: silent, helpful, debug, debug-annoying.  Any level is
+# inclusive of all the levels below it.  If you setting is debug,
+# you'll get all the debug and helpful messages.  When submitting
+# problems to the mailing-list, please set verbose to helpful or debug
+# and paste the output into your report.  
+#
+# The fileo gives the destination for any calls to verbose.report.
+# These objects can a filename, or a filehandle like sys.stdout.  
+#
+# You can override the rc default verbosity from the command line by
+# giving the flags --verbose-LEVEL where LEVEL is one of the legal
+# levels, eg --verbose-helpful.
+#
+# You can access the verbose instance in your code
+#   from matplotlib import verbose.
+verbose.level  : silent     # one of silent, helpful, debug, debug-annoying
+verbose.fileo  : sys.stdout  # a log filename, sys.stdout or sys.stderr
+
/trunk/py4science/book/examples/README Diff Switch to side-by-side view
--- a
+++ b/trunk/py4science/book/examples/README
@@ -0,0 +1,5 @@
+Any script that is to be run as a standalone should be added to the
+runall.py file listing.  We can use that script to test the
+environment before the course.
+
+
/trunk/py4science/book/examples/WallisPi.py Diff Switch to side-by-side view
--- a
+++ b/trunk/py4science/book/examples/WallisPi.py
@@ -0,0 +1,21 @@
+from __future__ import division
+
+from math import pi
+
+def WallisPi(n,longform=False):
+    """Compute pi using n terms of Wallis' product.
+    
+    If longform is true, the result is returned as a long integer of the
+    form 314..."""
+    
+    num = 1L
+    den = 1L
+    for i in xrange(1,n+1):
+	tmp = 4*i*i
+	num *= tmp
+	den *= tmp-1
+    if longform:
+	order = len(str(num))+1
+	return long(10**order)*2*num//den
+    else:
+	return 2.0*(num/den)
/trunk/py4science/book/examples/WindowLevelInterface.py Diff Switch to side-by-side view
Loading...
/trunk/py4science/book/examples/__init__.py Diff Switch to side-by-side view
Loading...
/trunk/py4science/book/examples/colors.py Diff Switch to side-by-side view
Loading...
/trunk/py4science/book/examples/erathostenes.py Diff Switch to side-by-side view
Loading...
/trunk/py4science/book/examples/error.py Diff Switch to side-by-side view
Loading...
/trunk/py4science/book/examples/fft_demo.py Diff Switch to side-by-side view
Loading...
/trunk/py4science/book/examples/ip_embed-short.py Diff Switch to side-by-side view
Loading...
/trunk/py4science/book/examples/ip_embed.py Diff Switch to side-by-side view
Loading...
/trunk/py4science/book/examples/ip_expensive_init.py Diff Switch to side-by-side view
Loading...
/trunk/py4science/book/examples/ip_simple.py Diff Switch to side-by-side view
Loading...
/trunk/py4science/book/examples/ip_simple2.py Diff Switch to side-by-side view
Loading...
/trunk/py4science/book/examples/mayavi/3dsin.vtk Diff Switch to side-by-side view
Loading...
/trunk/py4science/book/examples/mayavi/3dsin_vol.mv Diff Switch to side-by-side view
Loading...
/trunk/py4science/book/examples/mayavi/faults Diff Switch to side-by-side view
Loading...
/trunk/py4science/book/examples/mayavi/mayavi_4d_example Diff Switch to side-by-side view
Loading...
/trunk/py4science/book/examples/mayavi/surf.py Diff Switch to side-by-side view
Loading...
1 2 3 .. 17 > >> (Page 1 of 17)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.