Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* Reduce spacing between the homepage logo and title. */

article .align-center {
margin-bottom: 0 !important;
}

article h1 {
margin-top: 0 !important;
}

/* Reduce spacing around the sidebar logo. */

.sidebar-brand {
padding-bottom: 0 !important;
}

.sidebar-logo-container {
margin-bottom: 0 !important;
}

.sidebar-logo {
max-height: 80px;
}

.sidebar-brand-text {
margin-top: 0 !important;
}
Binary file added docs/_static/dsf_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions docs/_static/dsf_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
sys.path.insert(0, str(ROOT / "src"))

project = "DSF"
author = "Nikolina Sarcevic, Ben Levine"
author = "Niko Šarčević, Ben Levine"
copyright = "2026, LSST Dark Energy Science Collaboration"

html_title = "DSF Documentation"
Expand All @@ -34,6 +34,8 @@

html_theme = "furo"
html_static_path = ["_static"]
html_logo = "_static/dsf_logo.svg"
html_css_files = ["custom.css"]

autodoc_typehints = "description"
napoleon_google_docstring = True
Expand Down
5 changes: 5 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.. image:: _static/dsf_logo.svg
:alt: DSF logo
:width: 140px
:align: center

DSF
===

Expand Down
Binary file added logo/dsf_colors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
119 changes: 119 additions & 0 deletions logo/dsf_colors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
"""Define the DSF color palette and continuous and discrete Matplotlib colormaps."""

import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import (
BoundaryNorm,
LinearSegmentedColormap,
ListedColormap,
to_hex,
to_rgb,
)

__all__ = [
"DSF_COLORS",
"DSF_CMAP",
"DSF_CMAP_DISCRETE",
"DSF_NORM",
]

# Pastel strength: 0.0 = original colors, 1.0 = white.
PASTEL_AMOUNT = 0.1

# Original DSF colors, ordered from cool to warm.
_BASE_COLORS = [
"#294653", # Deep slate blue
"#168C83", # Teal
"#68C8B8", # Mint
"#F2C75C", # Golden yellow
"#F6A35C", # Apricot
"#ED765E", # Coral
"#D95C48", # Terracotta
]


def pastelize(color, amount):
"""Blend a color with white to produce a pastel shade.

Args:
color: Matplotlib-compatible color.
amount: Fraction of white to mix in, between 0 and 1.

Returns:
Hexadecimal color string.
"""
rgb = np.asarray(to_rgb(color))
pastel = (1.0 - amount) * rgb + amount * np.ones(3)
return to_hex(pastel)


# DSF pastel colors.
DSF_COLORS = [
pastelize(color, PASTEL_AMOUNT)
for color in _BASE_COLORS
]

# Continuous colormap.
DSF_CMAP = LinearSegmentedColormap.from_list(
"dsf_colors",
DSF_COLORS,
N=256,
)

# Discrete colormap.
DSF_CMAP_DISCRETE = ListedColormap(
DSF_COLORS,
name="dsf_colors_discrete",
)

# Discrete normalization.
DSF_NORM = BoundaryNorm(
np.arange(len(DSF_COLORS) + 1),
DSF_CMAP_DISCRETE.N,
)


def main():
"""Preview the DSF palette and colormaps."""
fig, axes = plt.subplots(3, 1, figsize=(12, 5))

# Individual discrete colors.
for i, color in enumerate(DSF_COLORS):
axes[0].barh(0, 1, left=i, color=color, height=1)

axes[0].set_xlim(0, len(DSF_COLORS))
axes[0].set_ylim(-0.5, 0.5)
axes[0].set_title("DSF Colors — Discrete Palette")
axes[0].axis("off")

# Continuous colormap.
gradient = np.linspace(0, 1, 512)[None, :]

axes[1].imshow(
gradient,
aspect="auto",
cmap=DSF_CMAP,
extent=[0, 1, 0, 1],
)
axes[1].set_title("DSF Colors — Continuous Colormap")
axes[1].axis("off")

# Discrete colormap.
discrete = np.arange(len(DSF_COLORS))[None, :]

axes[2].imshow(
discrete,
aspect="auto",
cmap=DSF_CMAP_DISCRETE,
interpolation="nearest",
)
axes[2].set_title("DSF Colors — Discrete Colormap")
axes[2].axis("off")

fig.tight_layout()
fig.savefig("dsf_colors.png", dpi=300, bbox_inches="tight")
plt.show()


if __name__ == "__main__":
main()
Binary file added logo/dsf_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions logo/dsf_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions logo/make_logo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""Generate the DSF Delta-Sigma logo and save it for documentation."""

from pathlib import Path

import matplotlib.pyplot as plt
from dsf_colors import DSF_COLORS

fig, ax = plt.subplots(figsize=(5, 5))

# Large Delta.
ax.text(0, 0, r"$\Delta$", fontsize=250, color=DSF_COLORS[0],
ha="center", va="center")

# Smaller Sigma inside Delta.
ax.text(0, -0.12, r"$\Sigma$", fontsize=85, color=DSF_COLORS[5],
ha="center", va="center")

ax.set_xlim(-1, 1)
ax.set_ylim(-1, 1)
ax.set_aspect("equal")
ax.axis("off")

# Save in the current folder.
plt.savefig("dsf_logo.svg", transparent=True, bbox_inches="tight", pad_inches=0.05)
plt.savefig("dsf_logo.png", dpi=300, transparent=True, bbox_inches="tight", pad_inches=0.05)

# Save in the documentation static folder.
static_dir = Path(__file__).resolve().parents[1] / "docs" / "_static"
static_dir.mkdir(parents=True, exist_ok=True)

plt.savefig(static_dir / "dsf_logo.svg",
transparent=True, bbox_inches="tight", pad_inches=0.0)
plt.savefig(static_dir / "dsf_logo.png",
dpi=300, transparent=True, bbox_inches="tight", pad_inches=0.0)

plt.show()
Loading