[Scipy-svn] r4584 - in branches/Interpolate1D/docs: . build/doctrees build/html build/html/_sources

scipy-svn@scip... scipy-svn@scip...
Wed Jul 30 15:44:48 CDT 2008


Author: fcady
Date: 2008-07-30 15:44:41 -0500 (Wed, 30 Jul 2008)
New Revision: 4584

Modified:
   branches/Interpolate1D/docs/build/doctrees/environment.pickle
   branches/Interpolate1D/docs/build/doctrees/tutorial.doctree
   branches/Interpolate1D/docs/build/html/_sources/tutorial.txt
   branches/Interpolate1D/docs/build/html/searchindex.json
   branches/Interpolate1D/docs/build/html/tutorial.html
   branches/Interpolate1D/docs/tutorial.rst
Log:
documentation added for the objective interface

Modified: branches/Interpolate1D/docs/build/doctrees/environment.pickle
===================================================================
(Binary files differ)

Modified: branches/Interpolate1D/docs/build/doctrees/tutorial.doctree
===================================================================
(Binary files differ)

Modified: branches/Interpolate1D/docs/build/html/_sources/tutorial.txt
===================================================================
--- branches/Interpolate1D/docs/build/html/_sources/tutorial.txt	2008-07-30 20:32:32 UTC (rev 4583)
+++ branches/Interpolate1D/docs/build/html/_sources/tutorial.txt	2008-07-30 20:44:41 UTC (rev 4584)
@@ -139,12 +139,15 @@
 User-defined Interpolation Methods
 --------------------------------------
 
-If you want more direct control than is afforded by the string interface, this is also possible.
-Note, however, that this is not for the faint-hearted.  You must be very careful to have correct
-format, and failure to do so can cause a range of errors.
+The string interface is designed to conveniently take care of most things a user would want
+to do in a way that is easy and, when something goes wrong, informative and helpful.
+If, however, you want more direct control than is afforded by the string interface, this is also possible.
+Note, that this is trickier than using strings.  You must be very careful to have correct
+format, and failure to do so can cause a range of errors which won't necessarily result in
+informative error messages.
 
-interp can also be set to a function, a callable class, or an instance of a callable class.  If you do this, however, you will
-have to be careful about formatting.
+interp (or, equivalently, extrap_low and extrap_high) can also be set to a function, a callable 
+class, or an instance of a callable class.
 
 If a function is passed, it will be called when interpolating.
 It is assumed to have the form ::
@@ -157,7 +160,7 @@
 
         instance = Class(x, y, **kw).
         
-which can then be called by
+which can then be called by ::
 
             new_y = instance(new_x)
             
@@ -166,7 +169,7 @@
 
         instance.set_xy(x, y, **kw)
         
-and the object will be called during interpolation.
+and the object will be called during interpolation. ::
 
                 new_y = instance(new_x)
                 
@@ -203,4 +206,16 @@
     In []: new_y
     Out []: array([ 7.1, 1.0, 4.0 ])
 
- 
\ No newline at end of file
+ ================================================
+1D Interpolation with the Object Interface
+================================================
+
+interp1d is in fact a wrapper around the class Interpolate1d.  If you want to
+interpolate multiple times from the same dataset, this can be more efficient than the
+functional interface because many interpolation methods (splines, for example) involve
+preprocessing steps which need only be performed once by the object.
+
+The only real difference between the objective and functional interfaces is that new_x
+is passed as the third argument to interp1d, whereas in the objective interface it is
+passed to an instance of Interpolate1d.  All other arguments to interp1d (x, y, interp, 
+extrap_low/high, interpkw, etc) are passed into Interpolate1d at instantiation.
\ No newline at end of file

