Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0ee9b27
Add marimo example
AdamRJensen Jul 26, 2026
e8a8c9a
Include separate uv sync install
AdamRJensen Jul 26, 2026
277ec64
Use real solarstations data for example
AdamRJensen Jul 26, 2026
6081f8c
Merge branch 'main' into marimo
AdamRJensen Jul 29, 2026
d3dfb67
Update .gitignore
AdamRJensen Jul 30, 2026
b9d8d74
Update jupyter-book-marimo version
AdamRJensen Jul 30, 2026
2af1b43
Update station_catalog_marimo.md
AdamRJensen Jul 30, 2026
9b3483b
Update station_catalog_marimo.md
AdamRJensen Jul 30, 2026
ed96be8
Update station_catalog_marimo.md
AdamRJensen Jul 30, 2026
c3c3a54
Add kgcpy
AdamRJensen Jul 30, 2026
41ed222
Add nasa power irradiances and comment out kgcpy
AdamRJensen Jul 30, 2026
45b1903
jupyter-book-marimo==0.0.3
AdamRJensen Aug 28, 2026
8ce8402
Remove python install section from .readthedocs.yaml
AdamRJensen Aug 28, 2026
90ab203
Add pip install uv
AdamRJensen Aug 28, 2026
6f116ff
Update requirements.txt
AdamRJensen Aug 28, 2026
9e30e91
Experiment with table format
AdamRJensen Aug 28, 2026
5e7e971
Update station_catalog_marimo.md
AdamRJensen Aug 28, 2026
17bb111
Update station_catalog_marimo.md
AdamRJensen Aug 28, 2026
c8f49f2
Remove formatting of URL column and keep URL column
AdamRJensen Aug 28, 2026
cd01c29
Update station_catalog_marimo.md
AdamRJensen Aug 28, 2026
f4d4f72
Update station_catalog_marimo.md
AdamRJensen Aug 28, 2026
da1a438
Update station_catalog_marimo.md
AdamRJensen Aug 28, 2026
c9c4e18
Update station_catalog_marimo.md
AdamRJensen Aug 28, 2026
cbfc396
Update station_catalog_marimo.md
AdamRJensen Aug 28, 2026
77e6c17
Try kgcpy again
AdamRJensen Aug 28, 2026
43d4429
Update station_catalog_marimo.md
AdamRJensen Aug 28, 2026
9f1e3dd
Update station_catalog_marimo.md
AdamRJensen Aug 28, 2026
794ebdb
Update station_catalog_marimo.md
AdamRJensen Aug 28, 2026
517e557
Update station_catalog_marimo.md
AdamRJensen Aug 28, 2026
51878b4
Try kgcpy
AdamRJensen Aug 28, 2026
f2183a5
Update station_catalog_marimo.md
AdamRJensen Aug 28, 2026
41fc70a
Update station_catalog_marimo.md
AdamRJensen Aug 29, 2026
9ef2bd6
Update station_catalog_marimo.md
AdamRJensen Aug 29, 2026
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ SolarStationsOrg-station-catalog.csv

# MyST build outputs
_build

# Jupyter book
docs/.jupyter-book-marimo
16 changes: 9 additions & 7 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ build:
python: "3.13"
nodejs: "22"
commands:
# Install Python dependencies
- pip install -r docs/requirements.txt
# Install uv itself (not preinstalled on the RTD build image)
- pip install uv
# Install Python dependencies via uv, creating .venv at the repo root
# (myst.yml's marimo plugin path, ../.venv/bin/jupyter-book-marimo, expects it there)
- UV_PROJECT_ENVIRONMENT=.venv uv sync
# Install mystmd
- npm install -g mystmd
# Build the site (myst.yml lives in docs/, so build from there)
# --execute re-runs notebook code cells instead of using their stored outputs.
- cd docs && myst build --html --execute
- cd docs && UV_PROJECT_ENVIRONMENT=.venv uv run jupyter-book build --html
# Copy the output to Read the Docs expected location
- mkdir -p $READTHEDOCS_OUTPUT/html/
- cp -r docs/_build/html/. "$READTHEDOCS_OUTPUT/html"
- mkdir -p "$READTHEDOCS_OUTPUT/html/"
- cd docs && cp -r _build/html/. "$READTHEDOCS_OUTPUT/html/"
# Clean up build artifacts
- rm -rf docs/_build
- cd docs && rm -rf _build
5 changes: 5 additions & 0 deletions docs/myst.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ project:
settings:
output_matplotlib_strings: remove

plugins:
- type: executable
path: ../.venv/bin/jupyter-book-marimo

toc:
- file: intro.ipynb
- file: station_catalog.ipynb
- file: station_catalog_marimo.md
- file: station_requirements.md
title: Station requirements
- file: station_metadata.md
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ unidecode==1.4.0
openpyxl==3.1.5
xarray==2026.7.0
h5netcdf==1.8.1
jupyter-book-marimo==0.0.3
102 changes: 102 additions & 0 deletions docs/station_catalog_marimo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
pyproject: |-
requires-python = ">=3.12"
dependencies = [
"marimo",
"pandas",
"numpy",
"kgcpy",
]
title: Station catalog
marimo-version: 0.23.13
---

