/usr/share/doc/pyxplot/html/sect0021.html is in pyxplot-doc 0.8.4-3.
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 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | <!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: Converting between different Temperature Scales</title>
<link href="sec-unitdisp.html" title="Configuring how Numbers are Displayed" rel="next" />
<link href="sec-angles.html" title="Treatment of Angles in PyXPlot" rel="prev" />
<link href="sec-units.html" title="Working with Physical Units" 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="sec-angles.html" title="Treatment of Angles in PyXPlot"><img alt="Previous: Treatment of Angles in PyXPlot" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>
<td><a href="sec-units.html" title="Working with Physical Units"><img alt="Up: Working with Physical Units" border="0" src="icons/up.gif" width="32" height="32" /></a></td>
<td><a href="sec-unitdisp.html" title="Configuring how Numbers are Displayed"><img alt="Next: Configuring how Numbers are Displayed" 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="sect0255.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="sect0019.html">Performing Calculations</a> <b>:</b>
</span>
</span><span>
<span>
<a href="sec-units.html">Working with Physical Units</a> <b>:</b>
</span>
</span><span>
<span>
<b class="current">Converting between different Temperature Scales</b>
</span>
</span>
<hr />
</div>
<div><h2 id="a0000000022">4.6.2 Converting between different Temperature Scales</h2>
<p> <a name="a0000000442" id="a0000000442"></a><a name="a0000000443" id="a0000000443"></a> </p><p>PyXPlot’s facilities for converting quantities between different physical units include the ability to convert temperatures between different temperature scales, for example, between <img src="images/img-0109.png" alt="$^\circ \mathrm{C}$" style="vertical-align:0px;
width:19px;
height:13px" class="math gen" />, <img src="images/img-0110.png" alt="$^\circ \mathrm{F}$" style="vertical-align:0px;
width:18px;
height:13px" class="math gen" /> and K. However, these conversions have some subtleties, unique to temperature conversions, which mean that they should be used with some caution. Consider the following two questions: </p><ul class="itemize">
<li><p>How many Kelvin corresponds to a temperature of <img src="images/img-0111.png" alt="$20^\circ $" style="vertical-align:0px;
width:24px;
height:13px" class="math gen" />C? </p></li><li><p>How many Kelvin corresponds to a temperature <i class="it">rise</i> of <img src="images/img-0111.png" alt="$20^\circ $" style="vertical-align:0px;
width:24px;
height:13px" class="math gen" />C? </p></li>
</ul><p> The answers to these two questions are 293 K and 20 K respectively: although we are converting from <img src="images/img-0111.png" alt="$20^\circ $" style="vertical-align:0px;
width:24px;
height:13px" class="math gen" />C in both cases, the corresponding number of Kelvin depends upon whether we are talking about an <i class="it">absolute</i> temperature or a <i class="it">relative</i> temperature. A heat capacity of 1 J/<img src="images/img-0112.png" alt="$^\circ $" style="vertical-align:7px;
width:6px;
height:6px" class="math gen" />C equals 1 J/K, even though a temperature of <img src="images/img-0113.png" alt="$1^\circ $" style="vertical-align:0px;
width:15px;
height:13px" class="math gen" />C does not equal a temperature of 1 K. </p><p>The cause of this problem, and the reason why it rarely affects any physical units other than temperatures is that there exists such a thing as absolute temperature. Distances, for example, are very rarely absolute: they measure relative distance gaps between points. Occasionally people might choose to express all their displacements relative to a particular origin, but they wouldn’t expect PyXPlot to be able to convert these into displacements from another origin. But they might expect it to be able to convert temperatures between Celsius and Fahrenheit, even though the problem of doing so is equivalent. </p><p>Times are occasionally expressed as absolute quantities: the year <small class="footnotesize">AD</small> 1453, for example, implicitly corresponds to a period of 1453 years after the Christian epoch, and so similar problems would arise in trying to convert such a year into the Muslim calendar, which counts from the year <small class="footnotesize">AD</small> 622.<a href="#a0000000444" class="footnote"><sup class="footnotemark">1</sup></a> </p><p>As PyXPlot cannot distinguish between absolute and relative temperatures, it takes a safe approach of performing algebra consistently with any unit of temperature, never performing automatic conversions between different temperature scales. A calculation based on temperatures measured in <img src="images/img-0110.png" alt="$^\circ \mathrm{F}$" style="vertical-align:0px;
width:18px;
height:13px" class="math gen" /> will produce an answer measured in <img src="images/img-0110.png" alt="$^\circ \mathrm{F}$" style="vertical-align:0px;
width:18px;
height:13px" class="math gen" />. However, as converting temperatures between temperature scales is a useful task which is often wanted, this is allowed, when specifically requested, in the specific case of dividing one temperature by another unit of temperature to get a dimensionless number, as in the following example: </p><p><table cellspacing="0" class="tabular">
<tr>
<td style="text-align:left"><p><img src="images/img-0030.png" alt="\includegraphics{tick}" style="width:19px; height:17px" />
</p></td>
<td style="text-align:left"><p><div style="width:0.0pt" class="minipage"><tt class="tt"> print 98*unit(oF) / unit(oC) </tt></div></p></td>
</tr>
</table> </p><p>Note that the two units of temperature must be placed in separate <tt class="tt">unit(...)</tt> functions. The following is not allowed: </p><p><table cellspacing="0" class="tabular">
<tr>
<td style="text-align:left"><p><img src="images/img-0029.png" alt="\includegraphics{cross}" style="width:20px; height:24px" />
</p></td>
<td style="text-align:left"><p><div style="width:0.0pt" class="minipage"><tt class="tt"> print 98*unit(oF / oC) </tt></div></p></td>
</tr>
</table> </p><p>Note that such a conversion always assumes that the temperatures supplied are <i class="it">absolute</i> temperatures. PyXPlot has no facility for converting relative temperatures between different scales. This must be done manually. </p><p>The conversion of derived units of temperature, such as <img src="images/img-0114.png" alt="$\mathrm{J}/\mathrm{K}$" style="vertical-align:-5px;
width:32px;
height:18px" class="math gen" /> or <img src="images/img-0115.png" alt="$^\circ \mathrm{C}^2$" style="vertical-align:0px;
width:27px;
height:16px" class="math gen" />, to derived units of other temperature scales, such as <img src="images/img-0116.png" alt="$\mathrm{J}/^\circ \mathrm{F}$" style="vertical-align:-5px;
width:37px;
height:18px" class="math gen" /> or <img src="images/img-0117.png" alt="$\mathrm{K}^2$" style="vertical-align:0px;
width:21px;
height:16px" class="math gen" />, is not permitted, since in general these conversions are ill-defined. For example, a temperature squared measured in <img src="images/img-0115.png" alt="$^\circ \mathrm{C}^2$" style="vertical-align:0px;
width:27px;
height:16px" class="math gen" /> has the same value for <img src="images/img-0118.png" alt="$\pm x^\circ \mathrm{C}$" style="vertical-align:0px;
width:43px;
height:13px" class="math gen" />, but would have different values in <img src="images/img-0117.png" alt="$\mathrm{K}^2$" style="vertical-align:0px;
width:21px;
height:16px" class="math gen" />. </p><p>The moral of this story is: pick what unit of temperature you want to work in, convert all of your temperatures to that scale, and then stick to it. </p><p> <span class="upshape"><span class="mdseries"><span class="rm">Creating a simple temperature conversion scale.</span></span></span></p><div>
<table cellspacing="0" class="tabular">
<tr>
<td style="border-top-style:solid; border-left:1px solid black; border-right:1px solid black; border-top-color:black; border-top-width:1px; text-align:left"><p> In this example, we use PyXPlot’s automatic conversion of physical units to create a temperature conversion scale. </p></td>
</tr><tr>
<td style="text-align:left; border-right:1px solid black; border-left:1px solid black"><p><tt class="tt">set size ratio 1e-2</tt><br /><tt class="tt">set axis x2 linked x using x*unit(oC)/unit(oF)</tt><br /><tt class="tt">set axis y invisible</tt><br /><tt class="tt">set xtics outward -10,10</tt><br /><tt class="tt">set x2tics outward 20,20</tt><br /><tt class="tt">set xlabel "$<img src="images/img-0024.png" alt="\^{}" style="vertical-align:9px; width:5px; height:4px" class="accent gen" /><img src="images/img-0006.png" alt="$\backslash $" style="vertical-align:-5px;
width:7px;
height:18px" class="math gen" />circ$C"</tt><br /><tt class="tt">set x2label "$<img src="images/img-0024.png" alt="\^{}" style="vertical-align:9px; width:5px; height:4px" class="accent gen" /><img src="images/img-0006.png" alt="$\backslash $" style="vertical-align:-5px;
width:7px;
height:18px" class="math gen" />circ$F"</tt><br /><tt class="tt">plot [-10:100]</tt><br /></p></td>
</tr><tr>
<td style="border-bottom-style:solid; border-bottom-width:1px; border-left:1px solid black; border-right:1px solid black; text-align:left; border-bottom-color:black"><center> <img src="images/img-0120.png" alt="\includegraphics{examples/eps/ex_tempscale}" style="width:498px; height:113px" />
</center></td>
</tr>
</table>
</div></div>
<div id="footnotes">
<p><b>Footnotes</b></p>
<ol>
<li id="a0000000444">PyXPlot can, incidentally, make this conversion, as will be seen in Section <a href="sec-time_series.html">4.11</a>.</li>
</ol>
</div>
<div class="navigation">
<table cellspacing="2" cellpadding="0" width="100%">
<tr>
<td><a href="sec-angles.html" title="Treatment of Angles in PyXPlot"><img alt="Previous: Treatment of Angles in PyXPlot" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>
<td><a href="sec-units.html" title="Working with Physical Units"><img alt="Up: Working with Physical Units" border="0" src="icons/up.gif" width="32" height="32" /></a></td>
<td><a href="sec-unitdisp.html" title="Configuring how Numbers are Displayed"><img alt="Next: Configuring how Numbers are Displayed" 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="sect0255.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>
|