diff --git a/config/navbar.json b/config/navbar.json
index 58b0675b1..c05b84caa 100644
--- a/config/navbar.json
+++ b/config/navbar.json
@@ -97,6 +97,10 @@
"title": "Daily Observations",
"url": "/request/daily.phtml"
},
+ {
+ "title": "Dataset Documentation",
+ "url": "/info/datasets/"
+ },
{
"title": "IEM Reanalysis",
"url": "/iemre/"
diff --git a/include/generators.php b/include/generators.php
index e6dd6b317..78654ab28 100644
--- a/include/generators.php
+++ b/include/generators.php
@@ -16,8 +16,7 @@ function get_website_citations($label){
Publications Citing IEM Data
These are publications that have cited the usage of data from this page. This
list is not exhaustive, so please let us know
-if you have a publication that should be added. Hopefully by early 2025, this
-listing can be more complete.
+if you have a publication that should be added.
EOM;
for ($i=0; $row = pg_fetch_assoc($rs); $i++){
diff --git a/pylib/iemweb/autoplot/scripts/p3.py b/pylib/iemweb/autoplot/scripts/p3.py
index 6c2b497de..2b51ebce7 100644
--- a/pylib/iemweb/autoplot/scripts/p3.py
+++ b/pylib/iemweb/autoplot/scripts/p3.py
@@ -323,7 +323,8 @@ def add_ctx(ctx):
xlabel = f"Year, Max: {df[ptype].max():.2f} {df2.index.values[0]}{xx}"
df2 = df[df[ptype] == df[ptype].min()]
xx = "+" if len(df2.index) > 1 else ""
- xlabel += f", Min: {df[ptype].min():.2f} {df2.index.values[0]}{xx}"
+ if not df2.empty:
+ xlabel += f", Min: {df[ptype].min():.2f} {df2.index.values[0]}{xx}"
ctx["xlabel"] = xlabel
data = df[ptype].values
ctx["data"] = data
diff --git a/pylib/iemweb/autoplot/scripts/p57.py b/pylib/iemweb/autoplot/scripts/p57.py
index 3be2d4903..723f9e988 100644
--- a/pylib/iemweb/autoplot/scripts/p57.py
+++ b/pylib/iemweb/autoplot/scripts/p57.py
@@ -5,13 +5,14 @@
"""
import calendar
-import datetime
+from datetime import date, timedelta
import numpy as np
import pandas as pd
from pyiem.database import get_sqlalchemy_conn
from pyiem.exceptions import NoDataFound
from pyiem.plot import figure_axes
+from sqlalchemy import text
from iemweb.autoplot import ARG_STATION
@@ -54,22 +55,22 @@ def plotter(ctx: dict):
varname = ctx["varname"]
agg = ctx["agg"]
- lastday = datetime.date.today()
+ lastday = date.today()
if varname == "total_precip" and agg == "max":
- lastday += datetime.timedelta(days=1)
+ lastday += timedelta(days=1)
else:
lastday = lastday.replace(day=1)
with get_sqlalchemy_conn("coop") as conn:
df = pd.read_sql(
- """SELECT year, month, avg((high+low)/2.) as avg_temp,
+ text("""SELECT year, month, avg((high+low)/2.) as avg_temp,
avg(high) as avg_high_temp, avg(low) as avg_low_temp,
sum(precip) as total_precip,
sum(case when precip > 0.005 then 1 else 0 end) as rain_days
- from alldata where station = %s and day < %s
+ from alldata where station = :station and day < :lastday
GROUP by year, month
- """,
+ """),
conn,
- params=(station, lastday),
+ params={"station": station, "lastday": lastday},
)
if df.empty:
raise NoDataFound("No Data Found.")
diff --git a/pylib/iemweb/autoplot/scripts/p59.py b/pylib/iemweb/autoplot/scripts/p59.py
index 38945b39d..26fb5c436 100644
--- a/pylib/iemweb/autoplot/scripts/p59.py
+++ b/pylib/iemweb/autoplot/scripts/p59.py
@@ -7,7 +7,6 @@
"""
import calendar
-import datetime
import numpy as np
import pandas as pd
@@ -16,6 +15,7 @@
from pyiem.database import get_sqlalchemy_conn
from pyiem.exceptions import NoDataFound
from pyiem.plot import figure
+from pyiem.util import utc
from sqlalchemy import text
PDICT = {
@@ -63,7 +63,7 @@ def add_plot(ctx):
"""Do plotting."""
title = (
f"{ctx['_sname']} :: Daily Average Component Wind Speed\n"
- f"[{ctx['ab'].year}-{datetime.datetime.now().year}] 7 day smooth "
+ f"[{ctx['ab'].year}-{utc().year}] 7 day smooth "
f"filter applied, {len(ctx['df'].index):.0f} obs found"
)
ctx["fig"] = figure(apctx=ctx, title=title)
diff --git a/pylib/iemweb/autoplot/scripts/p61.py b/pylib/iemweb/autoplot/scripts/p61.py
index f5b25da45..ae6092dfd 100644
--- a/pylib/iemweb/autoplot/scripts/p61.py
+++ b/pylib/iemweb/autoplot/scripts/p61.py
@@ -6,7 +6,7 @@
This plot is based off of NWS CLI sites.
"""
-import datetime
+from datetime import date, timedelta
import geopandas as gpd
import pandas as pd
@@ -44,7 +44,7 @@ def get_description():
dict(
type="date",
name="sdate",
- default=datetime.date.today().strftime("%Y/%m/%d"),
+ default=date.today().strftime("%Y/%m/%d"),
label="Start Date:",
min="2010/01/01",
),
@@ -78,8 +78,8 @@ def get_data(ctx):
varname = ctx["var"]
today = ctx["sdate"]
- yesterday = today - datetime.timedelta(days=1)
- d180 = today - datetime.timedelta(days=180)
+ yesterday = today - timedelta(days=1)
+ d180 = today - timedelta(days=180)
with get_sqlalchemy_conn("iem") as conn:
df = pd.read_sql(
"""
@@ -153,7 +153,7 @@ def get_data(ctx):
df = df[pd.notnull(df["lon"])]
ctx["df"] = gpd.GeoDataFrame(
df, geometry=gpd.points_from_xy(df["lon"], df["lat"])
- )
+ ) # type: ignore
ctx["subtitle"] = (
"based on NWS CLI Sites, map approximately "
f"valid for {today:%-d %b %Y}"
diff --git a/pylib/iemweb/autoplot/scripts/p62.py b/pylib/iemweb/autoplot/scripts/p62.py
index 6440cc9d5..dfdbb2236 100644
--- a/pylib/iemweb/autoplot/scripts/p62.py
+++ b/pylib/iemweb/autoplot/scripts/p62.py
@@ -6,7 +6,7 @@
"""
import copy
-import datetime
+from datetime import date, datetime
import matplotlib.colors as mpcolors
import numpy as np
@@ -15,6 +15,7 @@
from pyiem.exceptions import NoDataFound
from pyiem.plot import figure
from pyiem.plot.colormaps import nwssnow
+from sqlalchemy import text
from iemweb.autoplot import ARG_STATION
@@ -24,7 +25,7 @@
def get_description():
"""Return a dict describing how to call this plotter"""
desc = {"description": __doc__, "data": True}
- today = datetime.datetime.today()
+ today = datetime.today()
lyear = today.year if today.month > 8 else (today.year - 1)
desc["arguments"] = [
ARG_STATION,
@@ -54,22 +55,22 @@ def plotter(ctx: dict):
raise NoDataFound("Unknown station metadatab.")
syear = max([ctx["syear"], ab.year])
eyear = ctx["eyear"]
- sts = datetime.date(syear, 11, 1)
- ets = datetime.date(eyear + 1, 6, 1)
+ sts = date(syear, 11, 1)
+ ets = date(eyear + 1, 6, 1)
- eyear = datetime.datetime.now().year
+ eyear = datetime.now().year
obs = np.ma.ones((eyear - syear + 1, 183), "f") * -1
with get_sqlalchemy_conn("coop") as conn:
df = pd.read_sql(
- """
+ text("""
SELECT year, extract(doy from day) as doy, snowd, day,
case when month < 6 then year - 1 else year end as winter_year
- from alldata WHERE station = %s and
+ from alldata WHERE station = :station and
month in (11, 12, 1, 2, 3, 4) and snowd >= 0 and
- day between %s and %s
- """,
+ day between :sts and :ets
+ """),
conn,
- params=(station, sts, ets),
+ params={"station": station, "sts": sts, "ets": ets},
index_col="day",
)
if df.empty:
@@ -86,7 +87,7 @@ def plotter(ctx: dict):
f"{ctx['_sname']}\n" f"Daily Snow Depth ({minyear}-{eyear}) [inches]"
)
fig = figure(apctx=ctx, title=title)
- ax = fig.add_axes([0.1, 0.1, 0.93, 0.8])
+ ax = fig.add_axes((0.1, 0.1, 0.93, 0.8))
ax.set_xticks((0, 29, 60, 91, 120, 151, 181))
ax.set_xticklabels(
["Nov 1", "Dec 1", "Jan 1", "Feb 1", "Mar 1", "Apr 1", "May 1"]
diff --git a/pylib/iemweb/autoplot/scripts200/p200.py b/pylib/iemweb/autoplot/scripts200/p200.py
index ba516bdae..34b1836b9 100644
--- a/pylib/iemweb/autoplot/scripts200/p200.py
+++ b/pylib/iemweb/autoplot/scripts200/p200.py
@@ -229,6 +229,13 @@ def get_description():
options=PDICT2,
label="Which metric to plot?",
),
+ {
+ "type": "date",
+ "name": "sdate",
+ "label": "Limit plot to start date (2002 is start):",
+ "min": "2002/01/01",
+ "default": "2002/01/01",
+ },
dict(
optional=True,
type="date",
@@ -267,6 +274,7 @@ def get_raster(ctx: dict):
"t": level.split(".", 1)[1],
"cat": level.split(".")[0],
"months": months,
+ "sdate": ctx["sdate"],
"edate": ctx.get("edate", utc() + timedelta(days=2)),
"west": GRIDWEST,
"south": GRIDSOUTH,
@@ -291,7 +299,7 @@ def get_raster(ctx: dict):
ST_Intersects(geom,
ST_MakeEnvelope(:west, :south, :east, :north, 4326))
and extract(month from issue) = ANY(:months)
- and product_issue > '2002-01-01' and
+ and product_issue > :sdate and
product_issue < :edate
GROUP by expire ORDER by min_issue ASC
"""