Skip to content

Commit

Permalink
docs: update sphinx python docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ACornuIGN committed Sep 30, 2024
1 parent 7056c6f commit 22f5220
Show file tree
Hide file tree
Showing 27 changed files with 963 additions and 39 deletions.
Binary file modified docs/sphinx/_build/doctrees/borea.geodesy.doctree
Binary file not shown.
Binary file modified docs/sphinx/_build/doctrees/borea.process.p_add_data.doctree
Binary file not shown.
Binary file modified docs/sphinx/_build/doctrees/borea.process.p_func.doctree
Binary file not shown.
Binary file modified docs/sphinx/_build/doctrees/borea.reader.doctree
Binary file not shown.
Binary file modified docs/sphinx/_build/doctrees/environment.pickle
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ <h1>Source code for borea.geodesy.transform_geodesy</h1><div class="highlight"><
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">import</span> <span class="nn">pyproj</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>


<span class="c1"># pylint: disable=too-many-instance-attributes</span>
Expand Down Expand Up @@ -466,7 +467,7 @@ <h1>Source code for borea.geodesy.transform_geodesy</h1><div class="highlight"><
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;The geoid has not been entered, &quot;</span>
<span class="s2">&quot;cannot transform z altitude to height.&quot;</span><span class="p">)</span> <span class="kn">from</span> <span class="nn">info</span>

<span class="k">if</span> <span class="n">new_z</span> <span class="o">==</span> <span class="n">np</span><span class="o">.</span><span class="n">inf</span><span class="p">:</span>
<span class="k">if</span> <span class="n">np</span><span class="o">.</span><span class="n">all</span><span class="p">(</span><span class="n">new_z</span> <span class="o">==</span> <span class="n">np</span><span class="o">.</span><span class="n">inf</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;out geoid&quot;</span><span class="p">)</span>
<span class="k">return</span> <span class="n">new_z</span></div>

Expand Down Expand Up @@ -498,6 +499,29 @@ <h1>Source code for borea.geodesy.transform_geodesy</h1><div class="highlight"><
<span class="k">if</span> <span class="n">np</span><span class="o">.</span><span class="n">all</span><span class="p">(</span><span class="n">new_z</span> <span class="o">==</span> <span class="n">np</span><span class="o">.</span><span class="n">inf</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;out geoid&quot;</span><span class="p">)</span>
<span class="k">return</span> <span class="n">new_z</span></div>


