<spanid="the-main-module"></span><h1>the main module<aclass="headerlink"href="#module-pNbody.main"title="Permalink to this headline">¶</a></h1>
<dlclass="function">
<dtid="pNbody.main.Nbody">
<ttclass="descclassname">pNbody.main.</tt><ttclass="descname">Nbody</tt><big>(</big><em>*arg</em>, <em>**kw</em><big>)</big><aclass="headerlink"href="#pNbody.main.Nbody"title="Permalink to this definition">¶</a></dt>
<dd><p>The aim of this function is simply to return to the right class</p>
</dd></dl>
<dlclass="class">
<dtid="pNbody.main.NbodyDefault">
<emclass="property">class </em><ttclass="descclassname">pNbody.main.</tt><ttclass="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>, <em>unitsfile=None</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault"title="Permalink to this definition">¶</a></dt>
<dd><p>This is the reference Nbody class.</p>
<p>This is the constructor for the <strong>Nbody</strong> object. Optional arguments are:</p>
<dlclass="docutils">
<dt>p_name <spanclass="classifier-delimiter">:</span><spanclass="classifier">name of the file</span></dt>
<dd>in case of multiple files, files must be included in a list [“file1”,”file2”]</dd>
</dl>
<p>pos : positions (3xN array)
vel : positions (3xN array)
mass : positions (1x array)
num : id of particles (1xN array)
tpe : type of particles (1xN array)</p>
<p>ftype : type of input file (binary,ascii)</p>
<dlclass="docutils">
<dt>status <spanclass="classifier-delimiter">:</span><spanclass="classifier">‘old’</span><spanclass="classifier-delimiter">:</span><spanclass="classifier">open an old file</span></dt>
<dd>‘new’ : create a new object</dd>
</dl>
<p>byteorder : ‘little’ or ‘big’
pio : parallel io : ‘yes’ or ‘no’</p>
<p>local : True=local object, False=global object (paralellized) Not implemeted Yet</p>
<p>log : log file</p>
<p>unitsfile : define the type of units</p>
<p>by default this class initialize the following variables :</p>
<blockquote>
<div><p>self.p_name : name of the file(s) to read or write</p>
<p>self.pos : array of positions
self.vel : array of velocities
self.mass : array of masses
self.num : array of id
self.tpe : array of types</p>
<p>self.ftype : type of the file
self.status : object status (‘old’ or ‘new’)
self.byteorder : byter order (‘little’ or ‘big’)
self.pio : parallel io (‘yes’ or ‘no’)
self.log : log object</p>
<p># new variables</p>
<p>self.nbody : local number of particles
self.nbody_tot : total number of particles
self.mass_tot : total mass
self.npart : number of particles of each type
self.npart_tot : total number of particles of each type
self.spec_vars : dictionary of variables specific for the format used
self.spec_vect : dictionary of vector specific for the format used</p>
</div></blockquote>
<pclass="rubric">Methods</p>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.A">
<ttclass="descname">A</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.Accel">
<ttclass="descname">Accel</tt><big>(</big><em>x</em>, <em>eps</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.CombiMap">
<ttclass="descname">CombiMap</tt><big>(</big><em>*arg</em>, <em>**kw</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<ttclass="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><aclass="headerlink"href="#pNbody.main.NbodyDefault.ComputeDensityAndHsml"title="Permalink to this definition">¶</a></dt>
<dd><p>Compute Density and Hsml (for a specific place)</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.ComputeHisto">
<ttclass="descname">ComputeHisto</tt><big>(</big><em>bins</em>, <em>mode</em>, <em>space</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.ComputeHisto"title="Permalink to this definition">¶</a></dt>
<dd><p>Compute and histogram</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.ComputeMap">
<ttclass="descname">ComputeMap</tt><big>(</big><em>*arg</em>, <em>**kw</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<ttclass="descname">ComputeMeanHisto</tt><big>(</big><em>bins</em>, <em>mode1</em>, <em>space</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.ComputeMeanHisto"title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the mean map of an observable.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.ComputeMeanMap">
<ttclass="descname">ComputeMeanMap</tt><big>(</big><em>*arg</em>, <em>**kw</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.ComputeMeanMap"title="Permalink to this definition">¶</a></dt>
<ttclass="descname">ComputeObjectMap</tt><big>(</big><em>*arg</em>, <em>**kw</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.ComputeObjectMap"title="Permalink to this definition">¶</a></dt>
<dd><ulclass="simple">
<li><ulclass="first">
<li><ulclass="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>
<ttclass="descname">ComputeSigmaHisto</tt><big>(</big><em>bins</em>, <em>mode1</em>, <em>mode2</em>, <em>space</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.ComputeSigmaHisto"title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the histogram of an observable.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.ComputeSigmaMap">
<ttclass="descname">ComputeSigmaMap</tt><big>(</big><em>*arg</em>, <em>**kw</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.ComputeSigmaMap"title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the sigma map of an observable.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.ComputeSph">
<ttclass="descname">ComputeSph</tt><big>(</big><em>DesNumNgb=None</em>, <em>MaxNumNgbDeviation=None</em>, <em>Tree=None</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.ComputeSph"title="Permalink to this definition">¶</a></dt>
<dd><p>Compute self.Density and self.Hsml using sph approximation</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.Ekin">
<ttclass="descname">Ekin</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.Ekin"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the total kinetic energy</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.Epot">
<ttclass="descname">Epot</tt><big>(</big><em>eps</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<ttclass="descname">ExchangeParticles</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.ExchangeParticles"title="Permalink to this definition">¶</a></dt>
<dd><p>Exchange particles betwee procs, using peano-hilbert decomposition computed in ptree</p>
<ttclass="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><aclass="headerlink"href="#pNbody.main.NbodyDefault.Get_Velocities_From_Virial_Approximation"title="Permalink to this definition">¶</a></dt>
<dd><p>does not work well</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.InitSpec">
<ttclass="descname">InitSpec</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.InitSpec"title="Permalink to this definition">¶</a></dt>
<dd><p>This function allows to initialize specific parameters.
<ttclass="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><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.L">
<ttclass="descname">L</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.Ltot">
<ttclass="descname">Ltot</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.Lum">
<ttclass="descname">Lum</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.Map">
<ttclass="descname">Map</tt><big>(</big><em>*arg</em>, <em>**kw</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.Map"title="Permalink to this definition">¶</a></dt>
<dd><p>Return 2 final images (float and int)</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.MeanWeight">
<ttclass="descname">MeanWeight</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.Mr_Spherical">
<ttclass="descname">Mr_Spherical</tt><big>(</big><em>nr=25</em>, <em>rmin=0</em>, <em>rmax=50</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.Ne">
<ttclass="descname">Ne</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.P">
<ttclass="descname">P</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.Pot">
<ttclass="descname">Pot</tt><big>(</big><em>x</em>, <em>eps</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.R">
<ttclass="descname">R</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.Rho">
<ttclass="descname">Rho</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.S">
<ttclass="descname">S</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.SendAllToAll">
<ttclass="descname">SendAllToAll</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.SphEvaluate">
<ttclass="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><aclass="headerlink"href="#pNbody.main.NbodyDefault.SphEvaluate"title="Permalink to this definition">¶</a></dt>
<dd><p>Return an sph evaluation of the variable var</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.T">
<ttclass="descname">T</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.Tcool">
<ttclass="descname">Tcool</tt><big>(</big><em>coolingfile=None</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.Tmu">
<ttclass="descname">Tmu</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.TreeAccel">
<ttclass="descname">TreeAccel</tt><big>(</big><em>pos</em>, <em>eps</em>, <em>Tree=None</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.TreePot">
<ttclass="descname">TreePot</tt><big>(</big><em>pos</em>, <em>eps</em>, <em>Tree=None</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.U">
<ttclass="descname">U</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.Vr">
<ttclass="descname">Vr</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.Vt">
<ttclass="descname">Vt</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.Vz">
<ttclass="descname">Vz</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.Vz"title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array containing z velocity</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.align">
<ttclass="descname">align</tt><big>(</big><em>axis</em>, <em>mode='a'</em>, <em>sgn='+'</em>, <em>fact=None</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.align"title="Permalink to this definition">¶</a></dt>
<dd><p>Rotate the object in order to align the axis ‘axis’ with the z axis.</p>
<p>axis : [x,y,z]
mode : ‘p’ : only position</p>
<blockquote>
<div>‘v’ : only velocities
‘a’ : both (default)</div></blockquote>
<ttclass="descname">align_with_main_axis</tt><big>(</big><em>mode='a'</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.align_with_main_axis"title="Permalink to this definition">¶</a></dt>
<dd><p>Rotate the object in order to align it’s major axis with
the axis of its inertial tensor.</p>
<dlclass="docutils">
<dt>mode <spanclass="classifier-delimiter">:</span><spanclass="classifier">‘p’</span><spanclass="classifier-delimiter">:</span><spanclass="classifier">only position </span></dt>
<dd>‘v’ : only velocities
‘a’ : both (default)</dd>
</dl>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.append">
<ttclass="descname">append</tt><big>(</big><em>solf</em>, <em>do_not_sort=False</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.append"title="Permalink to this definition">¶</a></dt>
<dd><p>Add to the current N-body object, particles form the
N-body object “new”.</p>
<p>solf : Nbody object</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.cart2sph">
<ttclass="descname">cart2sph</tt><big>(</big><em>pos=None</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.check_arrays">
<ttclass="descname">check_arrays</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.cm">
<ttclass="descname">cm</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.cmcenter">
<ttclass="descname">cmcenter</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.cv">
<ttclass="descname">cv</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.cvcenter">
<ttclass="descname">cvcenter</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.cvcenter"title="Permalink to this definition">¶</a></dt>
<dd><p>Center the center of velocities at the origin.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.dens">
<ttclass="descname">dens</tt><big>(</big><em>r=None</em>, <em>nb=25</em>, <em>rm=50</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.display">
<ttclass="descname">display</tt><big>(</big><em>*arg</em>, <em>**kw</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.display"title="Permalink to this definition">¶</a></dt>
<dd><p>Display the model</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.dmodes">
<ttclass="descname">dmodes</tt><big>(</big><em>nr=32</em>, <em>nm=16</em>, <em>rm=32</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.dv_mean">
<ttclass="descname">dv_mean</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.dv_mean"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the average relative speed between particles.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.dx_mean">
<ttclass="descname">dx_mean</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.dx_mean"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the average distance between particles.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.ekin">
<ttclass="descname">ekin</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.ekin"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the total specific kinetic energy</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.epot">
<ttclass="descname">epot</tt><big>(</big><em>eps</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.expose">
<ttclass="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><aclass="headerlink"href="#pNbody.main.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 : ‘right’ or ‘left’
dist_eye : distance between eyes (separation = angle)
space : pos or vel
foc : focal</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.find_vars">
<ttclass="descname">find_vars</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.gather_mass">
<ttclass="descname">gather_mass</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.gather_num">
<ttclass="descname">gather_num</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.gather_pos">
<ttclass="descname">gather_pos</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.gather_vec">
<ttclass="descname">gather_vec</tt><big>(</big><em>vec</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.gather_vel">
<ttclass="descname">gather_vel</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.gather_vel"title="Permalink to this definition">¶</a></dt>
<dd><p>Gather in a unique array all velocites of all nodes.</p>
<ttclass="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><aclass="headerlink"href="#pNbody.main.NbodyDefault.getAccelerationInCylindricalGrid"title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the Acceleration in cells of a cylindrical grid</p>
<ttclass="descname">getNumberParticlesInCylindricalGrid</tt><big>(</big><em>Rmax</em>, <em>nr=32</em>, <em>nt=32</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.getNumberParticlesInCylindricalGrid"title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the number of particles in cells of a cylindrical grid</p>
<ttclass="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><aclass="headerlink"href="#pNbody.main.NbodyDefault.getPotentialInCylindricalGrid"title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the potential in cells of a cylindrical grid</p>
<ttclass="descname">getRadialVelocityDispersionInCylindricalGrid</tt><big>(</big><em>Rmax</em>, <em>nr=32</em>, <em>nt=32</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.getRadialVelocityDispersionInCylindricalGrid"title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the radial velocity dispersion in cells of a cylindrical grid</p>
<ttclass="descname">getRadiusInCylindricalGrid</tt><big>(</big><em>z</em>, <em>Rmax</em>, <em>nr=32</em>, <em>nt=32</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.getRadiusInCylindricalGrid"title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the radius in cells of a cylindrical grid</p>
<ttclass="descname">getSurfaceDensityInCylindricalGrid</tt><big>(</big><em>Rmax</em>, <em>nr=32</em>, <em>nt=32</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.getSurfaceDensityInCylindricalGrid"title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the surface density in cells of a cylindrical grid</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.getTree">
<ttclass="descname">getTree</tt><big>(</big><em>force_computation=False</em>, <em>ErrTolTheta=0.80000000000000004</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.getTree"title="Permalink to this definition">¶</a></dt>
<ttclass="descname">get_default_spec_vars</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.get_default_spec_vars"title="Permalink to this definition">¶</a></dt>
<dd><p>return specific variables default values for the class</p>
<ttclass="descname">get_default_spec_vect</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.get_histocenter">
<ttclass="descname">get_histocenter</tt><big>(</big><em>rbox=50</em>, <em>nb=500</em><big>)</big><aclass="headerlink"href="#pNbody.main.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 “histocenter”.</p>
<ttclass="descname">get_histocenter2</tt><big>(</big><em>rbox=50</em>, <em>nb=64</em><big>)</big><aclass="headerlink"href="#pNbody.main.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 “histocenter”.</p>
<ttclass="descname">get_list_of_array</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.get_list_of_array"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the list of numpy vectors of size nbody.</p>
<ttclass="descname">get_list_of_method</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.get_list_of_method"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the list of instance methods (functions).</p>
<ttclass="descname">get_list_of_vars</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.get_mass_tot">
<ttclass="descname">get_mass_tot</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.get_mass_tot"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the total mass of system.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.get_mxntpe">
<ttclass="descname">get_mxntpe</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.get_mxntpe"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the max number of type for this format</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.get_nbody">
<ttclass="descname">get_nbody</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.get_nbody"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the local number of particles.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.get_nbody_tot">
<ttclass="descname">get_nbody_tot</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.get_nbody_tot"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the total number of particles.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.get_npart">
<ttclass="descname">get_npart</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.get_npart_all">
<ttclass="descname">get_npart_all</tt><big>(</big><em>npart_tot</em>, <em>NTask</em><big>)</big><aclass="headerlink"href="#pNbody.main.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
<ttclass="descname">get_npart_and_npart_all</tt><big>(</big><em>npart</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.get_npart_tot">
<ttclass="descname">get_npart_tot</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.get_ns">
<ttclass="descname">get_ns</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.get_ntype">
<ttclass="descname">get_ntype</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.get_ntype"title="Permalink to this definition">¶</a></dt>
<dd><p>return the number of paticles types</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.get_num">
<ttclass="descname">get_num</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<ttclass="descname">get_rotation_matrix_to_align_with_main_axis</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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’s main axis with the axis of its inertial tensor.</p>
<ttclass="descname">get_rsp_approximation</tt><big>(</big><em>DesNumNgb=None</em>, <em>MaxNumNgbDeviation=None</em>, <em>Tree=None</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.getindex">
<ttclass="descname">getindex</tt><big>(</big><em>num</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.has_array">
<ttclass="descname">has_array</tt><big>(</big><em>name</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.has_var">
<ttclass="descname">has_var</tt><big>(</big><em>name</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.hdcenter">
<ttclass="descname">hdcenter</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.histocenter">
<ttclass="descname">histocenter</tt><big>(</big><em>rbox=50</em>, <em>nb=500</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.histocenter2">
<ttclass="descname">histocenter2</tt><big>(</big><em>rbox=50</em>, <em>nb=64</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.histovel">
<ttclass="descname">histovel</tt><big>(</big><em>nb=100</em>, <em>vmin=None</em>, <em>vmax=None</em>, <em>mode='n'</em><big>)</big><aclass="headerlink"href="#pNbody.main.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 : ‘n’ (norme of the velocities)</p>
<ttclass="descname">inertial_tensor</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.inertial_tensor"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the inertial tensor.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.info">
<ttclass="descname">info</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.info"title="Permalink to this definition">¶</a></dt>
<dd><p>Write info</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.init">
<ttclass="descname">init</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.init"title="Permalink to this definition">¶</a></dt>
<dd><p>Initialize normal and specific class variables</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.init_units">
<ttclass="descname">init_units</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.init_units"title="Permalink to this definition">¶</a></dt>
<dd><p>This function is responsible for the units initialization.</p>
<p>It will create :</p>
<blockquote>
<div><p>self.unitsparameters</p>
<blockquote>
<div><dlclass="docutils">
<dt>that contains parameters like </dt>
<dd><ulclass="first last simple">
<li>the hydrogen mass fraction,</li>
<li>the metalicity ionisation flag</li>
<li>the adiabatic index</li>
<li>...</li>
</ul>
</dd>
</dl>
</div></blockquote>
</div></blockquote>
<p>and</p>
<blockquote>
<div><p>self.localsystem_of_units</p>
<blockquote>
<div><p>a UnitSystem object that really defines the system of units
in the Nbody object. It uses the values :</p>
<blockquote>
<div>UnitLength_in_cm
UnitMass_in_g
UnitVelocity_in_cm_per_s</div></blockquote>
</div></blockquote>
</div></blockquote>
<p>All physical values computed in pNbody should use self.localsystem_of_units to
be converted in other units.
self.unitsparameters is usefull if other parameters needs to be known, like
the adiabatic index, etc.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.l">
<ttclass="descname">l</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.ltot">
<ttclass="descname">ltot</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.ltot"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the specific total angular momentum.
<ttclass="descname">make_default_vars_global</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.make_default_vars_global"title="Permalink to this definition">¶</a></dt>
<dd><p>Make specific variables global</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.mdens">
<ttclass="descname">mdens</tt><big>(</big><em>r=None</em>, <em>nb=25</em>, <em>rm=50</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.memory_info">
<ttclass="descname">memory_info</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.minert">
<ttclass="descname">minert</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.minert"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the diagonal of the intertial momentum.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.mr">
<ttclass="descname">mr</tt><big>(</big><em>r=None</em>, <em>nb=25</em>, <em>rm=50</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.msdens">
<ttclass="descname">msdens</tt><big>(</big><em>r=None</em>, <em>nb=25</em>, <em>rm=50</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.nodes_info">
<ttclass="descname">nodes_info</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.nodes_info"title="Permalink to this definition">¶</a></dt>
<dd><p>Write info on nodes</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.object_info">
<ttclass="descname">object_info</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.object_info"title="Permalink to this definition">¶</a></dt>
<dd><p>Write class(object) info</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.open_and_read">
<ttclass="descname">open_and_read</tt><big>(</big><em>name</em>, <em>readfct</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.open_and_write">
<ttclass="descname">open_and_write</tt><big>(</big><em>name</em>, <em>writefct</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.phi_xy">
<ttclass="descname">phi_xy</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.phi_xyz">
<ttclass="descname">phi_xyz</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.print_filenames">
<ttclass="descname">print_filenames</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.print_filenames"title="Permalink to this definition">¶</a></dt>
<dd><p>Print files names</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.r">
<ttclass="descname">r</tt><big>(</big><em>center=None</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.read">
<ttclass="descname">read</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.read"title="Permalink to this definition">¶</a></dt>
<dd><p>Read the particle file(s)</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.read_num">
<ttclass="descname">read_num</tt><big>(</big><em>name</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.real_numngb">
<ttclass="descname">real_numngb</tt><big>(</big><em>num</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.real_numngb"title="Permalink to this definition">¶</a></dt>
<dd><p>number of particles wor wich r<h</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.rebox">
<ttclass="descname">rebox</tt><big>(</big><em>boxsize=None</em>, <em>mode=None</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="docutils">
<dt>boxsize <spanclass="classifier-delimiter">:</span><spanclass="classifier">size of the box</span></dt>
<dd>if boxsize is not defined, we try first to see if self.boxsize
is defined.</dd>
<dt>mode <spanclass="classifier-delimiter">:</span><spanclass="classifier">type of reboxing</span></dt>
<dd>None : -> [0,boxsize]
centred : -> [-boxsize/2,boxsize/2]
[x,y,z] :</dd>
</dl>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.redistribute">
<ttclass="descname">redistribute</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.reduc">
<ttclass="descname">reduc</tt><big>(</big><em>n</em>, <em>mass=False</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.rename">
<ttclass="descname">rename</tt><big>(</big><em>p_name=None</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.rename"title="Permalink to this definition">¶</a></dt>
<dd><p>Rename the files</p>
<p>p_name : new name(s)</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.rotate">
<ttclass="descname">rotate</tt><big>(</big><em>angle=0, axis=[1, 0, 0], point=[0, 0, 0], mode='a'</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="docutils">
<dt>mode <spanclass="classifier-delimiter">:</span><spanclass="classifier">‘p’</span><spanclass="classifier-delimiter">:</span><spanclass="classifier">rotate only position</span></dt>
<dd>‘v’ : rotate only velocities
‘a’ : rotate both (default)</dd>
</dl>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.rotateR">
<ttclass="descname">rotateR</tt><big>(</big><em>R</em>, <em>mode='a'</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.rotateR"title="Permalink to this definition">¶</a></dt>
<dd><p>Rotate the model using the matrix R</p>
<dlclass="docutils">
<dt>mode <spanclass="classifier-delimiter">:</span><spanclass="classifier">‘p’</span><spanclass="classifier-delimiter">:</span><spanclass="classifier">only position </span></dt>
<dd>‘v’ : only velocities
‘a’ : both (default)</dd>
</dl>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.rotate_old">
<ttclass="descname">rotate_old</tt><big>(</big><em>angle=0</em>, <em>mode='a'</em>, <em>axis='x'</em><big>)</big><aclass="headerlink"href="#pNbody.main.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 : ‘x’ : around x</p>
<blockquote>
<div><blockquote>
<div>‘y’ : around y
‘z’ : around z</div></blockquote>
<p>: [x,y,z] : around this axis</p>
</div></blockquote>
<dlclass="docutils">
<dt>mode <spanclass="classifier-delimiter">:</span><spanclass="classifier">‘p’</span><spanclass="classifier-delimiter">:</span><spanclass="classifier">rotate only position</span></dt>
<dd>‘v’ : rotate only velocities
‘a’ : rotate both (default)</dd>
</dl>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.rxy">
<ttclass="descname">rxy</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.rxyz">
<ttclass="descname">rxyz</tt><big>(</big><em>center=None</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.sdens">
<ttclass="descname">sdens</tt><big>(</big><em>r=None</em>, <em>nb=25</em>, <em>rm=50</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.select">
<ttclass="descname">select</tt><big>(</big><em>i=0</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.selectc">
<ttclass="descname">selectc</tt><big>(</big><em>c</em>, <em>local=False</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.selecti">
<ttclass="descname">selecti</tt><big>(</big><em>i</em>, <em>local=False</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.selecti"title="Permalink to this definition">¶</a></dt>
<dd><p>Return an N-body object that contain only particles having
their index (not id) in i.</p>
<p>i : vector containing indexes
local : local selection (True) or global selection (False)</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.selectp">
<ttclass="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><aclass="headerlink"href="#pNbody.main.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’s is given either by lst (nx1 int array) or
by the name (“file”) of a file containing the list of id’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>
<dlclass="docutils">
<dt>frum_num <spanclass="classifier-delimiter">:</span><spanclass="classifier">if True, use self.num to select particules</span></dt>
<dd>if False, use arange(self.nbody)</dd>
</dl>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.set_filenames">
<ttclass="descname">set_filenames</tt><big>(</big><em>p_name</em>, <em>pio=None</em><big>)</big><aclass="headerlink"href="#pNbody.main.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 : ‘yes’ or ‘no’</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.set_ftype">
<ttclass="descname">set_ftype</tt><big>(</big><em>ftype='binary'</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.set_ftype"title="Permalink to this definition">¶</a></dt>
<ttclass="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><aclass="headerlink"href="#pNbody.main.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>
<olclass="arabic">
<li><pclass="first">if nothing is given, we use self.unitsparameters to obtain these values</p>
</li>
<li><dlclass="first docutils">
<dt>if UnitLength_in_cm</dt>
<dd><pclass="first last">UnitVelocity_in_cm_per_s
UnitMass_in_g</p>
</dd>
</dl>
<p>are given, we use them</p>
</li>
</ol>
<dlclass="docutils">
<dt>2b) if UnitLength_in_cm,UnitVelocity_in_cm_per_s,UnitMass_in_g</dt>
<dd>are given in a dictionary</dd>
</dl>
<olclass="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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.set_npart">
<ttclass="descname">set_npart</tt><big>(</big><em>npart</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.set_parameters">
<ttclass="descname">set_parameters</tt><big>(</big><em>params</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.set_parameters"title="Permalink to this definition">¶</a></dt>
<dd><p>Set parameters for the class</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.set_pio">
<ttclass="descname">set_pio</tt><big>(</big><em>pio</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.set_pio"title="Permalink to this definition">¶</a></dt>
<dd><p>Set parallel input/output or not io</p>
<p>pio : ‘yes’ or ‘no’</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.set_tpe">
<ttclass="descname">set_tpe</tt><big>(</big><em>tpe</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.set_tpe"title="Permalink to this definition">¶</a></dt>
<ttclass="descname">set_unitsparameters</tt><big>(</big><em>unitsparams</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.set_unitsparameters"title="Permalink to this definition">¶</a></dt>
<dd><p>Set units parameters for the class.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.show">
<ttclass="descname">show</tt><big>(</big><em>*arg</em>, <em>**kw</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.show"title="Permalink to this definition">¶</a></dt>
<dd><p>Display the model
this is an alias to display</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.sigma">
<ttclass="descname">sigma</tt><big>(</big><em>r=None</em>, <em>nb=25.0</em>, <em>rm=50.0</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.sigma_vz">
<ttclass="descname">sigma_vz</tt><big>(</big><em>r=None</em>, <em>nb=25</em>, <em>rm=50</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.sigma_z">
<ttclass="descname">sigma_z</tt><big>(</big><em>r=None</em>, <em>nb=25</em>, <em>rm=50</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.size">
<ttclass="descname">size</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.size"title="Permalink to this definition">¶</a></dt>
<dd><p>Estimate the model size, using the inertial momentum</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.sort">
<ttclass="descname">sort</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.sort"title="Permalink to this definition">¶</a></dt>
<dd><p>sort particles according to their num variable</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.sort_type">
<ttclass="descname">sort_type</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.spec_info">
<ttclass="descname">spec_info</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.spec_info"title="Permalink to this definition">¶</a></dt>
<dd><p>Write specific info</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.sph2cart">
<ttclass="descname">sph2cart</tt><big>(</big><em>pos=None</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.spin">
<ttclass="descname">spin</tt><big>(</big><em>omega=None</em>, <em>L=None</em>, <em>j=None</em>, <em>E=None</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.spin"title="Permalink to this definition">¶</a></dt>
<dd><p>Spin the object with angular velocity “omega” (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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.sub">
<ttclass="descname">sub</tt><big>(</big><em>n1=0</em>, <em>n2=None</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.theta_xyz">
<ttclass="descname">theta_xyz</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.tork">
<ttclass="descname">tork</tt><big>(</big><em>acc</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.translate">
<ttclass="descname">translate</tt><big>(</big><em>dx</em>, <em>mode='p'</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.translate"title="Permalink to this definition">¶</a></dt>
<dd><p>Translate the positions or the velocities of the object.</p>
<ttclass="descname">usual_numngb</tt><big>(</big><em>num</em><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.usual_numngb"title="Permalink to this definition">¶</a></dt>
<dd><p>usual way to compute the number of neighbors</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.v_sigma">
<ttclass="descname">v_sigma</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.v_sigma"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the norm of the velocity dispersions.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.vel_cart2cyl">
<ttclass="descname">vel_cart2cyl</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.vel_cyl2cart">
<ttclass="descname">vel_cyl2cart</tt><big>(</big><em>pos=None</em>, <em>vel=None</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.vn">
<ttclass="descname">vn</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.vrxyz">
<ttclass="descname">vrxyz</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.vx">
<ttclass="descname">vx</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.vx"title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array containing x velocity</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.vy">
<ttclass="descname">vy</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.vy"title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array containing y velocity</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.vz">
<ttclass="descname">vz</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.vz"title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array containing z velocity</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.weighted_numngb">
<ttclass="descname">weighted_numngb</tt><big>(</big><em>num</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.write">
<ttclass="descname">write</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.write"title="Permalink to this definition">¶</a></dt>
<dd><p>Write the particle file(s)</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.write_num">
<ttclass="descname">write_num</tt><big>(</big><em>name</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.x">
<ttclass="descname">x</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.x"title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array containing x coordinate</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.x_sigma">
<ttclass="descname">x_sigma</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.x_sigma"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the norm of the position dispersions.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.y">
<ttclass="descname">y</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.y"title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array containing y coordinate</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.z">
<ttclass="descname">z</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.NbodyDefault.z"title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 1xn float array containing z coordinate</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.zmodes">
<ttclass="descname">zmodes</tt><big>(</big><em>nr=32</em>, <em>nm=16</em>, <em>rm=32</em><big>)</big><aclass="headerlink"href="#pNbody.main.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>
<dlclass="method">
<dtid="pNbody.main.NbodyDefault.zprof">
<ttclass="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><aclass="headerlink"href="#pNbody.main.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>
<dlclass="class">
<dtid="pNbody.main.Nbody_default">
<emclass="property">class </em><ttclass="descclassname">pNbody.main.</tt><ttclass="descname">Nbody_default</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>, <em>unitsfile=None</em><big>)</big><aclass="headerlink"href="#pNbody.main.Nbody_default"title="Permalink to this definition">¶</a></dt>
<dd><p>This class is usefull to create an empty Nbody object</p>
<pclass="rubric">Methods</p>
</dd></dl>
<dlclass="function">
<dtid="pNbody.main.get_known_formats">
<ttclass="descclassname">pNbody.main.</tt><ttclass="descname">get_known_formats</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.main.get_known_formats"title="Permalink to this definition">¶</a></dt>