diff --git a/README.md b/README.md index 3db3be8..ce1c3d4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
diff --git a/docs/source/_static/favicon.ico b/docs/source/_static/favicon.ico deleted file mode 100644 index 5b51ec5..0000000 Binary files a/docs/source/_static/favicon.ico and /dev/null differ diff --git a/docs/source/_static/tephi-logo-200-137.png b/docs/source/_static/tephi-logo-200-137.png deleted file mode 100644 index 222f60c..0000000 Binary files a/docs/source/_static/tephi-logo-200-137.png and /dev/null differ diff --git a/docs/source/_static/tephi-logo.svg b/docs/source/_static/tephi-logo.svg new file mode 100644 index 0000000..879d67b --- /dev/null +++ b/docs/source/_static/tephi-logo.svg @@ -0,0 +1,376 @@ + + + diff --git a/docs/source/conf.py b/docs/source/conf.py index a9a01cd..de23f17 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -131,12 +131,11 @@ # The name of an image file (relative to this directory) to place at the top # of the sidebar. -html_logo = "_static/tephi-logo-200-137.png" +html_logo = "_static/tephi-logo.svg" # The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -html_favicon = "_static/favicon.ico" +# docs. +html_favicon = "_static/tephi-logo.svg" # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, diff --git a/docs/source/generate_logo.py b/docs/source/generate_logo.py new file mode 100644 index 0000000..87ef24c --- /dev/null +++ b/docs/source/generate_logo.py @@ -0,0 +1,70 @@ +"""Script to generate the Tephi logo.""" + +from pathlib import Path + +import matplotlib.pyplot as plt +import tephi + + +# Prepare the data. +dew_point = Path(tephi.DATA_DIR) / "dews.txt" +dew_data = tephi.loadtxt(str(dew_point), column_titles=('pressure', 'dewpoint')) +# Limit the data to ensure there are no areas without lines. +dews = zip(dew_data.pressure[1:-2], dew_data.dewpoint[1:-2]) + + +def coarsen_tephi_line(spec: list[tuple[int, int]], factor: int): + return [(step * factor, zoom) for step, zoom in spec] + + +def restyle_tephi_line(line: dict): + return line | dict(color="white", linestyle="solid", linewidth=3) + + +tephi.ISOBAR_SPEC = coarsen_tephi_line(tephi.ISOBAR_SPEC, 5) +tephi.WET_ADIABAT_SPEC = coarsen_tephi_line(tephi.WET_ADIABAT_SPEC, 5) +tephi.MIXING_RATIO_SPEC = coarsen_tephi_line(tephi.MIXING_RATIO_SPEC, 3) + +tephi.ISOBAR_LINE = restyle_tephi_line(tephi.ISOBAR_LINE) +tephi.WET_ADIABAT_LINE = restyle_tephi_line(tephi.WET_ADIABAT_LINE) +tephi.MIXING_RATIO_LINE = restyle_tephi_line(tephi.MIXING_RATIO_LINE) + +tpg = tephi.Tephigram() +tpg.plot( + dews, + color="white", + linewidth=3, + linestyle="dashed", +) + +ax = plt.gca() + +ax.set_facecolor("#7DA7FC") + +for key, artist in ax.axis.items(): + artist.set_visible(False) +ax.grid(False) + +for text in ax.texts: + text.set_visible(False) + +ax.set_aspect("auto") +plt.gcf().set_size_inches(3, 3) + +ax.text( + 0.5, + 0.5, + 'Tφ', + horizontalalignment='center', + verticalalignment='center', + transform=ax.transAxes, + size=128, + style="italic", + weight="bold", + zorder=10, + color="white", +) + +static_dir = Path(__file__).parent / "_static" +plt.subplots_adjust(left=0, right=1, top=1, bottom=0) +plt.savefig(static_dir / "tephi-logo.svg") diff --git a/index.ipynb b/index.ipynb index 678dc30..e5f2e77 100644 --- a/index.ipynb +++ b/index.ipynb @@ -6,7 +6,7 @@ "source": [ "\n",
"\n",
- " \n",
+ "
\n",
"\n",
"
\n",