/usr/share/doc/pyxplot/html/sect0032.html is in pyxplot-doc 0.9.2-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="generator" content="plasTeX" />
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
<title>PyXPlot Users' Guide: Two-dimensional interpolation</title>
<link href="sect0033.html" title="Fourier transforms" rel="next" />
<link href="ex-interpolation.html" title="Datafile interpolation" rel="prev" />
<link href="ex-interpolation.html" title="Datafile interpolation" rel="up" />
<link rel="stylesheet" href="styles/styles.css" />
</head>
<body>
<div class="navigation">
<table cellspacing="2" cellpadding="0" width="100%">
<tr>
<td><a href="ex-interpolation.html" title="Datafile interpolation"><img alt="Previous: Datafile interpolation" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>
<td><a href="ex-interpolation.html" title="Datafile interpolation"><img alt="Up: Datafile interpolation" border="0" src="icons/up.gif" width="32" height="32" /></a></td>
<td><a href="sect0033.html" title="Fourier transforms"><img alt="Next: Fourier transforms" border="0" src="icons/next.gif" width="32" height="32" /></a></td>
<td class="navtitle" align="center">PyXPlot Users' Guide</td>
<td><a href="index.html" title="Table of Contents"><img border="0" alt="" src="icons/contents.gif" width="32" height="32" /></a></td>
<td><a href="sect0288.html" title="Index"><img border="0" alt="" src="icons/index.gif" width="32" height="32" /></a></td>
<td><img border="0" alt="" src="icons/blank.gif" width="32" height="32" /></td>
</tr>
</table>
</div>
<div class="breadcrumbs">
<span>
<span>
<a href="index.html">PyXPlot Users' Guide</a> <b>:</b>
</span>
</span><span>
<span>
<a href="sect0001.html">Introduction to PyXPlot</a> <b>:</b>
</span>
</span><span>
<span>
<a href="ch-numerics.html">Working with data</a> <b>:</b>
</span>
</span><span>
<span>
<a href="ex-interpolation.html">Datafile interpolation</a> <b>:</b>
</span>
</span><span>
<span>
<b class="current">Two-dimensional interpolation</b>
</span>
</span>
<hr />
</div>
<div><h2 id="a0000000033">5.7.1 Two-dimensional interpolation</h2>
<p>In the case of two-dimensional interpolation, the type of interpolation to be used is set using the <tt class="tt">interpolate</tt> modifier to the <tt class="tt">set samples</tt> command<a name="a0000000560" id="a0000000560"></a>, and may be changed at any time after the interpolation function has been created. The options available are nearest neighbor interpolation – which is the two-dimensional equivalent of stepwise interpolation, inverse square interpolation – which returns a weighted average of the supplied data points, using the inverse squares of their distances from the requested point in argument space as weights, and Monaghan Lattanzio interpolation, which uses the weighting function (Monaghan & Lattanzio 1985) </p><table id="a0000000561" cellpadding="7" width="100%" cellspacing="0" class="eqnarray">
<tr id="a0000000562">
<td style="width:40%"> </td>
<td style="vertical-align:middle; text-align:right"><img src="images/img-0175.png" alt="$\displaystyle w(x) $" style="vertical-align:-4px; width:36px; height:18px" class="math gen" /></td>
<td style="vertical-align:middle; text-align:center"><img src="images/img-0176.png" alt="$\displaystyle = 1 - \nicefrac {3}{2}v^2 + \nicefrac {3}{4}v^3 $" style="vertical-align:-5px; width:146px; height:22px" class="math gen" /></td>
<td style="vertical-align:middle; text-align:left"><img src="images/img-0177.png" alt="$\displaystyle \, \mathrm{for~ }0\leq v\leq 1 $" style="vertical-align:-3px; width:103px; height:15px" class="math gen" /></td>
<td style="width:40%"> </td>
<td style="width:20%" class="eqnnum"> </td>
</tr><tr id="a0000000563">
<td style="width:40%"> </td>
<td style="vertical-align:middle; text-align:right"><img src="images/img-0178.png" alt="$\displaystyle $" style="vertical-align:0px; width:1px; height:1px" class="math gen" /></td>
<td style="vertical-align:middle; text-align:center"><img src="images/img-0179.png" alt="$\displaystyle = \nicefrac {1}{4}(2-v)^3 $" style="vertical-align:-5px; width:100px; height:22px" class="math gen" /></td>
<td style="vertical-align:middle; text-align:left"><img src="images/img-0180.png" alt="$\displaystyle \, \mathrm{for~ }1\leq v\leq 2 $" style="vertical-align:-3px; width:104px; height:15px" class="math gen" /></td>
<td style="width:40%"> </td>
<td style="width:20%" class="eqnnum"> </td>
</tr>
</table><p> where <img src="images/img-0181.png" alt="$v=r/h$" style="vertical-align:-5px;
width:61px;
height:18px" class="math gen" /> for <img src="images/img-0182.png" alt="$h=\sqrt {A/n}$" style="vertical-align:-5px;
width:86px;
height:22px" class="math gen" />, <img src="images/img-0183.png" alt="$A$" style="vertical-align:0px;
width:13px;
height:12px" class="math gen" /> is the product <img src="images/img-0184.png" alt="$(x_\mathrm {max}-x_\mathrm {min})(y_\mathrm {max}-y_\mathrm {min})$" style="vertical-align:-4px;
width:212px;
height:18px" class="math gen" /> and <img src="images/img-0025.png" alt="$n$" style="vertical-align:0px;
width:11px;
height:8px" class="math gen" /> is the number of input datapoints. These are selected as follows: </p><pre>
set samples interpolate nearestNeighbor
set samples interpolate inverseSquare
set samples interpolate monaghanLattanzio
</pre><p>The following example creates a function <tt class="tt">quadrapole(x,y)</tt> which interpolates a quadrapole: </p><pre>
set samples interpolate inverseSquare
interpolate 2d quadrapole() '--'
-1 -1 1
-1 1 -1
1 -1 -1
1 1 1
END
</pre><p>Finally, data can be imported from graphical images in bitmap (<tt class="tt">.bmp</tt>) format to produce a function of two arguments returning a value in the range <img src="images/img-0185.png" alt="$0\to 1$" style="vertical-align:-1px;
width:45px;
height:13px" class="math gen" /> which represents the data in one of the image’s three color channels. The two arguments are the horizontal and vertical position within the bitmap image, as measured in pixels. This is done using syntax of the form: </p><pre>
interpolate 2d bmp_b blue() 'myImg.bmp'
</pre></div>
<div class="navigation">
<table cellspacing="2" cellpadding="0" width="100%">
<tr>
<td><a href="ex-interpolation.html" title="Datafile interpolation"><img alt="Previous: Datafile interpolation" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>
<td><a href="ex-interpolation.html" title="Datafile interpolation"><img alt="Up: Datafile interpolation" border="0" src="icons/up.gif" width="32" height="32" /></a></td>
<td><a href="sect0033.html" title="Fourier transforms"><img alt="Next: Fourier transforms" border="0" src="icons/next.gif" width="32" height="32" /></a></td>
<td class="navtitle" align="center">PyXPlot Users' Guide</td>
<td><a href="index.html" title="Table of Contents"><img border="0" alt="" src="icons/contents.gif" width="32" height="32" /></a></td>
<td><a href="sect0288.html" title="Index"><img border="0" alt="" src="icons/index.gif" width="32" height="32" /></a></td>
<td><img border="0" alt="" src="icons/blank.gif" width="32" height="32" /></td>
</tr>
</table>
</div>
<script language="javascript" src="icons/imgadjust.js" type="text/javascript"></script>
</body>
</html>
|