Page MenuHomec4science

tutorial.html
No OneTemporary

File Metadata

Created
Sun, May 25, 16:40

tutorial.html

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pNbody Tutorial &mdash; pNbody v1 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="pNbody v1 documentation" href="index.html" />
<link rel="next" title="pNbody Reference" href="pnbody.html" />
<link rel="prev" title="pNbody Reference" href="intro.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="pnbody.html" title="pNbody Reference"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="intro.html" title="pNbody Reference"
accesskey="P">previous</a> |</li>
<li><a href="index.html">pNbody v1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="pnbody-tutorial">
<span id="tutorial"></span><h1>pNbody Tutorial<a class="headerlink" href="#pnbody-tutorial" title="Permalink to this headline">¶</a></h1>
<div class="math">
<p><img src="_images/math/b37af795e38004e18749df77754da43892bc070f.png" alt="(a + b)^2 = a^2 + 2ab + b^2" /></p>
</div><div class="admonition-example admonition ">
<p class="first admonition-title">Example</p>
<p>A 2-dimensional array of size 2 x 3, composed of 4-byte integer
elements:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">],</span> <span class="p">[</span><span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">]],</span> <span class="n">np</span><span class="o">.</span><span class="n">int32</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">type</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">&lt;type &#39;numpy.ndarray&#39;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">shape</span>
<span class="go">(2, 3)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">dtype</span>
<span class="go">dtype(&#39;int32&#39;)</span>
</pre></div>
</div>
<p>The array can be indexed using Python container-like syntax:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">]</span> <span class="c"># i.e., the element of x in the *second* row, *third*</span>
<span class="go">column, namely, 6.</span>
</pre></div>
</div>
<p>For example <em class="xref std std-ref">slicing</em> can produce views of
the array:</p>
<div class="last highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="p">[:,</span><span class="mi">1</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span>
<span class="go">array([2, 5])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="mi">9</span> <span class="c"># this also changes the corresponding element in x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span>
<span class="go">array([9, 5])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span>
<span class="go">array([[1, 9, 3],</span>
<span class="go"> [4, 5, 6]])</span>
</pre></div>
</div>
</div>
<dl class="class">
<dt id="pNbody.NbodyDefault">
<em class="property">class </em><tt class="descclassname">pNbody.</tt><tt class="descname">NbodyDefault</tt><big>(</big><em>p_name=None</em>, <em>pos=None</em>, <em>vel=None</em>, <em>mass=None</em>, <em>num=None</em>, <em>tpe=None</em>, <em>ftype=None</em>, <em>status='old'</em>, <em>byteorder='little'</em>, <em>pio='no'</em>, <em>local=False</em>, <em>log=None</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault" title="Permalink to this definition">¶</a></dt>
<dd><dl class="method">
<dt id="pNbody.NbodyDefault.A">
<tt class="descname">A</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.A" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the gas entropy of the model.
The output is an nx1 float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.Accel">
<tt class="descname">Accel</tt><big>(</big><em>x</em>, <em>eps</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.Accel" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the acceleration at a given position, using the softening lenght eps.</p>
<p>x : position (array vector)
eps : softening</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.CombiMap">
<tt class="descname">CombiMap</tt><big>(</big><em>*arg</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.CombiMap" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an image in form of a matrix (nx x ny float array).
Contrary to ComputeMap, CombiMap compose different output of ComputeMap.</p>
<p>pos : position of particles (moment 0)</p>
<p>sr : dispertion in r (with respect to xp)
svr : dispertion in vr</p>
<p>vxyr : mean velocity in the plane
svxyr: dispertion in vxy</p>
<p>vtr : mean tangential velocity in the plane
svtr : dispertion in vt</p>
<p>szr : ratio sigma z/sigma r</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.ComputeDensityAndHsml">
<tt class="descname">ComputeDensityAndHsml</tt><big>(</big><em>pos=None</em>, <em>Hsml=None</em>, <em>DesNumNgb=None</em>, <em>MaxNumNgbDeviation=None</em>, <em>Tree=None</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.ComputeDensityAndHsml" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute Density and Hsml (for a specific place)</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.ComputeHisto">
<tt class="descname">ComputeHisto</tt><big>(</big><em>bins</em>, <em>mode</em>, <em>space</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.ComputeHisto" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute and histogram</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.ComputeMap">
<tt class="descname">ComputeMap</tt><big>(</big><em>*arg</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.ComputeMap" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an image in form of a matrix (nx x ny float array)</p>
<p>obs : position of observer
x0 : eye position
xp : focal position
alpha : angle of the head
view : &#8216;xy&#8217; &#8216;xz&#8217; &#8216;yz&#8217;</p>
<p>eye : &#8216;right&#8217; &#8216;left&#8217;
dist_eye : distance between eyes</p>
<p>mode : mode of map
space : pos or vel</p>
<p>persp : &#8216;on&#8217; &#8216;off&#8217;
clip : (near,far)
size : (maxx,maxy)</p>
<p>cut : &#8216;yes&#8217; &#8216;no&#8217;</p>
<p>frsp : factor for rsp
shape : shape of the map</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.ComputeMeanHisto">
<tt class="descname">ComputeMeanHisto</tt><big>(</big><em>bins</em>, <em>mode1</em>, <em>space</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.ComputeMeanHisto" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the mean map of an observable.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.ComputeMeanMap">
<tt class="descname">ComputeMeanMap</tt><big>(</big><em>*arg</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.ComputeMeanMap" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the mean map of an observable.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.ComputeObjectMap">
<tt class="descname">ComputeObjectMap</tt><big>(</big><em>*arg</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.ComputeObjectMap" title="Permalink to this definition">¶</a></dt>
<dd><ul class="simple">
<li><ul class="first">
<li><ul class="first">
<li>IN DEVELOPPEMENT : allow to draw an object like a box, a grid... * * *</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>Return an image in form of a matrix (nx x ny float array)</p>
<p>obs : position of observer
x0 : eye position
xp : focal position
alpha : angle of the head
view : &#8216;xy&#8217; &#8216;xz&#8217; &#8216;yz&#8217;</p>
<p>eye : &#8216;right&#8217; &#8216;left&#8217;
dist_eye : distance between eyes</p>
<p>mode : mode of map
space : pos or vel</p>
<p>persp : &#8216;on&#8217; &#8216;off&#8217;
clip : (near,far)
size : (maxx,maxy)</p>
<p>cut : &#8216;yes&#8217; &#8216;no&#8217;</p>
<p>frsp : factor for rsp
shape : shape of the map</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.ComputeSigmaHisto">
<tt class="descname">ComputeSigmaHisto</tt><big>(</big><em>bins</em>, <em>mode1</em>, <em>mode2</em>, <em>space</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.ComputeSigmaHisto" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the histogram of an observable.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.ComputeSigmaMap">
<tt class="descname">ComputeSigmaMap</tt><big>(</big><em>*arg</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.ComputeSigmaMap" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the sigma map of an observable.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.ComputeSph">
<tt class="descname">ComputeSph</tt><big>(</big><em>DesNumNgb=None</em>, <em>MaxNumNgbDeviation=None</em>, <em>Tree=None</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.ComputeSph" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute self.Density and self.Hsml using sph approximation</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.Ekin">
<tt class="descname">Ekin</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.Ekin" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the total kinetic energy</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.Epot">
<tt class="descname">Epot</tt><big>(</big><em>eps</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.Epot" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the total potential energy using the softening lenght eps.</p>
<p>eps : softening</p>
<p>WARNING : THIS FUNCTION DO NOT WORK IN MPI MODE</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.ExchangeParticles">
<tt class="descname">ExchangeParticles</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.ExchangeParticles" title="Permalink to this definition">¶</a></dt>
<dd><p>Exchange particles betwee procs, using peano-hilbert decomposition computed in ptree</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.Get_Velocities_From_Virial_Approximation">
<tt class="descname">Get_Velocities_From_Virial_Approximation</tt><big>(</big><em>select=None</em>, <em>vf=1.0</em>, <em>eps=0.10000000000000001</em>, <em>UseTree=True</em>, <em>Tree=None</em>, <em>ErrTolTheta=0.5</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.Get_Velocities_From_Virial_Approximation" title="Permalink to this definition">¶</a></dt>
<dd><p>does not work well</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.InitSpec">
<tt class="descname">InitSpec</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.InitSpec" title="Permalink to this definition">¶</a></dt>
<dd><p>This function allows to initialize specific parameters.
It must be defined in format files.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.IntegrateUsingRK">
<tt class="descname">IntegrateUsingRK</tt><big>(</big><em>tstart=0</em>, <em>dt=1</em>, <em>dt0=1.0000000000000001e-05</em>, <em>epsx=1e-13</em>, <em>epsv=1e-13</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.IntegrateUsingRK" title="Permalink to this definition">¶</a></dt>
<dd><p>Integrate the equation of motion using RK78 integrator.</p>
<p>tstart : initial time
dt : interval time
dt0 : inital dt
epsx : position precision
epsv : velocity precision</p>
<p>tmin,tmax,dt,dtout,epsx,epsv,filename</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.L">
<tt class="descname">L</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.L" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the angular momentum in x,y,z of all particles.
The output is an 3xn float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.Ltot">
<tt class="descname">Ltot</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.Ltot" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the total angular momentum.
The output is an 3x1 float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.Lum">
<tt class="descname">Lum</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.Lum" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the luminosty of the model, defined as
Lum = m*u/Tcool = m*Lambda/rho</p>
<p>The output is an nx1 float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.Map">
<tt class="descname">Map</tt><big>(</big><em>*arg</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.Map" title="Permalink to this definition">¶</a></dt>
<dd><p>Return 2 final images (float and int)</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.MeanWeight">
<tt class="descname">MeanWeight</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.MeanWeight" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the mean weight of a model, taking into account
heating by UV source.
The output is an nx1 float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.Mr_Spherical">
<tt class="descname">Mr_Spherical</tt><big>(</big><em>nr=25</em>, <em>rmin=0</em>, <em>rmax=50</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.Mr_Spherical" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the mass inside radius r (supposing a spherical density distribution).
The output is 2 n x 1 float arrays.</p>
<p>nr : number of bins (size of the output)
rmin : minimal radius (this must be zero, instead it is wrong...)
rmax : maximal radius</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.Ne">
<tt class="descname">Ne</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.Ne" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the electron density of the model.
The output is an nx1 float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.P">
<tt class="descname">P</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.P" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the gas pressure of the model.
The output is an nx1 float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.Pot">
<tt class="descname">Pot</tt><big>(</big><em>x</em>, <em>eps</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.Pot" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the potential at a given position, using the softening lenght eps.</p>
<p>x : position (array vector)
eps : softening</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.R">
<tt class="descname">R</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.R" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array that corresponds to
the projected distance from the center of each particle.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.Rho">
<tt class="descname">Rho</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.Rho" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the gas density of the model.
The output is an nx1 float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.S">
<tt class="descname">S</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.S" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the <cite>entropy</cite> of the model, defined as
S = T * Ne^(1-gamma)
The output is an nx1 float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.SendAllToAll">
<tt class="descname">SendAllToAll</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.SendAllToAll" title="Permalink to this definition">¶</a></dt>
<dd><p>Send all particles to all nodes
at the end of the day, all nodes have the same nbody object</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.SphEvaluate">
<tt class="descname">SphEvaluate</tt><big>(</big><em>val</em>, <em>pos=None</em>, <em>vel=None</em>, <em>hsml=None</em>, <em>DesNumNgb=None</em>, <em>MaxNumNgbDeviation=None</em>, <em>Tree=None</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.SphEvaluate" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an sph evaluation of the variable var</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.T">
<tt class="descname">T</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.T" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the gas temperature of the model.
The output is an nx1 float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.Tcool">
<tt class="descname">Tcool</tt><big>(</big><em>coolingfile=None</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.Tcool" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the cooling time of the model.
The output is an nx1 float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.Tmu">
<tt class="descname">Tmu</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.Tmu" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the gas temperature of the model.
The output is an nx1 float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.TreeAccel">
<tt class="descname">TreeAccel</tt><big>(</big><em>pos</em>, <em>eps</em>, <em>Tree=None</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.TreeAccel" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the acceleration at a given position, using the softening lenght eps
and using a tree.</p>
<p>pos : position (array vector)
eps : softening
Tree: gravitational tree if already computed</p>
<p>WARNING : this function do not work in parallel</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.TreePot">
<tt class="descname">TreePot</tt><big>(</big><em>pos</em>, <em>eps</em>, <em>Tree=None</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.TreePot" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the potential at a given position, using the softening lenght eps
and using a tree.</p>
<p>pos : position (array vector)
eps : softening
Tree: gravitational tree if already computed</p>
<p>WARNING : this function do not work in parallel</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.U">
<tt class="descname">U</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.U" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the gas specific energy of the model.
The output is an nx1 float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.Vr">
<tt class="descname">Vr</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.Vr" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the radial velocies of particles
The output is an 3xn float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.Vt">
<tt class="descname">Vt</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.Vt" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the tangential velocies of particles
The output is an 3xn float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.Vz">
<tt class="descname">Vz</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.Vz" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array containing z velocity</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.align">
<tt class="descname">align</tt><big>(</big><em>axis</em>, <em>mode='a'</em>, <em>sgn='+'</em>, <em>fact=None</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.align" title="Permalink to this definition">¶</a></dt>
<dd><p>Rotate the object in order to align the axis &#8216;axis&#8217; with the z axis.</p>
<p>axis : [x,y,z]
mode : &#8216;p&#8217; : only position</p>
<blockquote>
<div>&#8216;v&#8217; : only velocities
&#8216;a&#8217; : both (default)</div></blockquote>
<dl class="docutils">
<dt>sgn <span class="classifier-delimiter">:</span> <span class="classifier">&#8216;+&#8217;</span> <span class="classifier-delimiter">:</span> <span class="classifier">normal rotation</span></dt>
<dd>&#8216;-&#8216; : reverse sense of rotation</dd>
</dl>
<p>fact : int : factor to increase the angle</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.align2">
<tt class="descname">align2</tt><big>(</big><em>axis1=[1, 0, 0], axis2=[0, 0, 1], point=[0, 0, 0]</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.align2" title="Permalink to this definition">¶</a></dt>
<dd><p>Rotate the object in order to align the axis &#8216;axis&#8217; with the z axis.</p>
<p>axis1 : [x,y,z]
axis2 : [x,y,z]
point : [x,y,z]</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.align_with_main_axis">
<tt class="descname">align_with_main_axis</tt><big>(</big><em>mode='a'</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.align_with_main_axis" title="Permalink to this definition">¶</a></dt>
<dd><p>Rotate the object in order to align it&#8217;s major axis with
the axis of its inertial tensor.</p>
<dl class="docutils">
<dt>mode <span class="classifier-delimiter">:</span> <span class="classifier">&#8216;p&#8217;</span> <span class="classifier-delimiter">:</span> <span class="classifier">only position </span></dt>
<dd>&#8216;v&#8217; : only velocities
&#8216;a&#8217; : both (default)</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.append">
<tt class="descname">append</tt><big>(</big><em>solf</em>, <em>do_not_sort=False</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.append" title="Permalink to this definition">¶</a></dt>
<dd><p>Add to the current N-body object, particles form the
N-body object &#8220;new&#8221;.</p>
<p>solf : Nbody object</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.cart2sph">
<tt class="descname">cart2sph</tt><big>(</big><em>pos=None</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.cart2sph" title="Permalink to this definition">¶</a></dt>
<dd><p>Transform carthesian coodinates x,y,z into spherical
coordinates r,p,t
Return a 3xn float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.check_arrays">
<tt class="descname">check_arrays</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.check_arrays" title="Permalink to this definition">¶</a></dt>
<dd><p>check if the array contains special values like NaN or Inf</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.cm">
<tt class="descname">cm</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.cm" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the mass center of the model.
The output is an 3x1 float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.cmcenter">
<tt class="descname">cmcenter</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.cmcenter" title="Permalink to this definition">¶</a></dt>
<dd><p>Move the N-body object in order
to center the mass center at the origin.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.cv">
<tt class="descname">cv</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.cv" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the center of the velocities of the model.
The output is an 3x1 float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.cvcenter">
<tt class="descname">cvcenter</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.cvcenter" title="Permalink to this definition">¶</a></dt>
<dd><p>Center the center of velocities at the origin.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.dens">
<tt class="descname">dens</tt><big>(</big><em>r=None</em>, <em>nb=25</em>, <em>rm=50</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.dens" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the number density at radius r (supposing a spherical density distribution).
If r is not specified, it is computed with nb and rm.
The output is an n x 1 float array.</p>
<p>!!! This routine do not use masses !!!</p>
<p>r : radius
nb : number of bins (size of the output)
rm : maximal radius</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.display">
<tt class="descname">display</tt><big>(</big><em>*arg</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.display" title="Permalink to this definition">¶</a></dt>
<dd><p>Display the model</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.dmodes">
<tt class="descname">dmodes</tt><big>(</big><em>nr=32</em>, <em>nm=16</em>, <em>rm=32</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.dmodes" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the density modes of a model</p>
<p>nm = 16 : number of modes
nr = 32 : number of radius
rm = 50 : max radius</p>
<p>return</p>
<p>r : the radius used
m : the modes computed
m1 : the matrix of the amplitude
m2 : the matrix of the phases</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.dv_mean">
<tt class="descname">dv_mean</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.dv_mean" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the average relative speed between particles.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.dx_mean">
<tt class="descname">dx_mean</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.dx_mean" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the average distance between particles.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.ekin">
<tt class="descname">ekin</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.ekin" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the total specific kinetic energy</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.epot">
<tt class="descname">epot</tt><big>(</big><em>eps</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.epot" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the total specific potential energy using the softening lenght eps.</p>
<p>eps : softening</p>
<p>WARNING : THIS FUNCTION DO NOT WORK IN MPI MODE</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.expose">
<tt class="descname">expose</tt><big>(</big><em>obs</em>, <em>eye=None</em>, <em>dist_eye=None</em>, <em>foc=None</em>, <em>space='pos'</em>, <em>pos=None</em>, <em>vel=None</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.expose" title="Permalink to this definition">¶</a></dt>
<dd><p>Rotate and translate the object in order to be seen as if the
observer was in x0, looking at a point in xp.</p>
<p>obs : observer matrix
eye : &#8216;right&#8217; or &#8216;left&#8217;
dist_eye : distance between eyes (separation = angle)
space : pos or vel
foc : focal</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.find_vars">
<tt class="descname">find_vars</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.find_vars" title="Permalink to this definition">¶</a></dt>
<dd><p>This function return a list of variables defined in the current object</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.gather_mass">
<tt class="descname">gather_mass</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.gather_mass" title="Permalink to this definition">¶</a></dt>
<dd><p>Gather in a unique array all mass of all nodes.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.gather_num">
<tt class="descname">gather_num</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.gather_num" title="Permalink to this definition">¶</a></dt>
<dd><p>Gather in a unique array all num of all nodes.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.gather_pos">
<tt class="descname">gather_pos</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.gather_pos" title="Permalink to this definition">¶</a></dt>
<dd><p>Gather in a unique array all positions of all nodes.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.gather_vec">
<tt class="descname">gather_vec</tt><big>(</big><em>vec</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.gather_vec" title="Permalink to this definition">¶</a></dt>
<dd><p>Gather in a unique array all vectors vec of all nodes.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.gather_vel">
<tt class="descname">gather_vel</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.gather_vel" title="Permalink to this definition">¶</a></dt>
<dd><p>Gather in a unique array all velocites of all nodes.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.getAccelerationInCylindricalGrid">
<tt class="descname">getAccelerationInCylindricalGrid</tt><big>(</big><em>eps</em>, <em>z</em>, <em>Rmax</em>, <em>nr=32</em>, <em>nt=32</em>, <em>UseTree=False</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.getAccelerationInCylindricalGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the Acceleration in cells of a cylindrical grid</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.getNumberParticlesInCylindricalGrid">
<tt class="descname">getNumberParticlesInCylindricalGrid</tt><big>(</big><em>Rmax</em>, <em>nr=32</em>, <em>nt=32</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.getNumberParticlesInCylindricalGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the number of particles in cells of a cylindrical grid</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.getPotentialInCylindricalGrid">
<tt class="descname">getPotentialInCylindricalGrid</tt><big>(</big><em>eps</em>, <em>z</em>, <em>Rmax</em>, <em>nr=32</em>, <em>nt=32</em>, <em>UseTree=False</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.getPotentialInCylindricalGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the potential in cells of a cylindrical grid</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.getRadialVelocityDispersionInCylindricalGrid">
<tt class="descname">getRadialVelocityDispersionInCylindricalGrid</tt><big>(</big><em>Rmax</em>, <em>nr=32</em>, <em>nt=32</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.getRadialVelocityDispersionInCylindricalGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the radial velocity dispersion in cells of a cylindrical grid</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.getRadiusInCylindricalGrid">
<tt class="descname">getRadiusInCylindricalGrid</tt><big>(</big><em>z</em>, <em>Rmax</em>, <em>nr=32</em>, <em>nt=32</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.getRadiusInCylindricalGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the radius in cells of a cylindrical grid</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.getSurfaceDensityInCylindricalGrid">
<tt class="descname">getSurfaceDensityInCylindricalGrid</tt><big>(</big><em>Rmax</em>, <em>nr=32</em>, <em>nt=32</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.getSurfaceDensityInCylindricalGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the surface density in cells of a cylindrical grid</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.getTree">
<tt class="descname">getTree</tt><big>(</big><em>force_computation=False</em>, <em>ErrTolTheta=0.80000000000000004</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.getTree" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a Tree object</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.get_default_spec_vars">
<tt class="descname">get_default_spec_vars</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.get_default_spec_vars" title="Permalink to this definition">¶</a></dt>
<dd><p>return specific variables default values for the class</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.get_default_spec_vect">
<tt class="descname">get_default_spec_vect</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.get_default_spec_vect" title="Permalink to this definition">¶</a></dt>
<dd><p>return specific vector default values for the class</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.get_histocenter">
<tt class="descname">get_histocenter</tt><big>(</big><em>rbox=50</em>, <em>nb=500</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.get_histocenter" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the position of the higher density region
in x,y,z (not good)
found by the function &#8220;histocenter&#8221;.</p>
<p>rbox : size of the box
nb : number of bins in each dimension</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.get_histocenter2">
<tt class="descname">get_histocenter2</tt><big>(</big><em>rbox=50</em>, <em>nb=64</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.get_histocenter2" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the position of the higher density region
in x,y,z (not good)
found by the function &#8220;histocenter&#8221;.</p>
<p>rbox : size of the box
nb : number of bins in each dimension</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.get_list_of_array">
<tt class="descname">get_list_of_array</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.get_list_of_array" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the list of numpy vectors of size nbody.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.get_list_of_method">
<tt class="descname">get_list_of_method</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.get_list_of_method" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the list of instance methods (functions).</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.get_list_of_vars">
<tt class="descname">get_list_of_vars</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.get_list_of_vars" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the list of vars that are linked to the model</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.get_mass_tot">
<tt class="descname">get_mass_tot</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.get_mass_tot" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the total mass of system.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.get_mxntpe">
<tt class="descname">get_mxntpe</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.get_mxntpe" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the max number of type for this format</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.get_nbody">
<tt class="descname">get_nbody</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.get_nbody" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the local number of particles.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.get_nbody_tot">
<tt class="descname">get_nbody_tot</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.get_nbody_tot" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the total number of particles.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.get_npart">
<tt class="descname">get_npart</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.get_npart" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the local number of particles of each types,
based on the variable tpe</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.get_npart_all">
<tt class="descname">get_npart_all</tt><big>(</big><em>npart_tot</em>, <em>NTask</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.get_npart_all" title="Permalink to this definition">¶</a></dt>
<dd><p>From npart_tot, the total number of particles per type,
return npart_per_proc, an array where each element corresponds
to the value of npart of each process.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.get_npart_and_npart_all">
<tt class="descname">get_npart_and_npart_all</tt><big>(</big><em>npart</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.get_npart_and_npart_all" title="Permalink to this definition">¶</a></dt>
<dd><p>From npart (usually read for the header of a file), compute :</p>
<p>npart : number of particles in each type
npart_tot : total number of particles in each type
npart_all : npart for each process.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.get_npart_tot">
<tt class="descname">get_npart_tot</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.get_npart_tot" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the total number of particles of each types.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.get_ns">
<tt class="descname">get_ns</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.get_ns" title="Permalink to this definition">¶</a></dt>
<dd><p>Return in an array the number of particles of each node.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.get_ntype">
<tt class="descname">get_ntype</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.get_ntype" title="Permalink to this definition">¶</a></dt>
<dd><p>return the number of paticles types</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.get_num">
<tt class="descname">get_num</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.get_num" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the num variable in order to be consistent with particles types</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.get_rotation_matrix_to_align_with_main_axis">
<tt class="descname">get_rotation_matrix_to_align_with_main_axis</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.get_rotation_matrix_to_align_with_main_axis" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the rotation matrix used to rotate the object in order to align
it&#8217;s main axis with the axis of its inertial tensor.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.get_rsp_approximation">
<tt class="descname">get_rsp_approximation</tt><big>(</big><em>DesNumNgb=None</em>, <em>MaxNumNgbDeviation=None</em>, <em>Tree=None</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.get_rsp_approximation" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an aproximation of rsp, based on the tree.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.getindex">
<tt class="descname">getindex</tt><big>(</big><em>num</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.getindex" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an array of index of a particle from its specific number id.
The array is empty if no particle corresponds to the specific number id.</p>
<p>num : Id of the particle</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.has_array">
<tt class="descname">has_array</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.has_array" title="Permalink to this definition">¶</a></dt>
<dd><p>Return true if the object pNbody has
an array called self.name</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.has_var">
<tt class="descname">has_var</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.has_var" title="Permalink to this definition">¶</a></dt>
<dd><p>Return true if the object pNbody has
a variable called self.name</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.hdcenter">
<tt class="descname">hdcenter</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.hdcenter" title="Permalink to this definition">¶</a></dt>
<dd><p>Move the N-body object in order to center the higher
density region found.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.histocenter">
<tt class="descname">histocenter</tt><big>(</big><em>rbox=50</em>, <em>nb=500</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.histocenter" title="Permalink to this definition">¶</a></dt>
<dd><p>Move the N-body object in order to center the higher
density region found near the mass center.
The higher density region is determined whith density histograms.</p>
<p>rbox : box dimension, where to compute the histograms
nb : number of bins for the histograms</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.histocenter2">
<tt class="descname">histocenter2</tt><big>(</big><em>rbox=50</em>, <em>nb=64</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.histocenter2" title="Permalink to this definition">¶</a></dt>
<dd><p>Move the N-body object in order to center the higher
density region found near the mass center.
The higher density region is determined whith density histograms.</p>
<p>rbox : box dimension, where to compute the histograms
nb : number of bins for the histograms</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.histovel">
<tt class="descname">histovel</tt><big>(</big><em>nb=100</em>, <em>vmin=None</em>, <em>vmax=None</em>, <em>mode='n'</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.histovel" title="Permalink to this definition">¶</a></dt>
<dd><p>Return or plot the histrogram of the norm of velocities or of the radial velocities.</p>
<p>The output is a list (r,h) of 2 nx1 float arrays,
where r is the radius and h the values of the histogram.</p>
<p>nb : number of bins (size of the output)
vmax : maximum velocity
vmin : minimum velocity
mode : &#8216;n&#8217; (norme of the velocities)</p>
<blockquote>
<div>&#8216;r&#8217; (radial velocities)</div></blockquote>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.inertial_tensor">
<tt class="descname">inertial_tensor</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.inertial_tensor" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the inertial tensor.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.info">
<tt class="descname">info</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.info" title="Permalink to this definition">¶</a></dt>
<dd><p>Write info</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.init">
<tt class="descname">init</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.init" title="Permalink to this definition">¶</a></dt>
<dd><p>Initialize normal and specific class variables</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.l">
<tt class="descname">l</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.l" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the specific angular momentum in x,y,z of all particles.
The output is an 3xn float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.ltot">
<tt class="descname">ltot</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.ltot" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the specific total angular momentum.
The output is an 3x1 float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.make_default_vars_global">
<tt class="descname">make_default_vars_global</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.make_default_vars_global" title="Permalink to this definition">¶</a></dt>
<dd><p>Make specific variables global</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.mdens">
<tt class="descname">mdens</tt><big>(</big><em>r=None</em>, <em>nb=25</em>, <em>rm=50</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.mdens" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the density at radius r (supposing a spherical density distribution).
If r is not specified, it is computed with nb and rm.
The output is an n x 1 float array.</p>
<p>r : radius
nb : number of bins (size of the output)
rm : maximal radius</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.memory_info">
<tt class="descname">memory_info</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.memory_info" title="Permalink to this definition">¶</a></dt>
<dd><p>Write info on memory size of the current object (only counting arrays size)</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.minert">
<tt class="descname">minert</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.minert" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the diagonal of the intertial momentum.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.mr">
<tt class="descname">mr</tt><big>(</big><em>r=None</em>, <em>nb=25</em>, <em>rm=50</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.mr" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the mass inside radius r (supposing a spherical density distribution).
If r is not specified, it is computed with nb and rm.
The output is an n x 1 float array.</p>
<p>r : radius
nb : number of bins (size of the output)
rm : maximal radius</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.msdens">
<tt class="descname">msdens</tt><big>(</big><em>r=None</em>, <em>nb=25</em>, <em>rm=50</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.msdens" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the mass surface density at radius r.
If r is not specified, it is computed with nb and rm.
The output is an nx1 float array.</p>
<p>r : radius
nb : number of bins (size of the output)
rm : maximal radius</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.nodes_info">
<tt class="descname">nodes_info</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.nodes_info" title="Permalink to this definition">¶</a></dt>
<dd><p>Write info on nodes</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.object_info">
<tt class="descname">object_info</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.object_info" title="Permalink to this definition">¶</a></dt>
<dd><p>Write class(object) info</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.open_and_read">
<tt class="descname">open_and_read</tt><big>(</big><em>name</em>, <em>readfct</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.open_and_read" title="Permalink to this definition">¶</a></dt>
<dd><p>open and read file name</p>
<p>name : name of the input
readfct : function used to read the file</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.open_and_write">
<tt class="descname">open_and_write</tt><big>(</big><em>name</em>, <em>writefct</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.open_and_write" title="Permalink to this definition">¶</a></dt>
<dd><p>Open and write file</p>
<p>name : name of the output
writefct : function used to write the file</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.phi_xy">
<tt class="descname">phi_xy</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.phi_xy" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array that corresponds to
the azimuth in cylindrical coordinate of each particle.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.phi_xyz">
<tt class="descname">phi_xyz</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.phi_xyz" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array that corresponds to
the azimuth in spherical coordinate of each particle.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.print_filenames">
<tt class="descname">print_filenames</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.print_filenames" title="Permalink to this definition">¶</a></dt>
<dd><p>Print files names</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.r">
<tt class="descname">r</tt><big>(</big><em>center=None</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.r" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array that corresponds to
the distance from the center of each particle.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.read">
<tt class="descname">read</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.read" title="Permalink to this definition">¶</a></dt>
<dd><p>Read the particle file(s)</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.read_num">
<tt class="descname">read_num</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.read_num" title="Permalink to this definition">¶</a></dt>
<dd><p>Read a num file</p>
<p>name : name of the input</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.real_numngb">
<tt class="descname">real_numngb</tt><big>(</big><em>num</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.real_numngb" title="Permalink to this definition">¶</a></dt>
<dd><p>number of particles wor wich r&lt;h</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.rebox">
<tt class="descname">rebox</tt><big>(</big><em>boxsize=None</em>, <em>mode=None</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.rebox" title="Permalink to this definition">¶</a></dt>
<dd><p>Translate the positions of the object in order that all particles
being contained in a box of size boxsize.</p>
<dl class="docutils">
<dt>boxsize <span class="classifier-delimiter">:</span> <span class="classifier">size of the box</span></dt>
<dd>if boxsize is not defined, we try first to see if self.boxsize
is defined.</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.redistribute">
<tt class="descname">redistribute</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.redistribute" title="Permalink to this definition">¶</a></dt>
<dd><p>This function redistribute particles amoung all nodes in order to
have a similar number of particles per nodes</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.reduc">
<tt class="descname">reduc</tt><big>(</big><em>n</em>, <em>mass=False</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.reduc" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an N-body object that contain a fraction 1/n of particles.</p>
<p>n : inverse of the fraction of particule to be returned</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.rename">
<tt class="descname">rename</tt><big>(</big><em>p_name=None</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.rename" title="Permalink to this definition">¶</a></dt>
<dd><p>Rename the files</p>
<p>p_name : new name(s)</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.rotate">
<tt class="descname">rotate</tt><big>(</big><em>angle=0, axis=[1, 0, 0], point=[0, 0, 0], mode='a'</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.rotate" title="Permalink to this definition">¶</a></dt>
<dd><p>Rotate the positions and/or the velocities of the object around a specific axis
defined by a vector and an point.</p>
<p>angle : rotation angle in radian
axis : direction of the axis
point : center of the rotation</p>
<dl class="docutils">
<dt>mode <span class="classifier-delimiter">:</span> <span class="classifier">&#8216;p&#8217;</span> <span class="classifier-delimiter">:</span> <span class="classifier">rotate only position</span></dt>
<dd>&#8216;v&#8217; : rotate only velocities
&#8216;a&#8217; : rotate both (default)</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.rotateR">
<tt class="descname">rotateR</tt><big>(</big><em>R</em>, <em>mode='a'</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.rotateR" title="Permalink to this definition">¶</a></dt>
<dd><p>Rotate the model using the matrix R</p>
<dl class="docutils">
<dt>mode <span class="classifier-delimiter">:</span> <span class="classifier">&#8216;p&#8217;</span> <span class="classifier-delimiter">:</span> <span class="classifier">only position </span></dt>
<dd>&#8216;v&#8217; : only velocities
&#8216;a&#8217; : both (default)</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.rotate_old">
<tt class="descname">rotate_old</tt><big>(</big><em>angle=0</em>, <em>mode='a'</em>, <em>axis='x'</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.rotate_old" title="Permalink to this definition">¶</a></dt>
<dd><p>Rotate the positions and/or the velocities of the object around a specific axis.</p>
<p>angle : rotation angle in radian
axis : &#8216;x&#8217; : around x</p>
<blockquote>
<div><blockquote>
<div>&#8216;y&#8217; : around y
&#8216;z&#8217; : around z</div></blockquote>
<p>: [x,y,z] : around this axis</p>
</div></blockquote>
<dl class="docutils">
<dt>mode <span class="classifier-delimiter">:</span> <span class="classifier">&#8216;p&#8217;</span> <span class="classifier-delimiter">:</span> <span class="classifier">rotate only position</span></dt>
<dd>&#8216;v&#8217; : rotate only velocities
&#8216;a&#8217; : rotate both (default)</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.rxy">
<tt class="descname">rxy</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.rxy" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array that corresponds to
the projected distance from the center of each particle.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.rxyz">
<tt class="descname">rxyz</tt><big>(</big><em>center=None</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.rxyz" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array that corresponds to
the distance from the center of each particle.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.sdens">
<tt class="descname">sdens</tt><big>(</big><em>r=None</em>, <em>nb=25</em>, <em>rm=50</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.sdens" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the surface density at radius r.
If r is not specified, it is computed with nb and rm.
The output is an nx1 float array.</p>
<p>!!! This routine do not uses masses !!!</p>
<p>r : radius
nb : number of bins (size of the output)
rm : maximal radius</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.select">
<tt class="descname">select</tt><big>(</big><em>i=0</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.select" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an N-body object that contain only particles of type i</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.selectc">
<tt class="descname">selectc</tt><big>(</big><em>c</em>, <em>local=False</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.selectc" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an N-body object that contain only particles where the
corresponding value in c is not zero.
c is a nx1 Nbody array.</p>
<p>c : the condition vector
local : local selection (True) or global selection (False)</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.selectp">
<tt class="descname">selectp</tt><big>(</big><em>lst=None</em>, <em>file=None</em>, <em>reject=False</em>, <em>local=False</em>, <em>from_num=True</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.selectp" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an N-body object that contain only particles with specific number id.</p>
<p>The list of id&#8217;s is given either by lst (nx1 int array) or
by the name (&#8220;file&#8221;) of a file containing the list of id&#8217;s.</p>
<p>lst : vector list (integer)</p>
<p>reject : True/False : if True, reject particles in lst (default = False)
local : local selection (True) or global selection (False)</p>
<dl class="docutils">
<dt>frum_num <span class="classifier-delimiter">:</span> <span class="classifier">if True, use self.num to select particules</span></dt>
<dd>if False, use arange(self.nbody)</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.set_filenames">
<tt class="descname">set_filenames</tt><big>(</big><em>p_name</em>, <em>pio=None</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.set_filenames" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the local and global names</p>
<p>p_name : new name(s)
pio : &#8216;yes&#8217; or &#8216;no&#8217;</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.set_ftype">
<tt class="descname">set_ftype</tt><big>(</big><em>ftype='binary'</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.set_ftype" title="Permalink to this definition">¶</a></dt>
<dd><p>Change the type of the file</p>
<p>ftype : type of the file</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.set_local_system_of_units">
<tt class="descname">set_local_system_of_units</tt><big>(</big><em>params=None</em>, <em>UnitLength_in_cm=None</em>, <em>UnitVelocity_in_cm_per_s=None</em>, <em>UnitMass_in_g=None</em>, <em>unitparameterfile=None</em>, <em>gadgetparameterfile=None</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.set_local_system_of_units" title="Permalink to this definition">¶</a></dt>
<dd><p>Set local system of units using UnitLength_in_cm,UnitVelocity_in_cm_per_s,UnitMass_in_g</p>
<ol class="arabic">
<li><p class="first">if nothing is given, we use self.unitsparameters to obtain these values</p>
</li>
<li><dl class="first docutils">
<dt>if UnitLength_in_cm</dt>
<dd><p class="first last">UnitVelocity_in_cm_per_s
UnitMass_in_g</p>
</dd>
</dl>
<p>are given, we use them</p>
</li>
</ol>
<dl class="docutils">
<dt>2b) if UnitLength_in_cm,UnitVelocity_in_cm_per_s,UnitMass_in_g</dt>
<dd>are given in a dictionary</dd>
</dl>
<ol class="arabic simple" start="3">
<li>if unitparameterfile is given we read the parameters from the file (units parameter format)</li>
<li>if gadgetparameterfile is given we read the parameters from the file (gadget param format)</li>
</ol>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.set_npart">
<tt class="descname">set_npart</tt><big>(</big><em>npart</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.set_npart" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the local number of particles of each types.
This function modifies the variable self.tpe</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.set_parameters">
<tt class="descname">set_parameters</tt><big>(</big><em>params</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.set_parameters" title="Permalink to this definition">¶</a></dt>
<dd><p>Set parameters for the class</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.set_pio">
<tt class="descname">set_pio</tt><big>(</big><em>pio</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.set_pio" title="Permalink to this definition">¶</a></dt>
<dd><p>Set parallel input/output or not io</p>
<p>pio : &#8216;yes&#8217; or &#8216;no&#8217;</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.set_tpe">
<tt class="descname">set_tpe</tt><big>(</big><em>tpe</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.set_tpe" title="Permalink to this definition">¶</a></dt>
<dd><p>Set all particles to the type tpe</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.set_unitsparameters">
<tt class="descname">set_unitsparameters</tt><big>(</big><em>unitsparams</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.set_unitsparameters" title="Permalink to this definition">¶</a></dt>
<dd><p>Set units parameters for the class.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.show">
<tt class="descname">show</tt><big>(</big><em>*arg</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.show" title="Permalink to this definition">¶</a></dt>
<dd><p>Display the model
this is an alias to display</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.sigma">
<tt class="descname">sigma</tt><big>(</big><em>r=None</em>, <em>nb=25.0</em>, <em>rm=50.0</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.sigma" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the 3 velocity dispersion (in cylindrical coordinates) and the mean azimuthal velocity curve.
If r is not specified, it is computed with nb and rm.</p>
<p>The output is a list (r,sr,st,sz,mt) of 5 $n imes 1$ float arrays,
where r is the radius, sr the radial velocity dispersion, st, the azimuthal velocity dispersion,
sz, the vertical velocity dispersion and mt, the mean azimuthal velocity curve.</p>
<p>!!! This routine works only if particles have equal masses !!!</p>
<p>r : radius where to compute the values
nb : number of bins (size of the output)
rm : maximal radius</p>
<p>return : r,sr,st,sz,mt</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.sigma_vz">
<tt class="descname">sigma_vz</tt><big>(</big><em>r=None</em>, <em>nb=25</em>, <em>rm=50</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.sigma_vz" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the vertical dispertion in z at radius r.
If r is not specified, it is computed with nb and rm.
The output is an nx1 float array.</p>
<p>r : radius
nb : number of bins (size of the output)
rm : maximal radius</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.sigma_z">
<tt class="descname">sigma_z</tt><big>(</big><em>r=None</em>, <em>nb=25</em>, <em>rm=50</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.sigma_z" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the vertical dispertion in z at radius r.
If r is not specified, it is computed with nb and rm.
The output is an nx1 float array.</p>
<p>r : radius
nb : number of bins (size of the output)
rm : maximal radius</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.size">
<tt class="descname">size</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.size" title="Permalink to this definition">¶</a></dt>
<dd><p>Estimate the model size, using the inertial momentum</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.sort">
<tt class="descname">sort</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.sort" title="Permalink to this definition">¶</a></dt>
<dd><p>sort particles according to their num variable</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.sort_type">
<tt class="descname">sort_type</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.sort_type" title="Permalink to this definition">¶</a></dt>
<dd><p>Contrary to sort, this fonction sort particles
respecting their type.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.spec_info">
<tt class="descname">spec_info</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.spec_info" title="Permalink to this definition">¶</a></dt>
<dd><p>Write specific info</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.sph2cart">
<tt class="descname">sph2cart</tt><big>(</big><em>pos=None</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.sph2cart" title="Permalink to this definition">¶</a></dt>
<dd><p>Transform spherical coordinates r,p,t into carthesian
coodinates x,y,z
Return a 3xn float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.spin">
<tt class="descname">spin</tt><big>(</big><em>omega=None</em>, <em>L=None</em>, <em>j=None</em>, <em>E=None</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.spin" title="Permalink to this definition">¶</a></dt>
<dd><p>Spin the object with angular velocity &#8220;omega&#8221; (rigid rotation).
Omega is a 1 x 3 array object</p>
<p>If L (total angular momentum) is explicitely given, compute Omega from L (1 x 3 array object).</p>
<p>omega : angular speed (array vector)
L : desired angular momentum
j : desired energy fraction in rotation
E : Total energy (without rotation)</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.sub">
<tt class="descname">sub</tt><big>(</big><em>n1=0</em>, <em>n2=None</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.sub" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an N-body object that have particles whith indicies in the range [n1:n2].</p>
<p>n1 : number of the first particule
n2 : number of the last particule</p>
<p>Note : the first particle is 0</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.theta_xyz">
<tt class="descname">theta_xyz</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.theta_xyz" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array that corresponds to
the elevation angle in spherical coordinate of each particle.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.tork">
<tt class="descname">tork</tt><big>(</big><em>acc</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.tork" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the total tork on the system due to the force
acting on each particle (acc).
The output is an 3xn float array.</p>
<p>acc : 3xn float array</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.translate">
<tt class="descname">translate</tt><big>(</big><em>dx</em>, <em>mode='p'</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.translate" title="Permalink to this definition">¶</a></dt>
<dd><p>Translate the positions or the velocities of the object.</p>
<p>dx : shift (array vector)
mode : &#8216;p&#8217; : translate positions</p>
<blockquote>
<div>&#8216;v&#8217; : translate velocities</div></blockquote>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.usual_numngb">
<tt class="descname">usual_numngb</tt><big>(</big><em>num</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.usual_numngb" title="Permalink to this definition">¶</a></dt>
<dd><p>usual way to compute the number of neighbors</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.v_sigma">
<tt class="descname">v_sigma</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.v_sigma" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the norm of the velocity dispersions.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.vel_cart2cyl">
<tt class="descname">vel_cart2cyl</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.vel_cart2cyl" title="Permalink to this definition">¶</a></dt>
<dd><p>Transform velocities in carthesian coordinates vx,vy,vz into cylindrical
coodinates vr,vz,vz.
Pos is the position of particles in cart. coord.
Vel is the velocity in cart. coord.
Return a 3xn float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.vel_cyl2cart">
<tt class="descname">vel_cyl2cart</tt><big>(</big><em>pos=None</em>, <em>vel=None</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.vel_cyl2cart" title="Permalink to this definition">¶</a></dt>
<dd><p>Transform velocities in cylindrical coordinates vr,vt,vz into carthesian
coodinates vx,vy,vz.
Pos is the position of particles in cart. coord.
Vel is the velocity in cylindrical coord.
Return a 3xn float array.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.vn">
<tt class="descname">vn</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.vn" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array that corresponds to
the norm of velocities</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.vrxyz">
<tt class="descname">vrxyz</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.vrxyz" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array that corresponds to
the radial velocity in spherical system</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.vx">
<tt class="descname">vx</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.vx" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array containing x velocity</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.vy">
<tt class="descname">vy</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.vy" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array containing y velocity</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.vz">
<tt class="descname">vz</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.vz" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array containing z velocity</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.weighted_numngb">
<tt class="descname">weighted_numngb</tt><big>(</big><em>num</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.weighted_numngb" title="Permalink to this definition">¶</a></dt>
<dd><p>num = particle where to compute weighted_numngb
see Springel 05</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.write">
<tt class="descname">write</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.write" title="Permalink to this definition">¶</a></dt>
<dd><p>Write the particle file(s)</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.write_num">
<tt class="descname">write_num</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.write_num" title="Permalink to this definition">¶</a></dt>
<dd><p>Write a num file</p>
<p>name : name of the output</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.x">
<tt class="descname">x</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.x" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array containing x coordinate</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.x_sigma">
<tt class="descname">x_sigma</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.x_sigma" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the norm of the position dispersions.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.y">
<tt class="descname">y</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.y" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array containing y coordinate</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.z">
<tt class="descname">z</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.z" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array containing z coordinate</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.zmodes">
<tt class="descname">zmodes</tt><big>(</big><em>nr=32</em>, <em>nm=16</em>, <em>rm=32</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.zmodes" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the vertical modes of a model</p>
<p>nm = 16 : number of modes
nr = 32 : number of radius
rm = 50 : max radius</p>
<p>return</p>
<p>r : the radius used
m : the modes computed
m1 : the matrix of the amplitude
m2 : the matrix of the phases</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.NbodyDefault.zprof">
<tt class="descname">zprof</tt><big>(</big><em>z=None</em>, <em>r=2.5</em>, <em>dr=0.5</em>, <em>nb=25</em>, <em>zm=5.0</em><big>)</big><a class="headerlink" href="#pNbody.NbodyDefault.zprof" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the z-profile in a vector for a given radius</p>
<p>!!! This routine works only if particles have equal masses !!!</p>
<p>z : bins in z (optional)
r : radius of the cut
dr : width in r of the cut
nb : number of bins (size of the output)
zm : maximal height</p>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="intro.html"
title="previous chapter">pNbody Reference</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="pnbody.html"
title="next chapter">pNbody Reference</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/tutorial.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="pnbody.html" title="pNbody Reference"
>next</a> |</li>
<li class="right" >
<a href="intro.html" title="pNbody Reference"
>previous</a> |</li>
<li><a href="index.html">pNbody v1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2011, revaz.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
</div>
</body>
</html>

Event Timeline