Modified: branches/Interpolate1D/docs/build/html/searchindex.json
===================================================================
--- branches/Interpolate1D/docs/build/html/searchindex.json	2008-07-30 20:32:32 UTC (rev 4583)
+++ branches/Interpolate1D/docs/build/html/searchindex.json	2008-07-30 20:44:41 UTC (rev 4584)
@@ -1 +1 @@
-[["index","tutorial"],["Welcome to interpolate’s documentation!","Overview"],{"all":[1],"extrapol":[1],"scalar":[1],"follow":[1],"interp1d":[1],"to":[0,1],"liter":[],"string":[1],"end":[1],"fall":[1],"veri":[1],"list":[1],"round":[1],"dimens":[1],"direct":[0,1],"pass":[1],"even":[1],"index":[0],"what":[1],"appear":[1],"abl":[1],"current":[1],"new":[1],"method":[0,1],"set_xi":[1],"behavior":[1],"matplotlib":[1],"100":[1],"strong":[],"valu":[1],"box":[1],"convert":[1],"permit":[],"nearest":[1],"primit":[1],"approxim":[1],"linearli":[1],"select":[1],"plot":[1],"from":[1],"0":[1],"faint":[1],"call":[1],"6":[1],"type":[1],"more":[1],"desir":[1],"spline":[1],"indic":[0],"known":[1],"phoni":[1],"must":[1],"none":[1],"quartic":[1],"arang":[1],"can":[0,1],"root":[0],"def":[1],"control":[1],"heart":[1],"quickstart":[0],"process":[1],"accept":[1],"want":[1],"multipl":[1],"quot":[],"anoth":[1],"1":[1],"sin":[1],"recogn":[1],"befor":[1],"4th":[1],"such":[1],"data":[1],"grow":[],"a":[1],"short":[],"attempt":[1],"explicit":[],"caus":[1],"inform":[1],"so":[1],"callabl":[1],"order":[1],"failur":[1],"flexibl":[1],"21":[1],"29":[0],"then":[1],"them":[1],"return":[1],"thei":[1],"handl":[1],"not":[1],"now":[1],"lowkw":[1],"linspac":[1],"2d":[1],"quintic":[1],"found":[],"expect":[],"our":[1],"happen":[1],"orient":[1],"out":[1],"3rd":[1],"space":[1],"trickier":[1],"content":[0],"adapt":[0],"7":[1],"ro":[1],"correct":[1],"linear":[1],"interp1d_linear_simpl":[],"fixm":[1],"care":[1],"indent":[],"wai":[1],"g":[1],"outsid":[1],"lambda":[1],"rang":[1],"arrai":[1],"number":[1],"blank":[],"76394372684109768":[1],"miss":[1],"5th":[1],"least":[0],"underlin":[],"master":[0],"1d":[0,1],"final":[1],"too":[],"option":[1],"that":[1],"tool":[1],"specifi":[1],"than":[1],"png":[],"unind":[],"b":[1],"keyword":[1],"provid":[1],"remov":[0,1],"r":[1],"intepol":[],"and":[0,1],"ani":[1],"packag":[1],"have":[1],"tabl":[0],"new_y_no_bad":[1],"unexpect":[],"equival":[1],"self":[1],"note":[1],"also":[1],"without":[],"which":[1],"singl":[1],"new_y_quadrat":[1],"sure":[1],"though":[1],"object":[1],"jul":[0],"class":[1],"dens":[1],"dummi":[1],"kw":[1],"extrap_low":[1],"anywai":[1],"onli":[1],"ha":[1],"should":[0],"__call__":[1],"8":[1],"overwritten":[1],"do":[1],"init_xi":[1],"get":[1],"2":[1],"bad":[0,1],"contain":[0],"x":[1],"where":[1],"set":[1],"we":[1],"up":[1],"see":[1],"signifi":[1],"result":[1],"corrupt":[1],"00":[0],"3":[1],"import":[1],"altern":[1],"spars":[1],"newi":[1],"newx":[1],"ipython":[1],"tue":[0],"both":[1],"howev":[1],"s":[0],"instanc":[1],"mani":[1],"point":[1],"overview":[0,1],"new_y_bad":[1],"8217":[0],"2nd":[1],"non":[1],"assum":[1],"numpi":[1],"treat":[1],"basic":[0,1],"pi":[1],"63661977":[1],"imag":[],"search":[0],"argument":[1],"present":[1],"case":[1],"ident":[1],"these":[1],"new_x":[1],"n":[1],"will":[1],"defin":[0,1],"abov":[1],"error":[1],"new_i":[1],"is":[1],"it":[0,1],"in":[1],"quadrat":[1],"__init__":[1],"if":[1],"welcom":[0],"perform":[1],"make":[1],"same":[1],"9":[1],"document":[0],"complet":[0],"cubic":[1],"rais":[1],"user":[0,1],"i":[1],"markup":[],"well":[1],"exampl":[1],"thi":[0,1],"interpol":[0,1],"y":[1],"the":[0,1],"dimension":[1],"usual":[1],"just":[1],"when":[1],"pylab":[1],"72676046":[1],"easi":[1],"4":[1],"modul":[0],"format":[1],"know":[1],"like":[0],"55":[1],"56":[0],"51":[0],"datapoint":[0,1],"either":[1],"page":[0],"right":[1],"some":[1],"extrap_high":[1],"toctre":[0],"for":[1],"definit":[],"larg":[1],"be":[1],"run":[1],"usag":[0,1],"by":[0,1],"interpkw":[1],"on":[0,1],"about":[1],"of":[0,1],"slightli":[1],"or":[1],"block":[1],"own":[1],"effici":[1],"into":[1],"dataset":[1],"down":[1],"your":[0,1],"val":[1],"support":[1],"there":[1],"start":[1],"interfac":[0,1],"includ":[1],"function":[0,1],"form":[1],"interp":[1],"but":[0,1],"sphinx":[0],"line":[],"inlin":[],"with":[0,1],"possibl":[1],"default":[1],"bad_data":[1],"intern":[1],"us":[1],"below":[1],"z":[1],"curv":[1],"creat":[0,1],"dure":[1],"an":[1],"as":[1],"ar":[1],"at":[0,1],"file":[0],"no":[],"titl":[],"nan":[1],"afford":[1],"other":[1],"5":[1],"np":[1],"you":[0,1],"10":[1],"uniformli":[1],"e":[1],"ignor":[1],"2008":[0]}]
\ No newline at end of file
+[["index","tutorial"],["Welcome to interpolate’s documentation!","Overview"],{"all":[1],"extrapol":[1],"scalar":[1],"follow":[1],"interp1d":[1],"to":[0,1],"preprocess":[1],"liter":[1],"string":[1],"end":[1],"fall":[1],"veri":[1],"list":[1],"round":[1],"dimens":[1],"direct":[0,1],"design":[1],"pass":[1],"even":[1],"index":[0],"what":[1],"appear":[1],"abl":[1],"current":[1],"new":[1],"method":[0,1],"set_xi":[1],"behavior":[1],"matplotlib":[1],"interpolate1d":[1],"100":[1],"strong":[],"valu":[1],"box":[1],"convert":[1],"permit":[],"nearest":[1],"primit":[1],"approxim":[1],"linearli":[1],"select":[1],"plot":[1],"from":[1],"would":[1],"0":[1],"faint":[],"call":[1],"6":[1],"type":[1],"more":[1],"desir":[1],"afford":[1],"indic":[0],"known":[1],"phoni":[1],"must":[1],"none":[1],"quartic":[1],"arang":[1],"can":[0,1],"root":[0],"def":[1],"control":[1],"heart":[],"quickstart":[0],"process":[1],"accept":[1],"high":[1],"want":[1],"multipl":[1],"quot":[],"anoth":[1],"1":[1],"sin":[1],"recogn":[1],"befor":[1],"wrong":[1],"4th":[1],"such":[1],"data":[1],"grow":[],"a":[1],"short":[],"attempt":[1],"third":[1],"explicit":[],"caus":[1],"inform":[1],"so":[1],"callabl":[1],"order":[1],"least":[0],"help":[1],"failur":[1],"becaus":[1],"flexibl":[1],"21":[1],"29":[0],"then":[1],"them":[1],"return":[1],"thei":[1],"handl":[1],"not":[1],"now":[1],"lowkw":[1],"linspac":[1],"2d":[1],"quintic":[1],"found":[],"expect":[],"our":[1],"happen":[1],"orient":[1],"out":[1],"3rd":[1],"space":[1],"goe":[1],"trickier":[1],"content":[0],"adapt":[0],"7":[1],"ro":[1],"correct":[1],"linear":[1],"interp1d_linear_simpl":[],"fixm":[1],"care":[1],"indent":[],"wai":[1],"g":[1],"thing":[1],"outsid":[1],"lambda":[1],"rang":[1],"onc":[1],"arrai":[1],"number":[1],"wrapper":[1],"blank":[1],"76394372684109768":[1],"miss":[1],"differ":[1],"5th":[1],"messag":[1],"underlin":[],"master":[0],"1d":[0,1],"conveni":[1],"final":[1],"too":[],"option":[1],"that":[1],"tool":[1],"specifi":[1],"necessarili":[1],"than":[1],"png":[],"unind":[1],"b":[1],"keyword":[1],"provid":[1],"remov":[0,1],"r":[1],"intepol":[],"and":[0,1],"ani":[1],"packag":[1],"have":[1],"tabl":[0],"need":[1],"new_y_no_bad":[1],"unexpect":[1],"equival":[1],"self":[1],"note":[1],"also":[1],"without":[1],"take":[1],"which":[1],"singl":[1],"new_y_quadrat":[1],"sure":[1],"though":[1],"object":[1],"most":[1],"jul":[0],"class":[1],"dens":[1],"dummi":[1],"kw":[1],"fact":[1],"extrap_low":[1],"anywai":[1],"involv":[1],"onli":[1],"inlin":[],"should":[0],"__call__":[1],"8":[1],"overwritten":[1],"do":[1],"init_xi":[1],"get":[1],"2":[1],"bad":[0,1],"contain":[0],"x":[1],"where":[1],"set":[1],"we":[1],"see":[1],"signifi":[1],"result":[1],"corrupt":[1],"00":[0],"someth":[1],"3":[1],"won":[1],"between":[1],"import":[1],"altern":[1],"spars":[1],"newi":[1],"newx":[1],"ipython":[1],"tue":[0],"both":[1],"howev":[1],"etc":[1],"s":[0],"instanc":[1],"mani":[1],"point":[1],"instanti":[1],"overview":[0,1],"new_y_bad":[1],"8217":[0],"2nd":[1],"non":[1],"assum":[1],"numpi":[1],"treat":[1],"basic":[0,1],"pi":[1],"63661977":[1],"imag":[],"search":[0],"argument":[1],"present":[1],"case":[1],"ident":[1],"these":[1],"new_x":[1],"n":[1],"will":[1],"defin":[0,1],"abov":[1],"error":[1],"new_i":[1],"is":[1],"it":[0,1],"in":[1],"quadrat":[1],"__init__":[1],"if":[1],"welcom":[0],"perform":[1],"make":[1],"same":[1],"9":[1],"document":[0],"complet":[0],"cubic":[1],"wherea":[1],"rais":[1],"user":[0,1],"i":[1],"markup":[],"well":[1],"exampl":[1],"thi":[0,1],"interpol":[0,1],"y":[1],"the":[0,1],"dimension":[1],"usual":[1],"just":[1],"when":[1],"pylab":[1],"72676046":[1],"easi":[1],"4":[1],"modul":[0],"real":[1],"around":[1],"format":[1],"know":[1],"like":[0],"55":[1],"56":[0],"51":[0],"datapoint":[0,1],"either":[1],"page":[0],"right":[1],"some":[1],"extrap_high":[1],"toctre":[0],"for":[1],"definit":[],"larg":[1],"t":[1],"be":[1],"run":[1],"usag":[0,1],"step":[1],"by":[0,1],"interpkw":[1],"on":[0,1],"about":[],"of":[0,1],"slightli":[1],"or":[1],"block":[1],"own":[1],"effici":[1],"into":[1],"dataset":[1],"down":[1],"spline":[1],"val":[1],"support":[1],"there":[1],"start":[1],"interfac":[0,1],"includ":[1],"function":[0,1],"form":[1],"interp":[1],"but":[0,1],"intern":[1],"sphinx":[0],"line":[1],"ha":[1],"with":[0,1],"possibl":[1],"default":[1],"bad_data":[1],"up":[1],"us":[1],"below":[1],"z":[1],"curv":[1],"creat":[0,1],"dure":[1],"an":[1],"as":[1],"ar":[1],"at":[0,1],"file":[0],"no":[],"titl":[],"nan":[1],"other":[1],"5":[1],"np":[1],"you":[0,1],"10":[1],"uniformli":[1],"your":[0,1],"e":[1],"ignor":[1],"time":[1],"2008":[0]}]
\ No newline at end of file

