Skip to content

Commit

Permalink
deploy: 3405cbe
Browse files Browse the repository at this point in the history
  • Loading branch information
eleanorfrajka committed Nov 20, 2024
1 parent d53b57b commit 5e03362
Show file tree
Hide file tree
Showing 17 changed files with 345 additions and 271 deletions.
Binary file modified _images/demo-output_10_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/demo-output_13_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/demo-output_16_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/demo-output_18_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/demo-output_23_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/demo-output_24_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/demo-output_25_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/demo-output_34_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/demo-output_36_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/demo-output_38_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/demo-output_9_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 49 additions & 18 deletions _modules/glidertest/plots.html

Large diffs are not rendered by default.

34 changes: 33 additions & 1 deletion _modules/glidertest/utilities.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ <h1>Source code for glidertest.utilities</h1><div class="highlight"><pre>
<span class="kn">from</span> <span class="nn">skyfield</span> <span class="kn">import</span> <span class="n">api</span>
<span class="kn">import</span> <span class="nn">gsw</span>
<span class="kn">import</span> <span class="nn">warnings</span>
<span class="kn">from</span> <span class="nn">matplotlib.dates</span> <span class="kn">import</span> <span class="n">DateFormatter</span>
<span class="kn">import</span> <span class="nn">matplotlib.dates</span> <span class="k">as</span> <span class="nn">mdates</span>


