-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e645553
Showing
65 changed files
with
19,581 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<!DOCTYPE html> | ||
|
||
<html lang="en" data-content_root="../"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Overview: module code — SARvey 1.0.0 documentation</title> | ||
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" /> | ||
<link rel="stylesheet" type="text/css" href="../_static/classic.css?v=def86cc0" /> | ||
<link rel="stylesheet" type="text/css" href="../_static/custom.css?v=86cf1cd6" /> | ||
|
||
<script src="../_static/documentation_options.js?v=8d563738"></script> | ||
<script src="../_static/doctools.js?v=9a2dae69"></script> | ||
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script> | ||
|
||
<link rel="index" title="Index" href="../genindex.html" /> | ||
<link rel="search" title="Search" href="../search.html" /> | ||
</head><body> | ||
<div class="related" role="navigation" aria-label="Related"> | ||
<h3>Navigation</h3> | ||
<ul> | ||
<li class="right" style="margin-right: 10px"> | ||
<a href="../genindex.html" title="General Index" | ||
accesskey="I">index</a></li> | ||
<li class="right" > | ||
<a href="../py-modindex.html" title="Python Module Index" | ||
>modules</a> |</li> | ||
<li class="nav-item nav-item-0"><a href="../index.html">SARvey 1.0.0 documentation</a> »</li> | ||
<li class="nav-item nav-item-this"><a href="">Overview: module code</a></li> | ||
</ul> | ||
</div> | ||
|
||
<div class="document"> | ||
<div class="documentwrapper"> | ||
<div class="bodywrapper"> | ||
<div class="body" role="main"> | ||
|
||
<h1>All modules for which code is available</h1> | ||
<ul><li><a href="sarvey/coherence.html">sarvey.coherence</a></li> | ||
<li><a href="sarvey/console.html">sarvey.console</a></li> | ||
<li><a href="sarvey/densification.html">sarvey.densification</a></li> | ||
<li><a href="sarvey/filtering.html">sarvey.filtering</a></li> | ||
<li><a href="sarvey/geolocation.html">sarvey.geolocation</a></li> | ||
<li><a href="sarvey/ifg_network.html">sarvey.ifg_network</a></li> | ||
<li><a href="sarvey/objects.html">sarvey.objects</a></li> | ||
<li><a href="sarvey/osm_utils.html">sarvey.osm_utils</a></li> | ||
<li><a href="sarvey/preparation.html">sarvey.preparation</a></li> | ||
<li><a href="sarvey/sarvey_mask.html">sarvey.sarvey_mask</a></li> | ||
<li><a href="sarvey/sarvey_osm.html">sarvey.sarvey_osm</a></li> | ||
<li><a href="sarvey/triangulation.html">sarvey.triangulation</a></li> | ||
<li><a href="sarvey/unwrapping.html">sarvey.unwrapping</a></li> | ||
<li><a href="sarvey/utils.html">sarvey.utils</a></li> | ||
<li><a href="sarvey/viewer.html">sarvey.viewer</a></li> | ||
</ul> | ||
|
||
<div class="clearer"></div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="sphinxsidebar" role="navigation" aria-label="Main"> | ||
<div class="sphinxsidebarwrapper"> | ||
<search id="searchbox" style="display: none" role="search"> | ||
<h3 id="searchlabel">Quick search</h3> | ||
<div class="searchformwrapper"> | ||
<form class="search" action="../search.html" method="get"> | ||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/> | ||
<input type="submit" value="Go" /> | ||
</form> | ||
</div> | ||
</search> | ||
<script>document.getElementById('searchbox').style.display = "block"</script> | ||
</div> | ||
</div> | ||
<div class="clearer"></div> | ||
</div> | ||
<div class="related" role="navigation" aria-label="Related"> | ||
<h3>Navigation</h3> | ||
<ul> | ||
<li class="right" style="margin-right: 10px"> | ||
<a href="../genindex.html" title="General Index" | ||
>index</a></li> | ||
<li class="right" > | ||
<a href="../py-modindex.html" title="Python Module Index" | ||
>modules</a> |</li> | ||
<li class="nav-item nav-item-0"><a href="../index.html">SARvey 1.0.0 documentation</a> »</li> | ||
<li class="nav-item nav-item-this"><a href="">Overview: module code</a></li> | ||
</ul> | ||
</div> | ||
<div class="footer" role="contentinfo"> | ||
© Copyright 2024, IPI - Leibniz Universitaet Hannover. | ||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.4.4. | ||
</div> | ||
</body> | ||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,187 @@ | ||
<!DOCTYPE html> | ||
|
||
<html lang="en" data-content_root="../../"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>sarvey.geolocation — SARvey 1.0.0 documentation</title> | ||
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" /> | ||
<link rel="stylesheet" type="text/css" href="../../_static/classic.css?v=def86cc0" /> | ||
<link rel="stylesheet" type="text/css" href="../../_static/custom.css?v=86cf1cd6" /> | ||
|
||
<script src="../../_static/documentation_options.js?v=8d563738"></script> | ||
<script src="../../_static/doctools.js?v=9a2dae69"></script> | ||
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script> | ||
|
||
<link rel="index" title="Index" href="../../genindex.html" /> | ||
<link rel="search" title="Search" href="../../search.html" /> | ||
</head><body> | ||
<div class="related" role="navigation" aria-label="Related"> | ||
<h3>Navigation</h3> | ||
<ul> | ||
<li class="right" style="margin-right: 10px"> | ||
<a href="../../genindex.html" title="General Index" | ||
accesskey="I">index</a></li> | ||
<li class="right" > | ||
<a href="../../py-modindex.html" title="Python Module Index" | ||
>modules</a> |</li> | ||
<li class="nav-item nav-item-0"><a href="../../index.html">SARvey 1.0.0 documentation</a> »</li> | ||
<li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Module code</a> »</li> | ||
<li class="nav-item nav-item-this"><a href="">sarvey.geolocation</a></li> | ||
</ul> | ||
</div> | ||
|
||
<div class="document"> | ||
<div class="documentwrapper"> | ||
<div class="bodywrapper"> | ||
<div class="body" role="main"> | ||
|
||
<h1>Source code for sarvey.geolocation</h1><div class="highlight"><pre> | ||
<span></span><span class="ch">#!/usr/bin/env python</span> | ||
|
||
<span class="c1"># SARvey - A multitemporal InSAR time series tool for the derivation of displacements.</span> | ||
<span class="c1">#</span> | ||
<span class="c1"># Copyright (C) 2021-2024 Andreas Piter (IPI Hannover, [email protected])</span> | ||
<span class="c1">#</span> | ||
<span class="c1"># This software was developed together with FERN.Lab ([email protected]) in the context</span> | ||
<span class="c1"># of the SAR4Infra project with funds of the German Federal Ministry for Digital and</span> | ||
<span class="c1"># Transport and contributions from Landesamt fuer Vermessung und Geoinformation</span> | ||
<span class="c1"># Schleswig-Holstein and Landesbetrieb Strassenbau und Verkehr Schleswig-Holstein.</span> | ||
<span class="c1">#</span> | ||
<span class="c1"># This program is free software: you can redistribute it and/or modify it under</span> | ||
<span class="c1"># the terms of the GNU General Public License as published by the Free Software</span> | ||
<span class="c1"># Foundation, either version 3 of the License, or (at your option) any later</span> | ||
<span class="c1"># version.</span> | ||
<span class="c1">#</span> | ||
<span class="c1"># Important: This package uses PyMaxFlow. The core of PyMaxflows library is the C++</span> | ||
<span class="c1"># implementation by Vladimir Kolmogorov. It is also licensed under the GPL, but it REQUIRES that you</span> | ||
<span class="c1"># cite [BOYKOV04] (see LICENSE) in any resulting publication if you use this code for research purposes.</span> | ||
<span class="c1"># This requirement extends to SARvey.</span> | ||
<span class="c1">#</span> | ||
<span class="c1"># This program is distributed in the hope that it will be useful, but WITHOUT</span> | ||
<span class="c1"># ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS</span> | ||
<span class="c1"># FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more</span> | ||
<span class="c1"># details.</span> | ||
<span class="c1">#</span> | ||
<span class="c1"># You should have received a copy of the GNU Lesser General Public License along</span> | ||
<span class="c1"># with this program. If not, see <https://www.gnu.org/licenses/>.</span> | ||
|
||
<span class="sd">"""Module for correcting the geolocation of the scatterers."""</span> | ||
<span class="kn">import</span> <span class="nn">logging</span> | ||
<span class="kn">from</span> <span class="nn">os.path</span> <span class="kn">import</span> <span class="n">join</span> | ||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> | ||
|
||
<span class="kn">from</span> <span class="nn">miaplpy.objects.slcStack</span> <span class="kn">import</span> <span class="n">slcStack</span> | ||
|
||
<span class="kn">from</span> <span class="nn">sarvey.objects</span> <span class="kn">import</span> <span class="n">Points</span> | ||
|
||
|
||
<div class="viewcode-block" id="getHeading"> | ||
<a class="viewcode-back" href="../../sarvey.html#sarvey.geolocation.getHeading">[docs]</a> | ||
<span class="k">def</span> <span class="nf">getHeading</span><span class="p">(</span><span class="n">input_path</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">logger</span><span class="p">:</span> <span class="n">logging</span><span class="o">.</span><span class="n">Logger</span><span class="p">):</span> | ||
<span class="w"> </span><span class="sd">"""</span> | ||
<span class="sd"> Read heading angle from slcStack.h5.</span> | ||
|
||
<span class="sd"> Parameters</span> | ||
<span class="sd"> ----------</span> | ||
<span class="sd"> input_path: str</span> | ||
<span class="sd"> Path to directory containing 'slcStack.h5' and 'geometryRadar.h5'.</span> | ||
<span class="sd"> logger: Logger</span> | ||
<span class="sd"> Logger handle</span> | ||
|
||
<span class="sd"> Returns</span> | ||
<span class="sd"> -------</span> | ||
<span class="sd"> heading_angle: float</span> | ||
<span class="sd"> heading angle of the satellite in radians</span> | ||
<span class="sd"> for ascending ~ -12*pi/180</span> | ||
<span class="sd"> for descending ~ 190*pi/180</span> | ||
<span class="sd"> """</span> | ||
<span class="c1"># get heading from slcStack.h5</span> | ||
<span class="n">slc_stack_file</span> <span class="o">=</span> <span class="n">join</span><span class="p">(</span><span class="n">input_path</span><span class="p">,</span> <span class="s1">'slcStack.h5'</span><span class="p">)</span> | ||
<span class="n">slc_stack_obj</span> <span class="o">=</span> <span class="n">slcStack</span><span class="p">(</span><span class="n">slc_stack_file</span><span class="p">)</span> | ||
<span class="k">try</span><span class="p">:</span> | ||
<span class="n">meta_dict</span> <span class="o">=</span> <span class="n">slc_stack_obj</span><span class="o">.</span><span class="n">get_metadata</span><span class="p">()</span> | ||
<span class="n">lower_case_meta_dict</span> <span class="o">=</span> <span class="p">{</span><span class="n">k</span><span class="o">.</span><span class="n">lower</span><span class="p">():</span> <span class="n">v</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">meta_dict</span><span class="o">.</span><span class="n">items</span><span class="p">()}</span> | ||
|
||
<span class="n">heading_angle</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">lower_case_meta_dict</span><span class="p">[</span><span class="s2">"heading"</span><span class="p">])</span> | ||
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="n">msg</span><span class="o">=</span><span class="sa">f</span><span class="s2">"Heading_angle of satellite: </span><span class="si">{</span><span class="n">heading_angle</span><span class="si">}</span><span class="s2"> deg"</span><span class="p">)</span> | ||
<span class="n">heading_angle</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">deg2rad</span><span class="p">(</span><span class="n">heading_angle</span><span class="p">)</span> | ||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">exc</span><span class="p">:</span> | ||
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="sa">f</span><span class="s1">'Failed to retrieve heading angle from </span><span class="si">{</span><span class="n">slc_stack_file</span><span class="si">}</span><span class="s1">: </span><span class="si">{</span><span class="n">exc</span><span class="si">}</span><span class="s1">'</span><span class="p">)</span> | ||
<span class="k">raise</span> <span class="ne">Exception</span> | ||
<span class="k">return</span> <span class="n">heading_angle</span></div> | ||
|
||
|
||
|
||
<div class="viewcode-block" id="calculateGeolocationCorrection"> | ||
<a class="viewcode-back" href="../../sarvey.html#sarvey.geolocation.calculateGeolocationCorrection">[docs]</a> | ||
<span class="k">def</span> <span class="nf">calculateGeolocationCorrection</span><span class="p">(</span><span class="o">*</span><span class="p">,</span> <span class="n">path_geom</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">point_obj</span><span class="p">:</span> <span class="n">Points</span><span class="p">,</span> <span class="n">demerr</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">logger</span><span class="p">:</span> <span class="n">logging</span><span class="o">.</span><span class="n">Logger</span><span class="p">):</span> | ||
<span class="w"> </span><span class="sd">"""</span> | ||
<span class="sd"> Calculate geolocation correction.</span> | ||
|
||
<span class="sd"> Parameters</span> | ||
<span class="sd"> ----------</span> | ||
<span class="sd"> path_geom: str</span> | ||
<span class="sd"> Path to directory containing 'slcStack.h5' or 'geometryRadar.h5'.</span> | ||
<span class="sd"> point_obj: Points</span> | ||
<span class="sd"> Point object with incidence angle for points</span> | ||
<span class="sd"> demerr: np.array</span> | ||
<span class="sd"> Array of dem error per pixel</span> | ||
<span class="sd"> logger: Logger</span> | ||
<span class="sd"> Logger handle</span> | ||
|
||
<span class="sd"> Returns</span> | ||
<span class="sd"> -------</span> | ||
<span class="sd"> coord_correction: np.array</span> | ||
<span class="sd"> array of geolocation corrections, two columns [x_correction, y_correction] per point.</span> | ||
<span class="sd"> """</span> | ||
<span class="n">heading_angle</span> <span class="o">=</span> <span class="n">getHeading</span><span class="p">(</span><span class="n">input_path</span><span class="o">=</span><span class="n">path_geom</span><span class="p">,</span> <span class="n">logger</span><span class="o">=</span><span class="n">logger</span><span class="p">)</span> | ||
|
||
<span class="n">coord_correction</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">zeros_like</span><span class="p">(</span><span class="n">point_obj</span><span class="o">.</span><span class="n">coord_xy</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="nb">float</span><span class="p">)</span> | ||
<span class="n">coord_correction</span><span class="p">[:,</span> <span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="n">demerr</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">cos</span><span class="p">(</span><span class="n">heading_angle</span><span class="p">)</span> <span class="o">/</span> <span class="n">np</span><span class="o">.</span><span class="n">tan</span><span class="p">(</span><span class="n">point_obj</span><span class="o">.</span><span class="n">loc_inc</span><span class="p">)</span> | ||
<span class="n">coord_correction</span><span class="p">[:,</span> <span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="o">-</span><span class="n">demerr</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sin</span><span class="p">(</span><span class="n">heading_angle</span><span class="p">)</span> <span class="o">/</span> <span class="n">np</span><span class="o">.</span><span class="n">tan</span><span class="p">(</span><span class="n">point_obj</span><span class="o">.</span><span class="n">loc_inc</span><span class="p">)</span> | ||
|
||
<span class="k">return</span> <span class="n">coord_correction</span></div> | ||
|
||
</pre></div> | ||
|
||
<div class="clearer"></div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="sphinxsidebar" role="navigation" aria-label="Main"> | ||
<div class="sphinxsidebarwrapper"> | ||
<search id="searchbox" style="display: none" role="search"> | ||
<h3 id="searchlabel">Quick search</h3> | ||
<div class="searchformwrapper"> | ||
<form class="search" action="../../search.html" method="get"> | ||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/> | ||
<input type="submit" value="Go" /> | ||
</form> | ||
</div> | ||
</search> | ||
<script>document.getElementById('searchbox').style.display = "block"</script> | ||
</div> | ||
</div> | ||
<div class="clearer"></div> | ||
</div> | ||
<div class="related" role="navigation" aria-label="Related"> | ||
<h3>Navigation</h3> | ||
<ul> | ||
<li class="right" style="margin-right: 10px"> | ||
<a href="../../genindex.html" title="General Index" | ||
>index</a></li> | ||
<li class="right" > | ||
<a href="../../py-modindex.html" title="Python Module Index" | ||
>modules</a> |</li> | ||
<li class="nav-item nav-item-0"><a href="../../index.html">SARvey 1.0.0 documentation</a> »</li> | ||
<li class="nav-item nav-item-1"><a href="../index.html" >Module code</a> »</li> | ||
<li class="nav-item nav-item-this"><a href="">sarvey.geolocation</a></li> | ||
</ul> | ||
</div> | ||
<div class="footer" role="contentinfo"> | ||
© Copyright 2024, IPI - Leibniz Universitaet Hannover. | ||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.4.4. | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.