Skip to content

Instantly share code, notes, and snippets.

@denis-bz
denis-bz / 0-Windspeeds-Bayern-175m.md
Last active June 15, 2026 10:24
Windspeeds in Bayern at 175m, CERRA model 15 Jun 2026

Windspeeds across Bayern at 175m in 2016 from CERRA

Keywords: wind-power Bayern CERRA capacity-factor renewable-energy open-data python

CERRA has open data on windspeeds across Europe, 3-hour averages on a 5.5 km grid.
See CERRA, the Copernicus European Regional Reanalysis system Ridal et al., 2024, 27p.
This map of average windspeeds in 2016 was made from CERRA data, using python and numpy:

@denis-bz
denis-bz / 0-Lesswind-Moremoney.md
Last active May 20, 2026 15:30
EEG für Windräder: Je weniger Wind, desto mehr Geld 20 May 2026

EEG für Windräder: Je weniger Wind, desto mehr Geld

Keywords: wind-power low-wind Germany Bayern renewable-energy EEG Erneuerbare-Energie

Was, Bayern ist schwachwindig ? Kein Problem, Söder und Aiwanger holen einen ordentlichen Extrazuschlag raus:

22apr-lesswind-moreEEG

Wer bestimmt denn den Gütefaktor an einem Standort?

@denis-bz
denis-bz / 0-cosmo-newa-Germany.md
Last active February 20, 2026 16:57
Windspeeds at 175m in Germany, COSMO-REA6 and NEWA 20 Feb 2026

Windspeeds at 175m in Germany, COSMO-REA6 and NEWA

Keywords: wind-speed COSMO-REA6 NEWA Germany neweuropeanwindatlas reanalysis open-data python

I'm interested in windspeeds at 175m, the turbine height of many new wind turbines in Germany, Two sources of windspeed data in EUrope are

  1. https://opendata.DWD.de/.../COSMO_REA6: hourly, 1995 to 2018, 6 x 6 km grid
  2. NEWA, the New European Wind Atlas, 3 x 3 km grid.

What are good places to compare the two ?

@denis-bz
denis-bz / 0-spike-upsample.md
Last active October 28, 2025 11:58
Fourier upsamplng a spike: why is odd n so big ? 28 Oct 2025

Fourier upsamplng a spike: why is odd n so big ?

Keywords: resample upsample interpolate frequency-domain Fourier scipy

The problem:

28oct-spike-upsample
from scipy.signal import resample # in Fourier space
@denis-bz
denis-bz / 0-TSH.md
Last active October 14, 2025 16:42
TSH levels of 111 hypothyroid people over 70 14 Oct 2025

TSH levels of 111 hypothyroid people over 70: 26 % have TSH $\geq$ 4.0

TSH, Thyroid-stimulating_hormone, is measured in blood to determine a suitable dosage of L-thyroxine.

Is TSH 4.0 high ?

Wikipedia TSH gives "reference ranges" of $0.4 - 4.0$ μIU/mL.

@denis-bz
denis-bz / 0-scipy-ode-callback.md
Last active August 24, 2025 15:26
Callback to track and stop scipy solve_ivp 24 Aug 2025

Callback to track and stop scipy solve_ivp

Keywords: scipy solve_ivp callback ODE ordinary-differential-equation IVP initial-value-problem python

Purpose

add a callback function to the scipy ODE solver solve_ivp, so that you can

  • print progress at each timestep
  • tell the solver to stop if h is too small, or KeyboardInterrupt, or ... and return the sol so far.
@denis-bz
denis-bz / 0-Cosmopy.md
Last active April 23, 2024 15:02
Cosmopy: clip and regrid COSMO_REA6 wind data to python numpy
@denis-bz
denis-bz / mst-2011.md
Created July 17, 2023 12:53
mst.py unionfind.py from 2011

Old mst.py with Kruskal's algorithm

mst.py is simple old (2011) code for MSTs using Kruskal's algorithm -- see the animation there.

Kleinberg-Tardos:

single-link k-clustering == MST k-1 most expensive edges

but min( max spacing ), Theorem 1, may be wrong or at least odd for k-clustering ?

@denis-bz
denis-bz / 0-COSMO_REA6-ERA5-Bayern.md
Last active June 24, 2023 16:11
Windspeeds in Bayern, COSMO_REA6 vs. ERA5

Windspeeds in Bayern, COSMO_REA6 vs. ERA5

Here are plots of average windspeeds in Bayern in January 2018 at 100m,
COSMO_REA6 on its ~ 6 × 6 km grid
ERA5 on its 0.25° × 0.25° grid.
We see big differences over the Alps in the south and over hilly areas in north Bayern.

24jun-WS_100m 2D 201801

24jun-era5-bayern-201801-100m

@denis-bz
denis-bz / 0-ERA5-vs-globalwindatlas.md
Last active December 20, 2022 17:35
Wind speeds at 100m in Bayern, ERA5 vs. globalwindatlas 20 Dec 2022