Skip to content

Commit

Permalink
Merge pull request #586 from akrherz/231112-2
Browse files Browse the repository at this point in the history
Omnibus
  • Loading branch information
akrherz authored Nov 14, 2023
2 parents cdb86b5 + 91b0351 commit b928ce9
Show file tree
Hide file tree
Showing 8 changed files with 185 additions and 50 deletions.
2 changes: 2 additions & 0 deletions cgi-bin/request/coop.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ def do_century(cursor, ctx):
)
idxs = ["prec", "tmin", "tmax"]
for year in range(sts.year, ets.year + 1):
if year not in data:
continue
for idx in idxs:
sio.write(
(
Expand Down
5 changes: 5 additions & 0 deletions config/mesonet.inc
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@ RewriteRule ^/search /search.py [QSA]
RewriteRule pil_([A-Z0-9]{3,6}).png$ pil.php?pil=$1
</Directory>

<Directory "/opt/iem/htdocs/sites">
# Allow for python scripts to act has directories NETWORK/SID/TOOL
RewriteRule ^([^/]{3,20})/([^/]{3,20})/([^/]+)$ $3.py
</Directory>

<Directory "/opt/iem/htdocs/wx/afos">
RewriteRule ([0-9]{12})_([A-Z0-9\s]+).png$ text2png.py?e=$1&pil=$2 [B,L]
</Directory>
Expand Down
6 changes: 5 additions & 1 deletion htdocs/geojson/7am.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
from zoneinfo import ZoneInfo

from pyiem.exceptions import IncompleteWebRequest
from pyiem.reference import TRACE_VALUE
from pyiem.util import get_dbconnc, html_escape
from pyiem.webutil import iemapp
Expand Down Expand Up @@ -130,7 +131,10 @@ def application(environ, start_response):
group = environ.get("group", "coop")
cb = environ.get("callback", None)
dt = environ.get("dt", datetime.date.today().strftime("%Y-%m-%d"))
ts = datetime.datetime.strptime(dt, "%Y-%m-%d")
try:
ts = datetime.datetime.strptime(dt, "%Y-%m-%d")
except ValueError:
raise IncompleteWebRequest("dt variable should be in form YYYY-MM-DD")
ts = ts.replace(hour=12, tzinfo=ZoneInfo("UTC"))

mckey = f"/geojson/7am/{dt}/{group}"
Expand Down
2 changes: 1 addition & 1 deletion htdocs/plotting/auto/scripts/p19.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_description():
dict(
type="int",
name="binsize",
default="10",
default=1,
label="Histogram Bin Size:",
),
dict(
Expand Down
29 changes: 17 additions & 12 deletions htdocs/request/grx/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -83,28 +83,33 @@ rings specified at the given distance for a point.</p>
<p>
<table class="table table-striped">
<thead><tr><th>Title</th><th>Description</th></tr></thead>
<thead><tr><th>v3 Support</th><th>Title</th><th>Description</th></tr></thead>
<tr>
<td>No</td>
<th><a href="iadot_trucks.txt">Iowa DOT Truck Locations</a></th>
<td>https://mesonet.agron.iastate.edu/request/grx/iadot_trucks.txt<br />
<i>Notes:</i> Locations of Iowa DOT Snow Plows.</td>
</tr>
<tr>
<td>No</td>
<th><a href="roadcond.php">Iowa Winter Road Conditions</a></th>
<td>https://mesonet.agron.iastate.edu/request/grx/roadcond.php<br />
<i>Notes:</i> Observations provided by the Iowa State Patrol.</td>
</tr>
<tr>
<td>No</td>
<th><a href="asos.php">Iowa ASOS Data</a></th>
<td>https://mesonet.agron.iastate.edu/request/grx/asos.php<br />
<i>Notes:</i> none at this time</td>
</tr>
<tr>
<td>No</td>
<th><a href="rwis.php">Iowa RWIS Data</a></th>
<td>https://mesonet.agron.iastate.edu/request/grx/rwis.php<br />
<i>Notes:</i> Could use some data presentation improvements (TODO)</td>
</tr>
<tr>
<td>No</td>
<th><a href="webcams.php?overview">IEM Webcam Overview</a></th>
<td>https://mesonet.agron.iastate.edu/request/grx/webcams.php?overview<br />
<i>Notes:</i> This layer provides the locations and direction
Expand All @@ -113,20 +118,15 @@ individual network layers...</b> There aren't bandwidth concerns with this
layer.</td>
</tr>
<tr>
<td>No</td>
<th><a href="webcams.php?network=KCCI">KCCI-TV Webcams</a></th>
<td>https://mesonet.agron.iastate.edu/request/grx/webcams.php?network=KCCI<br />
<i>Notes:</i> You will not want to use this on a low bandwidth
connection as all of the webcam images are loaded every 1-5 minutes. Please
only use this layer when you are using the data! Thanks...</td>
</tr>
<tr>
<th><a href="webcams.php?network=KELO">KELO-TV Webcams</a></th>
<td>https://mesonet.agron.iastate.edu/request/grx/webcams.php?network=KELO<br />
<i>Notes:</i> You will not want to use this on a low bandwidth
connection as all of the webcam images are loaded every 1-5 minutes. Please
only use this layer when you are using the data! Thanks...</td>
</tr>
<tr>
<td>No</td>
<th><a href="webcams.php?network=KCRG">KCRG-TV Webcams</a></th>
<td>https://mesonet.agron.iastate.edu/request/grx/webcams.php?network=KCRG<br />
<i>Notes:</i> You will not want to use this on a low bandwidth
Expand All @@ -135,14 +135,15 @@ only use this layer when you are using the data! Thanks...</td>
</tr>
<tr>
<td>Yes</td>
<th><a href="l3attr.txt">NEXRAD Level3 Attributes</a></th>
<td>https://mesonet.agron.iastate.edu/request/grx/l3attr.txt<br />
<i>Notes:</i> This is a placefile of the level3 NEXRAD storm attributes. This
may be useful when looking at level2 data. You can optionally pass a nexrad
3 character ID to limit the display to a certain NEXRAD. ie)
<code>l3attr.txt?nexrad=DMX</code>. Otherwise, the service will utilize the
longitude and latitude passed to the server by the Gibson Ridge Client
to limit the displayed attributes.
3 character ID to limit the display to a certain NEXRAD. ie)
<code>l3attr.txt?nexrad=DMX</code>. Otherwise, the service will utilize the
longitude and latitude passed to the server by the Gibson Ridge Client
to limit the displayed attributes.
<br /><strong>Additional Query Parameters</strong>: You can provide additional
URL parameters to limit the returned attributes. For example,
Expand All @@ -156,6 +157,7 @@ may be useful when looking at level2 data. You can optionally pass a nexrad
</tr>
<tr>
<td>No</td>
<th><a href="watch_by_county.php">SPC Watch by County</a></th>
<td>https://mesonet.agron.iastate.edu/request/grx/watch_by_county.php?<br />
<i>Notes:</i> This is a placefile of the union of counties within a
Expand All @@ -167,20 +169,23 @@ may be useful when looking at level2 data. You can optionally pass a nexrad
</tr>
<tr>
<td>No</td>
<th><a href="time_mot_loc.txt">NWS Warning TIME...MOT...LOC</a> (TOR)</th>
<td>https://mesonet.agron.iastate.edu/request/grx/time_mot_loc.txt?<br />
<i>Notes:</i> This provides lines indicating the path of travel for
tornado warnings based on the coding within the warning.</td>
</tr>
<tr>
<td>No</td>
<th><a href="time_mot_loc.txt?all">NWS Warning TIME...MOT...LOC</a> (TOR+SVR)</th>
<td>https://mesonet.agron.iastate.edu/request/grx/time_mot_loc.txt?all<br />
<i>Notes:</i> This provides lines indicating the path of travel for
tornado and severe thunderstorm warnings based on the coding within the warning.</td>
</tr>
<tr>
<td>No</td>
<th><a href="time_mot_loc.txt?all&amp;valid=2020-05-25T00:00Z">NWS Warning TIME...MOT...LOC (Historical)</a> (TOR+SVR)</th>
<td>https://mesonet.agron.iastate.edu/request/grx/time_mot_loc.txt?all&valid=2020-05-25T00:00Z<br />
<i>Notes:</i> Provides any TIME...MOT...LOC tracks for a four hour window of
Expand Down
Loading

0 comments on commit b928ce9

Please sign in to comment.