windtab WAsP .tab viewer ← App

Documentation windtab

windtab reads WAsP Observed Wind Climate files (.tab) and produces a wind rose, Weibull fits per sector, a joint probability heatmap, and a sector statistics table. The formulas behind each panel are below.

Privacy & data handling

Your files never leave your browser. windtab runs entirely client-side: no server, no upload, no analytics.

When you load a .tab file, the browser reads it from disk using the File API and runs all parsing and calculation locally. Nothing reaches the network. Close the tab and the data is gone.

Coordinates, site names, and frequency tables stay on your machine. Safe for commercially sensitive wind resource data.

File format

WAsP Observed Wind Climate files are plain text:

Line 1: Site name
Line 2: x_coord   y_coord   height_m
Line 3: n_sectors   speed_scale   direction_offset
Line 4: sector_frequencies...  (space-separated, %)
Line 5+: speed_bin   freq[0]   freq[1]   ...   freq[n−1]  (per-mille, within-sector conditional)

speed_scale multiplies every speed bin value. direction_offset shifts all sector centre angles. Frequencies on line 5+ are conditional on wind direction: how often each speed class occurs given that sector, in parts per thousand. They need not sum to 1000 across sectors.

Wind rose

Each petal's length is the joint probability of that direction sector and speed class occurring together:

Joint probability $$p(i,j) = \frac{f_{ij}}{1000} \times \frac{F_j}{100}$$

fij is the within-sector conditional frequency (per mille) for speed bin i in sector j; Fj is the sector frequency (%). Values sum to 1 across all bins and sectors.

Energy proxy mode weights each petal by speed³, proportional to kinetic energy flux, and more informative than raw frequency for identifying which sectors drive wind resource.

Weibull distribution

Each sector is fitted to a two-parameter Weibull. The PDF:

Weibull PDF $$f(x;\,A,k) = \frac{k}{A}\left(\frac{x}{A}\right)^{k-1}\exp\!\left(-\left(\frac{x}{A}\right)^{k}\right), \quad x > 0$$

A (scale, m/s) sets the characteristic speed; the mean is $A\,\Gamma(1+1/k)$. k (shape) controls the spread; k near 2 is typical for wind, higher k means more concentrated.

Four fitting methods are available in the sector panel. Use the checkboxes to overlay and compare their curves. Weights $w_i$ are within-sector frequencies divided by 1000 in all methods; zero-weight bins are excluded.

Method 1 — Maximum Likelihood (MLE)

Maximises the weighted log-likelihood. The shape k is the root of:

MLE condition — solve g(k) = 0 $$g(k) = \frac{1}{k} + \frac{\sum w_i \ln x_i}{\sum w_i} - \frac{\sum w_i x_i^k \ln x_i}{\sum w_i x_i^k} = 0$$

Solved by Newton-Raphson from $k_0 = 2$ (stops when $|\Delta k| < 10^{-10}$ or after 200 iterations). Scale A in closed form once k converges:

MLE — scale parameter A $$A = \left(\frac{\sum w_i x_i^k}{\sum w_i}\right)^{1/k}$$

Method 2 — Method of Moments

Matches the first two moments of the distribution to the weighted mean $\mu$ and variance $\sigma^2$ of the data. The Weibull moments satisfy:

MoM — moment ratio equation $$\frac{\Gamma(1+2/k)}{\Gamma(1+1/k)^2} = 1 + \left(\frac{\sigma}{\mu}\right)^2$$

The left side is monotone decreasing in k, so k is found by bisection. Then $A = \mu\,/\,\Gamma(1+1/k)$. $\Gamma$ is evaluated using the Lanczos approximation.

Method 3 — Least Squares (Weibull Probability Plot)

Linearises the Weibull CDF. The empirical CDF is built from cumulative bin weights (midpoint assignment per bin). The Weibull CDF $F(x) = 1 - e^{-(x/A)^k}$ linearises as:

Least Squares — linear transform $$Y = \ln(-\ln(1-F)),\quad X = \ln x \quad\Rightarrow\quad Y = k\,X - k\ln A$$

Weighted OLS regression gives slope $k$ and intercept $b = -k\ln A$, so $A = e^{-b/k}$. Bins where $F \le 0$ or $F \ge 1$ are excluded.

Method 4 — Justus Empirical

A closed-form approximation (Justus et al. 1978) based on the coefficient of variation:

Justus — shape and scale $$k \approx \left(\frac{\sigma}{\mu}\right)^{-1.086}, \qquad A = \frac{\mu}{\Gamma(1+1/k)}$$

Fast to compute; best suited to distributions close to Weibull. May diverge from MLE when the data are skewed or multimodal.

Joint probability heatmap

The heatmap is the same p(i, j) matrix as the wind rose, with direction on the x-axis, speed on the y-axis, values in %. Clicking a column syncs the sector selection across all panels.