<div class="viewcode-block" id="TransformGeodesy.transform_pt_proj">
<a class="viewcode-back" href="../../../borea.geodesy.html#borea.geodesy.transform_geodesy.TransformGeodesy.transform_pt_proj">[docs]</a>
<span class="k">def</span> <span class="nf">transform_pt_proj</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">df_pt</span><span class="p">:</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">,</span> <span class="n">type_z_input</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">type_z_output</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Tranform the input projection to the output projection of points coordinates</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">type_z_input</span> <span class="ow">and</span> <span class="n">type_z_output</span><span class="p">:</span>
<span class="k">if</span> <span class="n">type_z_input</span> <span class="o">!=</span> <span class="n">type_z_output</span><span class="p">:</span>
<span class="k">if</span> <span class="n">type_z_output</span> <span class="o">==</span> <span class="s2">&quot;altitude&quot;</span><span class="p">:</span>
<span class="n">df_pt</span><span class="p">[</span><span class="s2">&quot;z&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">tranform_altitude</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="n">df_pt</span><span class="p">[</span><span class="s1">&#39;x&#39;</span><span class="p">],</span>
<span class="n">df_pt</span><span class="p">[</span><span class="s1">&#39;y&#39;</span><span class="p">],</span>
<span class="n">df_pt</span><span class="p">[</span><span class="s1">&#39;z&#39;</span><span class="p">]]))</span>
<span class="k">if</span> <span class="n">type_z_output</span> <span class="o">==</span> <span class="s2">&quot;height&quot;</span><span class="p">:</span>
<span class="n">df_pt</span><span class="p">[</span><span class="s2">&quot;z&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">tranform_height</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="n">df_pt</span><span class="p">[</span><span class="s1">&#39;x&#39;</span><span class="p">],</span>
<span class="n">df_pt</span><span class="p">[</span><span class="s1">&#39;y&#39;</span><span class="p">],</span>
<span class="n">df_pt</span><span class="p">[</span><span class="s1">&#39;z&#39;</span><span class="p">]]))</span>

<span class="n">df_pt</span><span class="p">[</span><span class="s2">&quot;x&quot;</span><span class="p">],</span> <span class="n">df_pt</span><span class="p">[</span><span class="s2">&quot;y&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">proj_to_proj_out</span><span class="p">(</span><span class="n">df_pt</span><span class="p">[</span><span class="s1">&#39;x&#39;</span><span class="p">],</span> <span class="n">df_pt</span><span class="p">[</span><span class="s1">&#39;y&#39;</span><span class="p">])</span>

<span class="k">return</span> <span class="n">df_pt</span></div>
</div>

</pre></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ <h1>Source code for borea.process.p_add_data.p_gen_param</h1><div class="highlig
<span class="sd">Args of parser for reading generals parameters</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">import</span> <span class="nn">argparse</span>
<span class="kn">import</span> <span class="nn">pyproj</span>
<span class="kn">from</span> <span class="nn">borea.worksite.worksite</span> <span class="kn">import</span> <span class="n">Worksite</span>
<span class="kn">from</span> <span class="nn">borea.process.p_add_data.p_proj</span> <span class="kn">import</span> <span class="n">args_proj_param</span><span class="p">,</span> <span class="n">process_args_proj_param</span>
<span class="kn">from</span> <span class="nn">borea.reader.reader_camera</span> <span class="kn">import</span> <span class="n">read_camera</span>


Expand All @@ -293,14 +293,7 @@ <h1>Source code for borea.process.p_add_data.p_gen_param</h1><div class="highlig
<span class="sd"> Returns:</span>
<span class="sd"> argsparse: Parser with argument.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">&#39;-e&#39;</span><span class="p">,</span> <span class="s1">&#39;--epsg&#39;</span><span class="p">,</span>
<span class="nb">type</span><span class="o">=</span><span class="nb">int</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s1">&#39;EPSG codifier number of the reference system used e.g. &quot;2154&quot;.&#39;</span><span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">&#39;-y&#39;</span><span class="p">,</span> <span class="s1">&#39;--pathgeoid&#39;</span><span class="p">,</span>
<span class="nb">type</span><span class="o">=</span><span class="nb">str</span><span class="p">,</span> <span class="n">nargs</span><span class="o">=</span><span class="s1">&#39;*&#39;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s1">&#39;Path to the pyproj GeoTIFF of the geoid e.g../test/data/geoid.tif&#39;</span>
<span class="sa">f</span><span class="s1">&#39; or they must be in </span><span class="si">{</span><span class="n">pyproj</span><span class="o">.</span><span class="n">datadir</span><span class="o">.</span><span class="n">get_data_dir</span><span class="p">()</span><span class="si">}</span><span class="s1"> and just&#39;</span>
<span class="s1">&#39; need name of file e.g. geoid.tif.&#39;</span><span class="p">)</span>
<span class="n">parser</span> <span class="o">=</span> <span class="n">args_proj_param</span><span class="p">(</span><span class="n">parser</span><span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">&#39;-c&#39;</span><span class="p">,</span> <span class="s1">&#39;--camera&#39;</span><span class="p">,</span>
<span class="nb">type</span><span class="o">=</span><span class="nb">str</span><span class="p">,</span> <span class="n">nargs</span><span class="o">=</span><span class="s1">&#39;*&#39;</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s1">&#39;Files paths of cameras (xml or txt).&#39;</span><span class="p">)</span>
Expand All @@ -313,15 +306,6 @@ <h1>Source code for borea.process.p_add_data.p_gen_param</h1><div class="highlig
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">&#39;-x&#39;</span><span class="p">,</span> <span class="s1">&#39;--approx_system&#39;</span><span class="p">,</span>
<span class="nb">type</span><span class="o">=</span><span class="nb">bool</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s2">&quot;To use an approximate system.&quot;</span><span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">&#39;--geog&#39;</span><span class="p">,</span> <span class="s1">&#39;--epsg_geographic&#39;</span><span class="p">,</span>
<span class="nb">type</span><span class="o">=</span><span class="nb">int</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s1">&#39;EPSG codifier number of the reference geographic system.&#39;</span><span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">&#39;--geoc&#39;</span><span class="p">,</span> <span class="s1">&#39;--epsg_geocentric&#39;</span><span class="p">,</span>
<span class="nb">type</span><span class="o">=</span><span class="nb">int</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s1">&#39;EPSG codifier number of the reference geocentric system.&#39;</span><span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">&#39;--oe&#39;</span><span class="p">,</span> <span class="s1">&#39;--epsg_output&#39;</span><span class="p">,</span>
<span class="nb">type</span><span class="o">=</span><span class="nb">int</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s2">&quot;Code epsg of output Data&quot;</span><span class="p">)</span>
<span class="k">return</span> <span class="n">parser</span></div>


Expand All @@ -340,11 +324,7 @@ <h1>Source code for borea.process.p_add_data.p_gen_param</h1><div class="highlig
<span class="sd"> Worksite: data</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># Add a projection to the worksite</span>
<span class="k">if</span> <span class="n">args</span><span class="o">.</span><span class="n">epsg</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">work</span><span class="o">.</span><span class="n">set_proj</span><span class="p">([</span><span class="n">args</span><span class="o">.</span><span class="n">epsg</span><span class="p">,</span> <span class="n">args</span><span class="o">.</span><span class="n">geog</span><span class="p">,</span> <span class="n">args</span><span class="o">.</span><span class="n">geoc</span><span class="p">],</span> <span class="n">args</span><span class="o">.</span><span class="n">pathgeoid</span><span class="p">,</span> <span class="n">args</span><span class="o">.</span><span class="n">oe</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Projection set-up with EPSG:</span><span class="si">{</span><span class="n">args</span><span class="o">.</span><span class="n">epsg</span><span class="si">}</span><span class="s2">.&quot;</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;There is no given projection.&quot;</span><span class="p">)</span>
<span class="n">work</span> <span class="o">=</span> <span class="n">process_args_proj_param</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="n">work</span><span class="p">)</span>

<span class="c1"># Reading camera file</span>
<span class="k">if</span> <span class="n">args</span><span class="o">.</span><span class="n">camera</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
Expand Down
Loading

0 comments on commit 22f5220

Please sign in to comment.