Modified: branches/Interpolate1D/docs/build/html/tutorial.html
===================================================================
--- branches/Interpolate1D/docs/build/html/tutorial.html	2008-07-30 20:32:32 UTC (rev 4583)
+++ branches/Interpolate1D/docs/build/html/tutorial.html	2008-07-30 20:44:41 UTC (rev 4584)
@@ -149,11 +149,14 @@
 </div>
 <div class="section">
 <h2 id="user-defined-interpolation-methods">User-defined Interpolation Methods<a class="headerlink" href="#user-defined-interpolation-methods" title="Permalink to this headline">¶</a></h2>
-<p>If you want more direct control than is afforded by the string interface, this is also possible.
-Note, however, that this is not for the faint-hearted.  You must be very careful to have correct
-format, and failure to do so can cause a range of errors.</p>
-<p>interp can also be set to a function, a callable class, or an instance of a callable class.  If you do this, however, you will
-have to be careful about formatting.</p>
+<p>The string interface is designed to conveniently take care of most things a user would want
+to do in a way that is easy and, when something goes wrong, informative and helpful.
+If, however, you want more direct control than is afforded by the string interface, this is also possible.
+Note, that this is trickier than using strings.  You must be very careful to have correct
+format, and failure to do so can cause a range of errors which won&#8217;t necessarily result in
+informative error messages.</p>
+<p>interp (or, equivalently, extrap_low and extrap_high) can also be set to a function, a callable
+class, or an instance of a callable class.</p>
 <p>If a function is passed, it will be called when interpolating.
 It is assumed to have the form</p>
 <div class="highlight"><pre><span class="n">newy</span> <span class="o">=</span> <span class="n">interp</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">newx</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">)</span>
@@ -162,47 +165,63 @@
 <p>If a callable class is passed, it is assumed to have format:</p>
 <pre>instance = Class(x, y, **kw).</pre>
 <p>which can then be called by</p>
-<blockquote>
-new_y = instance(new_x)</blockquote>
+<div class="highlight"><pre><span class="n">new_y</span> <span class="o">=</span> <span class="n">instance</span><span class="p">(</span><span class="n">new_x</span><span class="p">)</span>
+</pre></div>
 <p>If a callable object with method &#8220;init_xy&#8221; or &#8220;set_xy&#8221; is
 passed, that method will be used to set x and y as follows:</p>
 <div class="highlight"><pre><span class="n">instance</span><span class="o">.</span><span class="n">set_xy</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">)</span>
 </pre></div>
 <p>and the object will be called during interpolation.</p>
-<blockquote>
-new_y = instance(new_x)</blockquote>
+<div class="highlight"><pre><span class="n">new_y</span> <span class="o">=</span> <span class="n">instance</span><span class="p">(</span><span class="n">new_x</span><span class="p">)</span>
+</pre></div>
 <p>If the &#8220;init_xy&#8221; and &#8220;set_xy&#8221; are not present, it will be called as</p>
 <blockquote>
 new_y = argument(new_x)</blockquote>
 <p>A primitive type which is not a string signifies a function
 which is identically that value (e.g. val and
 lambda x, y, newx : val are equivalent).</p>
