Skip to content

Instantly share code, notes, and snippets.

@denis-bz
denis-bz / 0-ERA5-vs-globalwindatlas.md
Last active Dec 20, 2022
Wind speeds at 100m in Bayern, ERA5 vs. globalwindatlas 20 Dec 2022
View 0-ERA5-vs-globalwindatlas.md
@denis-bz
denis-bz / 0-Sun-wind-biomass-electricity-Germany.md
Last active Nov 17, 2022
How efficient are wind, sun, biomass in the German provinces in 2019 - 2020 13 Nov 2022
View 0-Sun-wind-biomass-electricity-Germany.md

How efficient are wind, sun, biomass in the German provinces in 2019 - 2020 ?

Keywords: Renewable energy, wind energy, electricity, Germany

Purpose: look at the efficiency of electricity produced in the German provinces from sun, wind and biomass, with files from official data:
LAK, real: https://www.lak-energiebilanzen.de 2019, Länderarbeitskreis Energiebilanzen Bruttostromerzeugung nach Erneuerbaren Energieträgern
BMWK, max 31.12.2020,

@denis-bz
denis-bz / 0-windspeeds-Netherlands-wikipedia-KNMI-GWA.md
Created Oct 31, 2022
Wind speeds and capacity factors in the Netherlands from wikipedia, KNMI and globalwindatlas 31 Oct 2022
View 0-windspeeds-Netherlands-wikipedia-KNMI-GWA.md

Windspeeds and capacity factors in the Netherlands from wikipedia, KNMI and globalwindatlas

Keywords: wind, wind farm, wind speed, capacity factor, onshore, Netherlands, globalwindatlas, GWA, KNMI

What I want to do is show my neighbors around Munich that windfarms make more sense where there's more wind. GWA has a nice GUI, which everyone can understand. But are their wind speed and capacity factors accurate enough to convince anyone ?

nl.wikipedia Windturbines_in_Nederland,

@denis-bz
denis-bz / 0-Introduction-to-Netherlands-wind-data-with-xarray.md
Created Aug 30, 2022
Introduction to Netherlands wind data with xarray
View 0-Introduction-to-Netherlands-wind-data-with-xarray.md

Introduction to Netherlands wind data with xarray

Keywords: Netherlands, wind, wind speed, KNMI, python, xarray, data-carpentry

Purpose: introduce Netherlands wind data from KNMI, the Royal Netherlands$ Meteorological Institute, with the steps:

  1. download 2 \.nc files by hand, one day and one gridpoint
  2. look at them in xarray
@denis-bz
denis-bz / 0-Windspeeds-and-windfarms-in-Bayern.md
Created Jul 23, 2022
Windspeeds and windfarms in Bayern 23 Jul 2022
View 0-Windspeeds-and-windfarms-in-Bayern.md

Windspeeds and windfarms in Bayern

Keywords: wind power, Germany, Bayern, globalwindatlas, GWA

Purpose: I'm trying to show my neighbors around Munich that windfarms make more sense where there's more wind. To this end, here's a map of GWA windspeeds at 150m, together with the sites of 202 windfarms in Bayern:

21jul-Bayern-windfarms

@denis-bz
denis-bz / 0-Poisson-matrices.md
Last active Jul 5, 2022
Poisson2 - 4 I: nice test matrices for linear solvers and eigensolvers 25 Jun 2022
View 0-Poisson-matrices.md

Poisson2 - 4 I: nice test matrices for linear solvers and eigensolvers

Purpose: a simple generator of test matrices for linear solvers and eigensolvers

Keywords: sparse-matrix, linear-solver, eigensolver, arpack, nullspace, python

poisson2( n ) below generates sparse $n^2 \ x \ n^2$ matrices $A$ with $A$ symmetric (aka Hermitian) and positive-definite; solving $A \ x = b$ is then relatively easy. $A_4 = A - 4 I$ is more interesting: there are $n$ vectors $z_i$

@denis-bz
denis-bz / ssquery.py
Created Jun 21, 2022
One-line queries of the SuiteSparse matrix collection 21 Jun 2022
View ssquery.py
#!/usr/bin/env python3
""" Usage:
python3 ssquery.py '(posdef == 1) & (1000 <= rows <= 20000)' posdef.csv
reads http://sparse.tamu.edu/files/ssstats.csv
queries it
writes "posdef.csv" like
# SuiteSparse posdef & (1000 <= rows <= 20000)
id,group,name,rows,cols,nnz,real,bool,is2d3d,posdef,symm,nsymm,kind
29156,Boeing,msc01050,1050,1050,26198,1,0,1,1,1.0,1.0,structural
@denis-bz
denis-bz / 0-HUSL-lch-is-not-CIELCh.md
Last active Mar 26, 2022
HUSL rgb_to_lch is not CIELCh
View 0-HUSL-lch-is-not-CIELCh.md

HUSL rgb_to_lch is for CIELuv, not CIELab

Keywords: color-space HUSL HSLuv CIELCh CIELuv CIELab max-chroma everyone-knows

Whenever something can be done in two ways, someone will be confused.

22mar-husl-wall-imshow2

There are two quite different color spaces: \

@denis-bz
denis-bz / 0-Windfarms-in-Germany.md
Last active Jul 23, 2022
Windfarms in Germany, from de.wikipedia 14 Nov 2021
View 0-Windfarms-in-Germany.md

Windfarms in Germany from de.wikipedia

Keywords: wind power, Germany, python, globalwindatlas

Purpose: collect data on wind farms in Germany in a single .csv file, from https://de.wikipedia.org/wiki/Liste_von_Windkraftanlagen_in_Bayern etc.

The file windfarms-in-Germany.csv looks like this:

MW MW/Rad Nrad Year N E Land Lkr Typ Ort

@denis-bz
denis-bz / 0-warp.md
Created Nov 7, 2021
Basic image warping or map reproject in python 7 Nov 2021
View 0-warp.md

Warping maps or images

Keywords: image raster resize rescale reproject Manhattan-grid regular-grid

We have a picture (image, raster) A, an array of colored pixels, and want to warp it to a new picture O of a different size or shape. Examples: Map projection, flat maps <-> globe; Image scaling.
There are hundreds of cases of these, and zillions of programs