Skip to content

Commit

Permalink
deploy: 31a8121
Browse files Browse the repository at this point in the history
  • Loading branch information
tomarnepedersen committed Dec 13, 2024
0 parents commit 4c98f29
Show file tree
Hide file tree
Showing 185 changed files with 29,386 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 3ef4fb1aa496aded3da200383724e853
tags: 645f666f9bcd5a90fca523b33c5a78b7
Empty file added .nojekyll
Empty file.
Binary file not shown.
118 changes: 118 additions & 0 deletions _modules/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Overview: module code &mdash; Traffic Generator 0.5.0 documentation</title>
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->

<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=1dd76d02"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
</head>

<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >



<a href="../index.html" class="icon icon-home">
Traffic Generator
</a>
<div class="version">
0.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usage.html">Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="../input_files.html">Input files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../authors.html">Authors</a></li>
<li class="toctree-l1"><a class="reference internal" href="../history.html">History</a></li>
<li class="toctree-l1"><a class="reference internal" href="../api.html">API Documentation</a></li>
</ul>

</div>
</div>
</nav>

<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">Traffic Generator</a>
</nav>

<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Overview: module code</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">

<h1>All modules for which code is available</h1>
<ul><li><a href="trafficgen/check_land_crossing.html">trafficgen.check_land_crossing</a></li>
<li><a href="trafficgen/encounter.html">trafficgen.encounter</a></li>
<li><a href="trafficgen/marine_system_simulator.html">trafficgen.marine_system_simulator</a></li>
<li><a href="trafficgen/plot_traffic_situation.html">trafficgen.plot_traffic_situation</a></li>
<li><a href="trafficgen/read_files.html">trafficgen.read_files</a></li>
<li><a href="trafficgen/ship_traffic_generator.html">trafficgen.ship_traffic_generator</a></li>
<li><a href="trafficgen/types.html">trafficgen.types</a></li>
<li><a href="trafficgen/utils.html">trafficgen.utils</a></li>
<li><a href="trafficgen/write_traffic_situation_to_file.html">trafficgen.write_traffic_situation_to_file</a></li>
</ul>

</div>
</div>
<footer>

<hr/>

<div role="contentinfo">
<p>&#169; Copyright 2024, DNV, Tom Arne Pedersen.</p>
</div>

Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.


</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>

</body>
</html>
158 changes: 158 additions & 0 deletions _modules/trafficgen/check_land_crossing.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>trafficgen.check_land_crossing &mdash; Traffic Generator 0.5.0 documentation</title>
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->

<script src="../../_static/jquery.js?v=5d32c60e"></script>
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../../_static/documentation_options.js?v=1dd76d02"></script>
<script src="../../_static/doctools.js?v=9a2dae69"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
</head>

<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >



<a href="../../index.html" class="icon icon-home">
Traffic Generator
</a>
<div class="version">
0.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../usage.html">Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../input_files.html">Input files</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../authors.html">Authors</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../history.html">History</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../api.html">API Documentation</a></li>
</ul>

</div>
</div>
</nav>

<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">Traffic Generator</a>
</nav>

<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="../index.html">Module code</a></li>
<li class="breadcrumb-item active">trafficgen.check_land_crossing</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">

<h1>Source code for trafficgen.check_land_crossing</h1><div class="highlight"><pre>
<span></span><span class="sd">&quot;&quot;&quot;Module with helper functions to determine if a generated path is crossing land.&quot;&quot;&quot;</span>

<span class="kn">from</span> <span class="nn">global_land_mask</span> <span class="kn">import</span> <span class="n">globe</span>
<span class="kn">from</span> <span class="nn">maritime_schema.types.caga</span> <span class="kn">import</span> <span class="n">Position</span>

<span class="kn">from</span> <span class="nn">trafficgen.utils</span> <span class="kn">import</span> <span class="n">calculate_position_at_certain_time</span><span class="p">,</span> <span class="n">rad_2_deg</span>


<div class="viewcode-block" id="path_crosses_land">
<a class="viewcode-back" href="../../trafficgen.check_land_crossing.html#trafficgen.check_land_crossing.path_crosses_land">[docs]</a>
<span class="k">def</span> <span class="nf">path_crosses_land</span><span class="p">(</span>
<span class="n">position_1</span><span class="p">:</span> <span class="n">Position</span><span class="p">,</span>
<span class="n">speed</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
<span class="n">course</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
<span class="n">lat_lon0</span><span class="p">:</span> <span class="n">Position</span><span class="p">,</span>
<span class="n">time_interval</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">300.0</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">bool</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Find if path is crossing land.</span>

<span class="sd"> Params:</span>
<span class="sd"> position_1: Ship position in latitude/longitude [rad].</span>
<span class="sd"> speed: Ship speed [m/s].</span>
<span class="sd"> course: Ship course [rad].</span>
<span class="sd"> lat_lon0: Reference point, latitudinal [rad] and longitudinal [rad].</span>
<span class="sd"> time_interval: The time interval the vessel should travel without crossing land [sec]</span>

<span class="sd"> Returns</span>
<span class="sd"> -------</span>
<span class="sd"> is_on_land: True if parts of the path crosses land.</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="n">num_checks</span> <span class="o">=</span> <span class="mi">10</span>
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="n">time_interval</span> <span class="o">/</span> <span class="n">num_checks</span><span class="p">)):</span>
<span class="n">position_2</span> <span class="o">=</span> <span class="n">calculate_position_at_certain_time</span><span class="p">(</span>
<span class="n">Position</span><span class="p">(</span><span class="n">latitude</span><span class="o">=</span><span class="n">position_1</span><span class="o">.</span><span class="n">latitude</span><span class="p">,</span> <span class="n">longitude</span><span class="o">=</span><span class="n">position_1</span><span class="o">.</span><span class="n">longitude</span><span class="p">),</span>
<span class="n">lat_lon0</span><span class="p">,</span>
<span class="n">speed</span><span class="p">,</span>
<span class="n">course</span><span class="p">,</span>
<span class="n">i</span> <span class="o">*</span> <span class="n">time_interval</span> <span class="o">/</span> <span class="n">num_checks</span><span class="p">,</span>
<span class="p">)</span>

<span class="n">lat</span> <span class="o">=</span> <span class="n">rad_2_deg</span><span class="p">(</span><span class="n">position_2</span><span class="o">.</span><span class="n">latitude</span><span class="p">)</span>
<span class="n">lon</span> <span class="o">=</span> <span class="n">rad_2_deg</span><span class="p">(</span><span class="n">position_2</span><span class="o">.</span><span class="n">longitude</span><span class="p">)</span>
<span class="k">if</span> <span class="n">globe</span><span class="o">.</span><span class="n">is_land</span><span class="p">(</span><span class="n">lat</span><span class="p">,</span> <span class="n">lon</span><span class="p">):</span> <span class="c1"># type: ignore (The package is unfortunately not typed.)</span>
<span class="k">return</span> <span class="kc">True</span>
<span class="k">return</span> <span class="kc">False</span></div>

</pre></div>

</div>
</div>
<footer>

<hr/>

<div role="contentinfo">
<p>&#169; Copyright 2024, DNV, Tom Arne Pedersen.</p>
</div>

Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.


</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>

</body>
</html>
Loading

0 comments on commit 4c98f29

Please sign in to comment.