mirror of
https://github.com/Unidata/python-awips.git
synced 2025-02-23 14:57:56 -05:00
deploy: 5b9b4956f0
This commit is contained in:
parent
bb30645786
commit
ddd4c00fd1
3 changed files with 15 additions and 21 deletions
|
@ -305,11 +305,8 @@ the maps database called **state**. We can take the results from that
|
||||||
filter and get a geographic **envelope** based on the Florida polygon
|
filter and get a geographic **envelope** based on the Florida polygon
|
||||||
that was returned from the previous cell.
|
that was returned from the previous cell.
|
||||||
|
|
||||||
.. container:: alert-warning
|
Warning: Without such a filter you may be requesting many tens of
|
||||||
|
thousands of records.
|
||||||
::
|
|
||||||
|
|
||||||
<b>Note:</b> Without such a filter you may be requesting many tens of thousands of records.
|
|
||||||
|
|
||||||
.. code:: ipython3
|
.. code:: ipython3
|
||||||
|
|
||||||
|
@ -357,11 +354,9 @@ Both the METAR and Synoptic datasets should be filtered by time to avoid
|
||||||
requesting an unreasonable amount of data. By defining one filter now,
|
requesting an unreasonable amount of data. By defining one filter now,
|
||||||
we can use it in both of their data requests to EDEX.
|
we can use it in both of their data requests to EDEX.
|
||||||
|
|
||||||
.. container:: alert-info
|
Note: Here we will use the most recent hour as our default filter.
|
||||||
|
Try adjusting the timerange and see the difference in the final
|
||||||
::
|
plots.
|
||||||
|
|
||||||
<b>Note:</b> Here we will use the most recent hour as our default filter. Try adjusting the timerange and see the difference in the final plots.
|
|
||||||
|
|
||||||
.. code:: ipython3
|
.. code:: ipython3
|
||||||
|
|
||||||
|
|
|
@ -380,11 +380,10 @@ and Synoptic data requests.</p>
|
||||||
the maps database called <strong>state</strong>. We can take the results from that
|
the maps database called <strong>state</strong>. We can take the results from that
|
||||||
filter and get a geographic <strong>envelope</strong> based on the Florida polygon
|
filter and get a geographic <strong>envelope</strong> based on the Florida polygon
|
||||||
that was returned from the previous cell.</p>
|
that was returned from the previous cell.</p>
|
||||||
<div class="alert-warning docutils container">
|
<blockquote>
|
||||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o"><</span><span class="n">b</span><span class="o">></span><span class="n">Note</span><span class="p">:</span><span class="o"></</span><span class="n">b</span><span class="o">></span> <span class="n">Without</span> <span class="n">such</span> <span class="n">a</span> <span class="nb">filter</span> <span class="n">you</span> <span class="n">may</span> <span class="n">be</span> <span class="n">requesting</span> <span class="n">many</span> <span class="n">tens</span> <span class="n">of</span> <span class="n">thousands</span> <span class="n">of</span> <span class="n">records</span><span class="o">.</span>
|
<div><p>Warning: Without such a filter you may be requesting many tens of
|
||||||
</pre></div>
|
thousands of records.</p>
|
||||||
</div>
|
</div></blockquote>
|
||||||
</div>
|
|
||||||
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># Append each geometry to a numpy array</span>
|
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># Append each geometry to a numpy array</span>
|
||||||
<span class="n">states</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([])</span>
|
<span class="n">states</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([])</span>
|
||||||
<span class="k">for</span> <span class="n">ob</span> <span class="ow">in</span> <span class="n">maps_response</span><span class="p">:</span>
|
<span class="k">for</span> <span class="n">ob</span> <span class="ow">in</span> <span class="n">maps_response</span><span class="p">:</span>
|
||||||
|
@ -426,11 +425,11 @@ that was returned from the previous cell.</p>
|
||||||
<p>Both the METAR and Synoptic datasets should be filtered by time to avoid
|
<p>Both the METAR and Synoptic datasets should be filtered by time to avoid
|
||||||
requesting an unreasonable amount of data. By defining one filter now,
|
requesting an unreasonable amount of data. By defining one filter now,
|
||||||
we can use it in both of their data requests to EDEX.</p>
|
we can use it in both of their data requests to EDEX.</p>
|
||||||
<div class="alert-info docutils container">
|
<blockquote>
|
||||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o"><</span><span class="n">b</span><span class="o">></span><span class="n">Note</span><span class="p">:</span><span class="o"></</span><span class="n">b</span><span class="o">></span> <span class="n">Here</span> <span class="n">we</span> <span class="n">will</span> <span class="n">use</span> <span class="n">the</span> <span class="n">most</span> <span class="n">recent</span> <span class="n">hour</span> <span class="k">as</span> <span class="n">our</span> <span class="n">default</span> <span class="nb">filter</span><span class="o">.</span> <span class="n">Try</span> <span class="n">adjusting</span> <span class="n">the</span> <span class="n">timerange</span> <span class="ow">and</span> <span class="n">see</span> <span class="n">the</span> <span class="n">difference</span> <span class="ow">in</span> <span class="n">the</span> <span class="n">final</span> <span class="n">plots</span><span class="o">.</span>
|
<div><p>Note: Here we will use the most recent hour as our default filter.
|
||||||
</pre></div>
|
Try adjusting the timerange and see the difference in the final
|
||||||
</div>
|
plots.</p>
|
||||||
</div>
|
</div></blockquote>
|
||||||
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># Filter for the last hour</span>
|
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># Filter for the last hour</span>
|
||||||
<span class="n">lastHourDateTime</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">utcnow</span><span class="p">()</span> <span class="o">-</span> <span class="n">timedelta</span><span class="p">(</span><span class="n">minutes</span> <span class="o">=</span> <span class="mi">60</span><span class="p">)</span>
|
<span class="n">lastHourDateTime</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">utcnow</span><span class="p">()</span> <span class="o">-</span> <span class="n">timedelta</span><span class="p">(</span><span class="n">minutes</span> <span class="o">=</span> <span class="mi">60</span><span class="p">)</span>
|
||||||
<span class="n">start</span> <span class="o">=</span> <span class="n">lastHourDateTime</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s1">'%Y-%m-</span><span class="si">%d</span><span class="s1"> %H:%M:%S'</span><span class="p">)</span>
|
<span class="n">start</span> <span class="o">=</span> <span class="n">lastHourDateTime</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s1">'%Y-%m-</span><span class="si">%d</span><span class="s1"> %H:%M:%S'</span><span class="p">)</span>
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue