Skip to content

Commit

Permalink
Merge pull request #592 from akrherz/231121
Browse files Browse the repository at this point in the history
Omnibus
  • Loading branch information
akrherz authored Nov 21, 2023
2 parents 2e4d46a + 4e36ce3 commit 3e702ac
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions htdocs/plotting/auto/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ def generate_form(apid, fdict, headers, cookies):
"headextra": "",
"dataextra": "",
"issues": "",
"frontend": None,
}
if apid == 0:
return res
Expand Down
2 changes: 1 addition & 1 deletion htdocs/projects/iembot/mastodon/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def build_subui(mapp, fdict):

def sanitize_server(val):
"""Ensure we have something that is like a server."""
if val is None:
if val is None or val == "":
return None
if val.startswith("https://"):
return val[8:]
Expand Down
8 changes: 5 additions & 3 deletions scripts/00z/generate_rtp.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def main(job):
data = pd.read_sql(
text(
f"""
SELECT id, round(max(tmpf)::numeric,0) as max_tmpf,
SELECT id, round(max(
greatest(max_tmpf_6hr, tmpf))::numeric,0) as max_tmpf,
count(tmpf) as obs FROM current_log c, stations t
WHERE t.iemid = c.iemid and t.network = ANY(:networks) and
valid >= :sts6z and valid < :ets and {job['limiter']}
Expand All @@ -69,7 +70,8 @@ def main(job):
lows = pd.read_sql(
text(
f"""
SELECT id, round(min(tmpf)::numeric,0) as min_tmpf,
SELECT id, round(min(
least(min_tmpf_6hr, tmpf))::numeric,0) as min_tmpf,
count(tmpf) as obs FROM
current_log c JOIN stations t on (t.iemid = c.iemid)
WHERE t.network = ANY(:networks) and valid >= :sts6z
Expand Down Expand Up @@ -127,7 +129,7 @@ def main(job):
": 06Z TO 00Z LOW TEMPERATURE FOR "
f"{job['sts12z']:%d %b %Y}\n"
": 00Z YESTERDAY TO 00Z TODAY RAINFALL\n"
": ...BASED ON REPORTED OBS...\n"
": ...BASED ON REPORTED OBS AND ANY 6 HR MAX MIN...\n"
)
for sid in ids:
if (
Expand Down
11 changes: 7 additions & 4 deletions scripts/12z/generate_rtp.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ def main(job):
data = pd.read_sql(
text(
f"""
SELECT id, round(max(tmpf)::numeric,0) as max_tmpf,
SELECT id, round(
max(greatest(max_tmpf_6hr, tmpf))::numeric,0) as max_tmpf,
count(tmpf) as obs FROM current_log c, stations t
WHERE t.iemid = c.iemid and t.network = ANY(:networks) and
valid >= :yesterday6z and valid < :today6z and {job['limiter']}
and tmpf > -99 and not id = ANY(:badtemps) GROUP by id
and tmpf > -99 and not id = ANY(:badtemps)
GROUP by id
"""
),
conn,
Expand All @@ -69,7 +71,8 @@ def main(job):
lows = pd.read_sql(
text(
f"""
SELECT id, round(min(tmpf)::numeric,0) as min_tmpf,
SELECT id, round(
min(least(min_tmpf_6hr, tmpf))::numeric,0) as min_tmpf,
count(tmpf) as obs FROM
current_log c JOIN stations t on (t.iemid = c.iemid)
WHERE t.network = ANY(:networks) and valid >= :today0z
Expand Down Expand Up @@ -129,7 +132,7 @@ def main(job):
f": 06Z to 06Z HIGH TEMPERATURE FOR {tt}\n"
": 00Z TO 12Z TODAY LOW TEMPERATURE\n"
": 12Z YESTERDAY TO 12Z TODAY RAINFALL\n"
": ...BASED ON REPORTED OBS...\n"
": ...BASED ON REPORTED OBS AND ANY 6HR MAX MIN...\n"
)
for sid in ids:
if (
Expand Down

0 comments on commit 3e702ac

Please sign in to comment.