-<pre># However, this behavior can be overwritten in the same way as linear interpolation,
-# by setting the keyword extrap_low (for values below the range of interpolation) and
-# extrap_high (for values above that range)
-In []: def dummy(x, y, newx, default = 5.1):
-            # Note that dummy has acceptable form
-            return np.array([ default ])
-In []: class Phony:
-            def __init__(self, val = 4.0):
-                self.val = val
-            def init_xy(self, x, y):
-                pass
-            def __call__(self, newx):
-                return self.val
-In []: x = arange(5.0)
-In []: y = arange(5.0)
-In []: new_x = np.array([ -1, .4, 7 ])
-In []: new_y = interp1d(x, y, interp = Phony,
-                                    interpkw = {'val':1.0},
-                                    extrap_low = dummy,
-                                    lowkw = {'default':7.1},
-                                    extrap_high = dummy
-                                    )
-In []: new_y
-Out []: array([ 7.1, 1.0, 4.0 ])</pre>
+<pre>   # However, this behavior can be overwritten in the same way as linear interpolation,
+   # by setting the keyword extrap_low (for values below the range of interpolation) and
+   # extrap_high (for values above that range)
+   In []: def dummy(x, y, newx, default = 5.1):
+               # Note that dummy has acceptable form
+               return np.array([ default ])
+   In []: class Phony:
+               def __init__(self, val = 4.0):
+                   self.val = val
+               def init_xy(self, x, y):
+                   pass
+               def __call__(self, newx):
+                   return self.val
+   In []: x = arange(5.0)
+   In []: y = arange(5.0)
+   In []: new_x = np.array([ -1, .4, 7 ])
+   In []: new_y = interp1d(x, y, interp = Phony,
+                                       interpkw = {'val':1.0},
+                                       extrap_low = dummy,
+                                       lowkw = {'default':7.1},
+                                       extrap_high = dummy
+                                       )
+   In []: new_y
+   Out []: array([ 7.1, 1.0, 4.0 ])
+
+================================================</pre>
+<div class="system-message">
+<p class="system-message-title">System Message: WARNING/2 (<tt class="docutils">c:\home\python\Interpolate1D\docs\tutorial.rst</tt>, line 210)</p>
+Literal block ends without a blank line; unexpected unindent.</div>
+<div class="section">
+<h3 id="d-interpolation-with-the-object-interface">1D Interpolation with the Object Interface<a class="headerlink" href="#d-interpolation-with-the-object-interface" title="Permalink to this headline">¶</a></h3>
+<p>interp1d is in fact a wrapper around the class Interpolate1d.  If you want to
+interpolate multiple times from the same dataset, this can be more efficient than the
+functional interface because many interpolation methods (splines, for example) involve
+preprocessing steps which need only be performed once by the object.</p>
+<p>The only real difference between the objective and functional interfaces is that new_x
+is passed as the third argument to interp1d, whereas in the objective interface it is
+passed to an instance of Interpolate1d.  All other arguments to interp1d (x, y, interp,
+extrap_low/high, interpkw, etc) are passed into Interpolate1d at instantiation.</p>
 </div>
 </div>
