Skip to content
Snippets Groups Projects
Commit 460c75e4 authored by Olivier Bertrand's avatar Olivier Bertrand
Browse files

Scene is now a member of database and doc has been formatted for it

parent 3a0cf7f1
No related branches found
No related tags found
No related merge requests found
Showing
with 72 additions and 13 deletions
No preview for this file type
No preview for this file type
No preview for this file type
doc/build/html/_images/contrast_weighted_nearness.png

221 KiB | W: | H:

doc/build/html/_images/contrast_weighted_nearness.png

221 KiB | W: | H:

doc/build/html/_images/contrast_weighted_nearness.png
doc/build/html/_images/contrast_weighted_nearness.png
doc/build/html/_images/contrast_weighted_nearness.png
doc/build/html/_images/contrast_weighted_nearness.png
  • 2-up
  • Swipe
  • Onion skin
doc/build/html/_images/michelson_contrast.png

264 KiB | W: | H:

doc/build/html/_images/michelson_contrast.png

264 KiB | W: | H:

doc/build/html/_images/michelson_contrast.png
doc/build/html/_images/michelson_contrast.png
doc/build/html/_images/michelson_contrast.png
doc/build/html/_images/michelson_contrast.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -40,10 +40,10 @@
<div class="body" role="main">
<h1>All modules for which code is available</h1>
<ul><li><a href="navipy/processing.html">navipy.processing</a></li>
<ul><li><a href="navipy/processing/mcode.html">navipy.processing.mcode</a></li>
<ul><li><a href="navipy/database.html">navipy.database</a></li>
<li><a href="navipy/processing/mcode.html">navipy.processing.mcode</a></li>
<li><a href="navipy/processing/pcode.html">navipy.processing.pcode</a></li>
</ul></ul>
</ul>
</div>
</div>
......
......@@ -2,3 +2,6 @@ Database
========
.. automodule:: navipy.database
.. autoclass:: navipy.database.DataBaseLoad
:members:
......@@ -5,9 +5,6 @@ Processing a scene
Place code
----------
Scene
~~~~~
.. autofunction:: navipy.processing.pcode.scene
Skyline
~~~~~~~
......
......@@ -93,6 +93,64 @@
<img alt="_images/load_image_rowid.png" src="_images/load_image_rowid.png" />
</div>
</div>
<dl class="class">
<dt id="navipy.database.DataBaseLoad">
<em class="property">class </em><code class="descclassname">navipy.database.</code><code class="descname">DataBaseLoad</code><span class="sig-paren">(</span><em>filename, channels=['R', 'G', 'B', 'D']</em><span class="sig-paren">)</span><a class="headerlink" href="#navipy.database.DataBaseLoad" title="Permalink to this definition"></a></dt>
<dd><p>A database generated by the rendering module is based on sqlite3.</p>
<dl class="attribute">
<dt id="navipy.database.DataBaseLoad.create">
<code class="descname">create</code><a class="headerlink" href="#navipy.database.DataBaseLoad.create" title="Permalink to this definition"></a></dt>
<dd><p>use to decide weather to alter the database or not
return False because we do not want
to write on database (Load class)</p>
</dd></dl>
<dl class="method">
<dt id="navipy.database.DataBaseLoad.iter_posorients">
<code class="descname">iter_posorients</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#navipy.database.DataBaseLoad.iter_posorients" title="Permalink to this definition"></a></dt>
<dd><p>Iter through all position orientation in the database</p>
</dd></dl>
<dl class="attribute">
<dt id="navipy.database.DataBaseLoad.posorients">
<code class="descname">posorients</code><a class="headerlink" href="#navipy.database.DataBaseLoad.posorients" title="Permalink to this definition"></a></dt>
<dd><p>Return the position orientations of all points in the database</p>
</dd></dl>
<dl class="method">
<dt id="navipy.database.DataBaseLoad.scene">
<code class="descname">scene</code><span class="sig-paren">(</span><em>posorient=None</em>, <em>rowid=None</em><span class="sig-paren">)</span><a class="headerlink" href="#navipy.database.DataBaseLoad.scene" title="Permalink to this definition"></a></dt>
<dd><p>Return a scene at a position orientation or given rowid in a given database.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>database</strong> – a DataBaseLoad class :param posorient: a pandas Series with index: [‘x’,’y’,’z’,’alpha_0,’alpha_1,’alpha_2’] (default None, i.e. not used)</li>
<li><strong>rowid</strong> – a row identification integer for directly reading in the database (default None, i.e. not used).</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">a scene [elevation, azimuth, channel, 1] or [ommatidia,channel,1].</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">np.ndarray</p>
</td>
</tr>
</tbody>
</table>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">my_scene</span> <span class="o">=</span> <span class="n">mydb</span><span class="o">.</span><span class="n">scene</span><span class="p">(</span><span class="n">rowid</span><span class="o">=</span><span class="n">rowid</span><span class="p">)</span>
</pre></div>
</div>
<p>(<a class="reference external" href="./example/database/scene.py">Source code</a>, <a class="reference external" href="./example/database/scene.png">png</a>, <a class="reference external" href="./example/database/scene.hires.png">hires.png</a>, <a class="reference external" href="./example/database/scene.pdf">pdf</a>)</p>
<div class="figure">
<img alt="_images/scene.png" src="_images/scene.png" />
</div>
</dd></dl>
</dd></dl>
</div>
......
No preview for this file type
......@@ -11,7 +11,7 @@ mydb = DataBaseLoad(mydb_filename)
# 2) Define the position-orinetation at which
# we want the image
rowid = 12
my_scene = processing.pcode.scene(mydb, rowid=rowid)
my_scene = mydb.scene(rowid=rowid)
my_apcv = processing.pcode.apcv(my_scene, mydb.viewing_directions)
my_apcv_sph = processing.tools.cartesian_to_spherical(x=my_apcv[..., 0],
......
doc/build/html/example/processing/contrast_weighted_nearness.hires.png

338 KiB | W: | H:

doc/build/html/example/processing/contrast_weighted_nearness.hires.png

338 KiB | W: | H:

doc/build/html/example/processing/contrast_weighted_nearness.hires.png
doc/build/html/example/processing/contrast_weighted_nearness.hires.png
doc/build/html/example/processing/contrast_weighted_nearness.hires.png
doc/build/html/example/processing/contrast_weighted_nearness.hires.png
  • 2-up
  • Swipe
  • Onion skin
No preview for this file type
doc/build/html/example/processing/contrast_weighted_nearness.png

221 KiB | W: | H:

doc/build/html/example/processing/contrast_weighted_nearness.png

221 KiB | W: | H:

doc/build/html/example/processing/contrast_weighted_nearness.png
doc/build/html/example/processing/contrast_weighted_nearness.png
doc/build/html/example/processing/contrast_weighted_nearness.png
doc/build/html/example/processing/contrast_weighted_nearness.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -11,7 +11,7 @@ mydb = DataBaseLoad(mydb_filename)
# 2) Define the position-orinetation at which
# we want the image
rowid = 12
my_scene = processing.pcode.scene(mydb, rowid=rowid)
my_scene = mydb.scene(rowid=rowid)
my_contrast = processing.pcode.contrast_weighted_nearness(my_scene)
f, axarr = plt.subplots(2, 2, figsize=(15, 8))
......
doc/build/html/example/processing/michelson_contrast.hires.png

391 KiB | W: | H:

doc/build/html/example/processing/michelson_contrast.hires.png

391 KiB | W: | H:

doc/build/html/example/processing/michelson_contrast.hires.png
doc/build/html/example/processing/michelson_contrast.hires.png
doc/build/html/example/processing/michelson_contrast.hires.png
doc/build/html/example/processing/michelson_contrast.hires.png
  • 2-up
  • Swipe
  • Onion skin
No preview for this file type
doc/build/html/example/processing/michelson_contrast.png

264 KiB | W: | H:

doc/build/html/example/processing/michelson_contrast.png

264 KiB | W: | H:

doc/build/html/example/processing/michelson_contrast.png
doc/build/html/example/processing/michelson_contrast.png
doc/build/html/example/processing/michelson_contrast.png
doc/build/html/example/processing/michelson_contrast.png
  • 2-up
  • Swipe
  • Onion skin
import matplotlib.pyplot as plt
from navipy.database import DataBaseLoad
import navipy.processing as processing
import os
import pkg_resources
# 1) Connect to the database
mydb_filename = os.path.abspath('../database.db')
mydb_filename = pkg_resources.resource_filename(
'navipy', 'resources/database.db')
mydb = DataBaseLoad(mydb_filename)
# 2) Define the position-orinetation at which
# we want the image
rowid = 12
my_scene = processing.scene(mydb, rowid=rowid)
my_contrast = processing.michelson_contrast(my_scene)
my_scene = mydb.scene(rowid=rowid)
my_contrast = processing.pcode.michelson_contrast(my_scene)
f, axarr = plt.subplots(2, 2, figsize=(15, 8))
axarr = axarr.flatten()
......
......@@ -11,5 +11,5 @@ mydb = DataBaseLoad(mydb_filename)
# 2) Define the position-orinetation at which
# we want the image
rowid = 12
my_scene = processing.pcode.scene(mydb, rowid=rowid)
my_scene = mydb.scene(rowid=rowid)
my_pcv = processing.pcode.pcv(my_scene, mydb.viewing_directions)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment