/usr/share/doc/pyxplot/html/sect0022.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 | <!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: Units</title>
<link href="sect0023.html" title="Changing the Accuracy to which Numbers are Displayed" rel="next" />
<link href="sec-unitdisp.html" title="Configuring how Numbers are Displayed" rel="prev" />
<link href="sec-unitdisp.html" title="Configuring how Numbers are Displayed" 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-unitdisp.html" title="Configuring how Numbers are Displayed"><img alt="Previous: Configuring how Numbers are Displayed" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>
<td><a href="sec-unitdisp.html" title="Configuring how Numbers are Displayed"><img alt="Up: Configuring how Numbers are Displayed" border="0" src="icons/up.gif" width="32" height="32" /></a></td>
<td><a href="sect0023.html" title="Changing the Accuracy to which Numbers are Displayed"><img alt="Next: Changing the Accuracy to which 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-unitdisp.html">Configuring how Numbers are Displayed</a> <b>:</b>
</span>
</span><span>
<span>
<b class="current">Units</b>
</span>
</span>
<hr />
</div>
<div><h2 id="a0000000023">4.7.1 Units</h2>
<p>Before quantities which are not dimensionless are displayed, PyXPlot searches through its database of physical units looking for the most appropriate unit, or combination of units, in which to represent them. By default, SI units, or combinations of SI units, are chosen for preference, and SI prefixes such as milli- or kilo- are applied where appropriate. This behaviour can, however, be extensively configured. </p><p>The most general configuration option allows one of several <i class="it">units schemes</i><a name="a0000000445" id="a0000000445"></a> to be selected, each of which comprises a list of units which are deemed to be members of the particular scheme. For example, in the CGS unit scheme<a name="a0000000446" id="a0000000446"></a><a name="a0000000447" id="a0000000447"></a>, all lengths are displayed in centimetres, all masses are displayed in grammes, all energies are displayed in ergs, and so forth. In the imperial unit scheme<a name="a0000000448" id="a0000000448"></a><a name="a0000000449" id="a0000000449"></a>, quantities are displayed in British imperial units – inches, pounds, pints, and so forth – and in the US unit scheme, US customary units are used. The current unit scheme can be changed using the <tt class="tt">set unit scheme</tt> command<a name="a0000000450" id="a0000000450"></a>: </p><p> <tt class="tt">pyxplot> <b class="bf">vol = 3*unit(m**3)</b></tt><br /><tt class="tt">pyxplot> <b class="bf">set unit scheme si ; print vol</b></tt><br /><tt class="tt">3 cubic_m</tt><br /><tt class="tt">pyxplot> <b class="bf">set unit scheme cgs ; print vol</b></tt><br /><tt class="tt">3000000 cubic_cm</tt><br /><tt class="tt">pyxplot> <b class="bf">set unit scheme imperial ; print vol</b></tt><br /><tt class="tt">82.488468 bushels_(UK)</tt><br /><tt class="tt">pyxplot> <b class="bf">set unit scheme us ; print vol</b></tt><br /><tt class="tt">85.13278 bushels_(US)</tt> </p><p>A complete list of PyXPlot’s unit schemes can be found in Table <a href="sect0022.html#tab:unit_schemes">4.1</a>.<a name="a0000000451" id="a0000000451"></a><a name="a0000000452" id="a0000000452"></a> </p><div id="tab:unit_schemes" class="table"><center> <table cellspacing="0" class="tabular">
<tr>
<td style="border-top-style:solid; text-align:left; border-top-color:black; border-top-width:1px; border-left:1px solid black"><p> <b class="bf">Name</b> </p></td>
<td style="border-top-style:solid; text-align:left; border-top-color:black; border-top-width:1px; border-right:1px solid black"><p> <b class="bf">Description</b> </p></td>
</tr><tr>
<td style="border-top-style:solid; text-align:left; border-top-color:black; border-top-width:1px; border-left:1px solid black"><p><tt class="tt">ancient</tt> </p></td>
<td style="border-top-style:solid; text-align:left; border-top-color:black; border-top-width:1px; border-right:1px solid black"><p> Ancient units, especially those used in the Authorised Version of the Bible. </p></td>
</tr><tr>
<td style="text-align:left; border-left:1px solid black"><p><tt class="tt">CGS</tt> </p></td>
<td style="text-align:left; border-right:1px solid black"><p> CGS units. </p></td>
</tr><tr>
<td style="text-align:left; border-left:1px solid black"><p><tt class="tt">Imperial</tt> </p></td>
<td style="text-align:left; border-right:1px solid black"><p> British imperial units. </p></td>
</tr><tr>
<td style="text-align:left; border-left:1px solid black"><p><tt class="tt">Planck</tt> </p></td>
<td style="text-align:left; border-right:1px solid black"><p> Planck units, also known as natural units, which make several physical constants equal unity. </p></td>
</tr><tr>
<td style="text-align:left; border-left:1px solid black"><p><tt class="tt">SI</tt> </p></td>
<td style="text-align:left; border-right:1px solid black"><p> SI units. </p></td>
</tr><tr>
<td style="border-bottom-color:black; border-bottom-width:1px; text-align:left; border-bottom-style:solid; border-left:1px solid black"><p><tt class="tt">US</tt> </p></td>
<td style="border-bottom-color:black; border-bottom-width:1px; text-align:left; border-bottom-style:solid; border-right:1px solid black"><p> US customary units. </p></td>
</tr>
</table> </center><div class="caption"><b>Table 4.1</b>: <span>A list of PyXPlot’s unit schemes.</span></div></div><p>These units schemes are often sufficient to ensure that most quantities are displayed in the desired units, but commonly there are a few specific quantities in any particular piece of work where non-standard units are used. For example, a study of Jupiter-like planets might express masses in Jupiter masses, rather than kilograms. A study of the luminosities of stars might express powers in units of solar luminosities, rather than watts. And a cosmology paper might express distances in parsecs. This level of control is made available through the <tt class="tt">set unit of</tt> command<a name="a0000000453" id="a0000000453"></a>, and the three examples just given would be achieved using the following commands: </p><pre>
set unit of mass Mjupiter
set unit of power solar_luminosity
set unit of length parsec
</pre><p>An astronomer wishing to express masses in Pluto masses would need to first define the Pluto mass as a user-defined unit, since it is not pre-defined unit within PyXPlot. In Chapter <a href="ch-configuration.html">8</a>, we shall see how to define new units in a configuration script. Having done so, the following syntax would be allowed: </p><pre>
set unit of mass Mpluto
</pre><p>The <tt class="tt">set unit preferred</tt> command<a name="a0000000454" id="a0000000454"></a> offers a slightly more flexible way of achieving the same result. Whereas the <tt class="tt">set unit of</tt> command<a name="a0000000455" id="a0000000455"></a> can only operate on named quantities such as lengths and powers, and cannot act upon compound units such as <tt class="tt">W/Hz</tt>, the <tt class="tt">set unit preferred</tt> command<a name="a0000000456" id="a0000000456"></a> can act upon any unit or combination of units: </p><pre>
set unit preferred parsec
set unit preferred W/Hz
set unit preferred N*m
</pre><p> The latter two examples are particularly useful when working with spectral densities (powers per unit frequency) or torques (forces multiplied by distances). Unfortunately, both of these units are dimensionally equal to energies, and so are displayed by PyXPlot in Joules by default. The above statement overrides such behaviour. Having set a particular unit to be preferred, this can be unset as in the following example: </p><pre>
set unit nopreferred parsec
</pre><p>By default, units are displayed in their abbreviated forms, for example <tt class="tt">A</tt> instead of <tt class="tt">amperes</tt> and <tt class="tt">W</tt> instead of <tt class="tt">watts</tt>. Furthermore, SI prefixes such as milli- and kilo- are applied to SI units where they are appropriate.<a name="a0000000457" id="a0000000457"></a><a name="a0000000458" id="a0000000458"></a> Both of these behaviours can be turned on or off, in the former case with the commands </p><pre>
set unit display abbreviated
set unit display full
</pre><p>and in the latter case using the following pair of commands: </p><pre>
set unit display prefix
set unit display noprefix
</pre></div>
<div class="navigation">
<table cellspacing="2" cellpadding="0" width="100%">
<tr>
<td><a href="sec-unitdisp.html" title="Configuring how Numbers are Displayed"><img alt="Previous: Configuring how Numbers are Displayed" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>
<td><a href="sec-unitdisp.html" title="Configuring how Numbers are Displayed"><img alt="Up: Configuring how Numbers are Displayed" border="0" src="icons/up.gif" width="32" height="32" /></a></td>
<td><a href="sect0023.html" title="Changing the Accuracy to which Numbers are Displayed"><img alt="Next: Changing the Accuracy to which 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>
|