```{marimo} python
import marimo as mo
import pandas as pd
import numpy as np
import kgcpy
```


```{marimo} python
main_url = "https://raw.githubusercontent.com/AssessingSolar/solarstations/refs/heads/main/solarstations.csv"
esmap_url = "https://raw.githubusercontent.com/AssessingSolar/solarstations/refs/heads/main/esmap_stations.csv"
country_by_continent_url = "https://raw.githubusercontent.com/AssessingSolar/solarstations/refs/heads/main/data/country_by_continent.json"
nasa_power_url = "https://raw.githubusercontent.com/AssessingSolar/solarstations/refs/heads/main/data/nasa_power_annual_irradiance_global.csv"

main_stations = pd.read_csv(main_url)
esmap_stations = pd.read_csv(esmap_url)
stations = pd.concat([main_stations, esmap_stations], axis='rows', ignore_index=True)

country_by_continent = pd.read_json(country_by_continent_url, typ="series").to_dict()

stations['Continent'] = stations['Country'].map(country_by_continent)

stations['Koeppen Geiger classification'] = stations.apply(lambda x: kgcpy.lookupCZ(x['Latitude'], x['Longitude']), axis=1)
kg_climates = {'A': 'Tropical', 'B': 'Dry', 'C': 'Temperate', 'D': 'Continental', 'E': 'Polar', 'O': 'Ocean'}
stations['Koeppen Geiger climate zone'] = stations['Koeppen Geiger classification'].apply(lambda x: kg_climates[x[0]])

instrumentation = stations['Instrumentation'].str.split(';', expand=True)
is_tier_1 = (instrumentation=='G').any(axis=1) & (instrumentation=='B').any(axis=1) & (instrumentation=='D').any(axis=1)
stations['Tier'] = 2 - is_tier_1.astype(int)

annual_irradiance = pd.read_csv(nasa_power_url, index_col=[0, 1])
stations[['GHI_kWh_m2', 'DHI_kWh_m2', 'DNI_kWh_m2']] = np.nan
for index, row in stations.iterrows():
lat_round = round(row['Latitude']*2-0.5, 0)/2 + 0.25
lon_round = round(row['Longitude']*2-0.5, 0)/2 + 0.25
try:
stations.loc[index, ['GHI_kWh_m2', 'DHI_kWh_m2', 'DNI_kWh_m2']] = \
annual_irradiance.loc[(lat_round, lon_round), :]
except KeyError as e:
pass
# Manual add data missing from the climatological file (data retrieved from NASA's webinterface)
if row['Station name'] == 'Funafuti':
stations.loc[index, ['GHI_kWh_m2', 'DHI_kWh_m2', 'DNI_kWh_m2']] = \
np.array([5.33*365, 2.12*365, 4.37*365]).astype(int)
if row['Station name'] == 'South Pole':
stations.loc[index, ['GHI_kWh_m2', 'DHI_kWh_m2', 'DNI_kWh_m2']] = \
np.array([3.0*365, 1.38*365, 5.13*365]).astype(int)

stations = stations[~stations['Instrumentation'].str.contains('G;Ds')] # remove Tier 3 stations

stations = stations.sort_values('Station name', ignore_index=True)

# Set empty string values to empty string as otherwise they are shown as NaN in the table
for c in stations.columns:
if not pd.api.types.is_numeric_dtype(stations[c]):
stations[c] = stations[c].replace(np.nan, '')

stations = stations.rename(columns={
"GHI_kWh_m2": "GHI (kWh/m²)",
"DHI_kWh_m2": "DHI (kWh/m²)",
"DNI_kWh_m2": "DNI (kWh/m²)",
})

columns_ordered = [
'Station name', 'URL', 'Abbreviation', 'State', 'Country', 'Continent',
'Latitude', 'Longitude', 'Elevation',
'Time period', 'Network', 'Owner', 'Comment', 'Data availability', 'Instrumentation', 'Tier',
'GHI (kWh/m²)', 'DHI (kWh/m²)', 'DNI (kWh/m²)',
# 'Koeppen Geiger climate zone',
]

stations = stations[columns_ordered]

# Write file containing all columns, linked to above
stations.to_csv('./SolarStationsOrg-station-catalog.csv', index=False)

table = mo.ui.table(
stations,
pagination=True,
freeze_columns_left=["Station name"],
page_size=20, # default is 10
show_download=True,
column_widths={"Station name": 180, "URL": 80},
)
```

```{marimo} python
table
```
23 changes: 23 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[project]
name = "SolarStations.org"
version = "0.1.0"
description = "A catalog of multi-component solar irradiance monitoring stations."
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
"folium==0.20.0",
"itables==2.2.2",
"jupyter-book==2.1.6",
"matplotlib==3.11.1",
"numpy==2.5.1",
"pandas==3.0.3",
"pvlib==0.15.2",
"unidecode==1.4.0",
"openpyxl==3.1.5",
"xarray==2026.7.0",
"h5netcdf==1.8.1",
"jupyter-book==2.1.6",
"jupyter-book-marimo==0.0.3",
"marimo",
"kgcpy==1.1.8",
]
Loading