<span class="k">def</span> <span class="nf">_check_necessary_variables</span><span class="p">(</span><span class="n">ds</span><span class="p">:</span> <span class="n">xr</span><span class="o">.</span><span class="n">Dataset</span><span class="p">,</span> <span class="nb">vars</span><span class="p">:</span> <span class="nb">list</span><span class="p">):</span>
Expand Down Expand Up @@ -118,7 +120,37 @@ <h1>Source code for glidertest.utilities</h1><div class="highlight"><pre>
<span class="n">ds</span><span class="p">[</span><span class="s1">&#39;DENSITY&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="s1">&#39;N_MEASUREMENTS&#39;</span><span class="p">,</span> <span class="n">gsw</span><span class="o">.</span><span class="n">rho</span><span class="p">(</span><span class="n">SA</span><span class="p">,</span> <span class="n">CT</span><span class="p">,</span> <span class="n">ds</span><span class="o">.</span><span class="n">DEPTH</span><span class="p">)</span><span class="o">.</span><span class="n">values</span><span class="p">)</span>
<span class="k">return</span> <span class="n">ds</span>


<span class="k">def</span> <span class="nf">_time_axis_formatter</span><span class="p">(</span><span class="n">ax</span><span class="p">,</span> <span class="n">ds</span><span class="p">,</span> <span class="n">format_x_axis</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
<span class="n">start_time</span> <span class="o">=</span> <span class="n">ds</span><span class="o">.</span><span class="n">TIME</span><span class="o">.</span><span class="n">min</span><span class="p">()</span><span class="o">.</span><span class="n">values</span>
<span class="n">end_time</span> <span class="o">=</span> <span class="n">ds</span><span class="o">.</span><span class="n">TIME</span><span class="o">.</span><span class="n">max</span><span class="p">()</span><span class="o">.</span><span class="n">values</span>
<span class="k">if</span> <span class="p">(</span><span class="n">end_time</span> <span class="o">-</span> <span class="n">start_time</span><span class="p">)</span> <span class="o">&lt;</span> <span class="n">np</span><span class="o">.</span><span class="n">timedelta64</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="s1">&#39;D&#39;</span><span class="p">):</span>
<span class="n">formatter</span> <span class="o">=</span> <span class="n">DateFormatter</span><span class="p">(</span><span class="s1">&#39;%H:%M&#39;</span><span class="p">)</span>
<span class="n">locator</span> <span class="o">=</span> <span class="n">mdates</span><span class="o">.</span><span class="n">HourLocator</span><span class="p">(</span><span class="n">interval</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>
<span class="n">start_date</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">to_datetime</span><span class="p">(</span><span class="n">start_time</span><span class="p">)</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s1">&#39;%Y-%b-</span><span class="si">%d</span><span class="s1">&#39;</span><span class="p">)</span>
<span class="n">end_date</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">to_datetime</span><span class="p">(</span><span class="n">end_time</span><span class="p">)</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s1">&#39;%Y-%b-</span><span class="si">%d</span><span class="s1">&#39;</span><span class="p">)</span>
<span class="n">xlabel</span> <span class="o">=</span> <span class="sa">f</span><span class="s1">&#39;Time [UTC] (</span><span class="si">{</span><span class="n">start_date</span><span class="si">}</span><span class="s1">)&#39;</span> <span class="k">if</span> <span class="n">start_date</span> <span class="o">==</span> <span class="n">end_date</span> <span class="k">else</span> <span class="sa">f</span><span class="s1">&#39;Time [UTC] (</span><span class="si">{</span><span class="n">start_date</span><span class="si">}</span><span class="s1"> to </span><span class="si">{</span><span class="n">end_date</span><span class="si">}</span><span class="s1">)&#39;</span>
<span class="k">elif</span> <span class="p">(</span><span class="n">end_time</span> <span class="o">-</span> <span class="n">start_time</span><span class="p">)</span> <span class="o">&lt;</span> <span class="n">np</span><span class="o">.</span><span class="n">timedelta64</span><span class="p">(</span><span class="mi">7</span><span class="p">,</span> <span class="s1">&#39;D&#39;</span><span class="p">):</span>
<span class="n">formatter</span> <span class="o">=</span> <span class="n">DateFormatter</span><span class="p">(</span><span class="s1">&#39;</span><span class="si">%d</span><span class="s1">-%b&#39;</span><span class="p">)</span>
<span class="n">locator</span> <span class="o">=</span> <span class="n">mdates</span><span class="o">.</span><span class="n">DayLocator</span><span class="p">(</span><span class="n">interval</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
<span class="n">start_date</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">to_datetime</span><span class="p">(</span><span class="n">start_time</span><span class="p">)</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s1">&#39;%Y-%b-</span><span class="si">%d</span><span class="s1">&#39;</span><span class="p">)</span>
<span class="n">end_date</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">to_datetime</span><span class="p">(</span><span class="n">end_time</span><span class="p">)</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s1">&#39;%Y-%b-</span><span class="si">%d</span><span class="s1">&#39;</span><span class="p">)</span>
<span class="n">xlabel</span> <span class="o">=</span> <span class="sa">f</span><span class="s1">&#39;Time [UTC] (</span><span class="si">{</span><span class="n">start_date</span><span class="si">}</span><span class="s1">)&#39;</span> <span class="k">if</span> <span class="n">start_date</span> <span class="o">==</span> <span class="n">end_date</span> <span class="k">else</span> <span class="sa">f</span><span class="s1">&#39;Time [UTC] (</span><span class="si">{</span><span class="n">start_date</span><span class="si">}</span><span class="s1"> to </span><span class="si">{</span><span class="n">end_date</span><span class="si">}</span><span class="s1">)&#39;</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">formatter</span> <span class="o">=</span> <span class="n">DateFormatter</span><span class="p">(</span><span class="s1">&#39;</span><span class="si">%d</span><span class="s1">-%b&#39;</span><span class="p">)</span>
<span class="n">locator</span> <span class="o">=</span> <span class="kc">None</span>
<span class="n">xlabel</span> <span class="o">=</span> <span class="s1">&#39;Time [UTC]&#39;</span>

<span class="k">if</span> <span class="n">format_x_axis</span><span class="p">:</span>
<span class="n">ax</span><span class="o">.</span><span class="n">xaxis</span><span class="o">.</span><span class="n">set_major_formatter</span><span class="p">(</span><span class="n">formatter</span><span class="p">)</span>
<span class="k">if</span> <span class="n">locator</span><span class="p">:</span>
<span class="n">ax</span><span class="o">.</span><span class="n">xaxis</span><span class="o">.</span><span class="n">set_major_locator</span><span class="p">(</span><span class="n">locator</span><span class="p">)</span>
<span class="n">ax</span><span class="o">.</span><span class="n">set_xlabel</span><span class="p">(</span><span class="n">xlabel</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">ax</span><span class="o">.</span><span class="n">yaxis</span><span class="o">.</span><span class="n">set_major_formatter</span><span class="p">(</span><span class="n">formatter</span><span class="p">)</span>
<span class="k">if</span> <span class="n">locator</span><span class="p">:</span>
<span class="n">ax</span><span class="o">.</span><span class="n">yaxis</span><span class="o">.</span><span class="n">set_major_locator</span><span class="p">(</span><span class="n">locator</span><span class="p">)</span>
<span class="n">ax</span><span class="o">.</span><span class="n">set_ylabel</span><span class="p">(</span><span class="n">xlabel</span><span class="p">)</span>

<div class="viewcode-block" id="construct_2dgrid">
<a class="viewcode-back" href="../../glidertest.html#glidertest.utilities.construct_2dgrid">[docs]</a>
<span class="k">def</span> <span class="nf">construct_2dgrid</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">v</span><span class="p">,</span> <span class="n">xi</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">yi</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span>
Expand Down
243 changes: 122 additions & 121 deletions _sources/demo-output.ipynb.txt

Large diffs are not rendered by default.

27 changes: 18 additions & 9 deletions demo-output.html

Large diffs are not rendered by default.

243 changes: 122 additions & 121 deletions demo-output.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit 5e03362

Please sign in to comment.