+</div>
 
 
           </div>
@@ -216,10 +235,13 @@
 <li><a class="reference" href="#d-interpolation-with-the-functional-interface">1D Interpolation with the Functional Interface</a><ul>
 <li><a class="reference" href="#basic-usage">Basic Usage</a></li>
 <li><a class="reference" href="#removal-of-bad-datapoints">Removal of Bad Datapoints</a></li>
-<li><a class="reference" href="#user-defined-interpolation-methods">User-defined Interpolation Methods</a></li>
+<li><a class="reference" href="#user-defined-interpolation-methods">User-defined Interpolation Methods</a><ul>
+<li><a class="reference" href="#d-interpolation-with-the-object-interface">1D Interpolation with the Object Interface</a></li>
 </ul>
 </li>
 </ul>
+</li>
+</ul>
 
             <h4>Previous topic</h4>
             <p class="topless"><a href="index.html" title="previous chapter">Welcome to interpolate&#8217;s documentation!</a></p>

Modified: branches/Interpolate1D/docs/tutorial.rst
===================================================================
--- branches/Interpolate1D/docs/tutorial.rst	2008-07-30 20:32:32 UTC (rev 4583)
+++ branches/Interpolate1D/docs/tutorial.rst	2008-07-30 20:44:41 UTC (rev 4584)
@@ -139,12 +139,15 @@
 User-defined Interpolation Methods
 --------------------------------------
 
-If you want more direct control than is afforded by the string interface, this is also possible.
-Note, however, that this is not for the faint-hearted.  You must be very careful to have correct
-format, and failure to do so can cause a range of errors.
+The string interface is designed to conveniently take care of most things a user would want
+to do in a way that is easy and, when something goes wrong, informative and helpful.
+If, however, you want more direct control than is afforded by the string interface, this is also possible.
+Note, that this is trickier than using strings.  You must be very careful to have correct
+format, and failure to do so can cause a range of errors which won't necessarily result in
+informative error messages.
 
-interp can also be set to a function, a callable class, or an instance of a callable class.  If you do this, however, you will
-have to be careful about formatting.
+interp (or, equivalently, extrap_low and extrap_high) can also be set to a function, a callable 
+class, or an instance of a callable class.
 
 If a function is passed, it will be called when interpolating.
 It is assumed to have the form ::
@@ -157,7 +160,7 @@
 
         instance = Class(x, y, **kw).
         
-which can then be called by
+which can then be called by ::
 
             new_y = instance(new_x)
             
@@ -166,7 +169,7 @@
 
         instance.set_xy(x, y, **kw)
         
-and the object will be called during interpolation.
+and the object will be called during interpolation. ::
 
                 new_y = instance(new_x)
                 
@@ -203,4 +206,16 @@
     In []: new_y
     Out []: array([ 7.1, 1.0, 4.0 ])
 
- 
\ No newline at end of file
+ ================================================
+1D Interpolation with the Object Interface
+================================================
+
+interp1d is in fact a wrapper around the class Interpolate1d.  If you want to
+interpolate multiple times from the same dataset, this can be more efficient than the
+functional interface because many interpolation methods (splines, for example) involve
+preprocessing steps which need only be performed once by the object.
+
+The only real difference between the objective and functional interfaces is that new_x
+is passed as the third argument to interp1d, whereas in the objective interface it is
+passed to an instance of Interpolate1d.  All other arguments to interp1d (x, y, interp, 
+extrap_low/high, interpkw, etc) are passed into Interpolate1d at instantiation.
\ No newline at end of file



More information about the Scipy-svn mailing list