diff --git a/doc/make.py b/doc/make.py index acf172328..8fb8953a4 100755 --- a/doc/make.py +++ b/doc/make.py @@ -7,7 +7,7 @@ import sys def html(): - os.system('sphinx-build -b html -d build/doctrees . build/html') + os.system('LC_ALL=C.UTF-8 sphinx-build -b html -c source/ -d build/doctrees . build/html') def latex(): if sys.platform != 'win32': diff --git a/doc/source/users/figures/plotdaynight.py b/doc/source/users/figures/plotdaynight.py index ac1f7bc34..1cd20b916 100644 --- a/doc/source/users/figures/plotdaynight.py +++ b/doc/source/users/figures/plotdaynight.py @@ -1,7 +1,9 @@ +import os +import time +import datetime import numpy as np from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt -from datetime import datetime # miller projection map = Basemap(projection='mill',lon_0=180) # plot coastlines, draw label meridians and parallels. @@ -13,7 +15,8 @@ map.fillcontinents(color='coral',lake_color='aqua') # shade the night areas, with alpha transparency so the # map shows through. Use current time in UTC. -date = datetime.utcnow() +date = datetime.datetime.utcfromtimestamp( + int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))) CS=map.nightshade(date) plt.title('Day/Night Map for %s (UTC)' % date.strftime("%d %b %Y %H:%M:%S")) plt.show() diff --git a/doc/source/users/figures/plothighsandlows.py b/doc/source/users/figures/plothighsandlows.py index d9e70bb40..7f1c27261 100644 --- a/doc/source/users/figures/plothighsandlows.py +++ b/doc/source/users/figures/plothighsandlows.py @@ -2,7 +2,9 @@ plot H's and L's on a sea-level pressure map (uses scipy.ndimage.filters and netcdf4-python) """ -import datetime as dt +import os +import time +import datetime import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap, addcyclic @@ -23,7 +25,8 @@ def extrema(mat,mode='wrap',window=10): # Plot 00 UTC yesterday. url = "http://nomads.ncep.noaa.gov/dods/gfs_0p50/gfs%Y%m%d/gfs_0p50_00z" -date = dt.datetime.now() - dt.timedelta(days=1) +date = datetime.datetime.utcfromtimestamp( + int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))) - datetime.timedelta(days=1) # open OpenDAP dataset. data = Dataset(date.strftime(url))