Counting rain days in Cape Town: wet-season length, spells and a 1-day-per-decade decline
A 2022 study of Cape Town's 178-year rain record found fewer wet days since 1950. We rebuild its wet and dry spells with a simple model and ask with fibub's Weather log maths how hard such a decline is to see.
How many days does it rain? It sounds easy, but the answer depends on one choice: how much rain counts as a rain day. In Cape Town’s winter-rainfall climate, a 2022 study in Climate of the Past used daily records from four stations, the longest from the South African Astronomical Observatory (SAAO) since 1841, and counted a wet day as 1 mm or more. It found that wet days have been falling since the 1950s, by about 1 day per decade, and that the wet season has been getting shorter. We use the paper’s own numbers to check that its description of wet and dry spells hangs together, and then ask a question any home rain-gauge keeper can ask: how large must a decline be, and how long must the record be, before you can see it? For a daily log with rain days and monthly totals, use the weather observer's log; for a logger’s CSV, the weather station; and for the test of the trend itself, the trend analyser.
The paper in brief
The authors studied the wet season, April to October, which brings about three quarters of Cape Town’s annual rain, at four stations: SAAO (1841 to 2018), Maitland, Kirstenbosch and Cape Town International. For 1950 to 2018 the SAAO wet season averages 608 mm of rain on 55.6 wet days, and the all-station average is 57.4 wet days. Wet days fell by about 1 day per decade at SAAO and 1.1 at Maitland since 1950, and by 3.3 days per decade at SAAO from 1880 to 1940. Dry spells longer than 5 days have become more common, and the wet season has shortened by 1.4 days per decade since about 1940: late starts (after 15 April), early ends (before 18 October) or both. Wet spells are short (28 to 31 a season, 1.8 days on average) and dry spells last 4.4 to 5.6 days, up to 32 to 48 days at the longest. The paper links year-to-year changes to the Southern Oscillation, the Southern Annular Mode and the sunspot cycle; we do not test those.
Checked with the tools
Step 1: do the spell statistics hang together? Three numbers from the paper can be checked against each other: 55.6 wet days in a season of about 188 days, a mean wet spell of 1.8 days, and the count of wet spells. If wet days come in spells of average length 1.8 days, 55.6 wet days must be 55.6 / 1.8 = 30.9 spells, and the paper says 28 to 31. The days left over, 188 − 55.6 = 132.4, are split into about 31 dry spells of 4.29 days each, and the paper’s 4.4 to 5.6 days agrees at the low end. So the prose is consistent.
Step 2: a simple weather model. A two-state Markov chain says that whether tomorrow is wet depends only on whether today is. Our assumption is a chain fitted to just two of the paper’s numbers (55.6 wet days in 188; wet spells of 1.8 days): a wet day is followed by a dry one with probability 0.556, a dry day by a wet one with probability 0.233. Wet days get 1 mm plus an exponential amount so that the mean wet day is 10.9 mm (608 / 55.6). We then simulated 600 seasons, dated 14 April to 18 October, as daily log entries and summarised them with the Weather log’s monthly maths (rain days at or above a threshold, total rain). The model was fitted to two numbers and is compared with others:
| Quantity | Paper says (SAAO, 1950 to 2018) | Our model gives |
|---|---|---|
| Wet days per season | 55.6 | 55.5 (spread between seasons 7.5 days) |
| Rain per season | 608 mm | 603 mm |
| Wet spells per season | 28 to 31 | 31.0 |
| One-day wet spells | 16.5 (SD 4.17) | 17.3 (SD 3.87) |
| Two-day wet spells | 8.7 | 7.8 |
| Wet spells longer than 2 days | about 6 | 5.9 |
| Mean dry spell | 4.4 to 5.6 days | 4.28 days |
| Dry spells of 5 days or less | 21.7 | 23.4 |
| Dry spells of 6 days or more | about 10 | 8.1 |
| Longest dry spell in 69 seasons | 32 to 48 days | 31 days |
A memory-less chain reproduces the wet spells well, which is notable for a model with two parameters. It underestimates long dry spells slightly (8.1 against about 10, and the longest at 31 days against 32 to 48): real dry spells have a heavier tail than a chain with no memory, because blocking weather patterns can stay for weeks. This is a limit of our model, not a statement about the paper.
Step 3: which threshold? The count of “rain days” is not a fixed fact. With our simulated amounts the same seasons have 56 days at 1 mm or more, 36.4 days at 5 mm, 22.6 at 10 mm and 8.4 at 20 mm. The Weather log’s Rain day from box sets this threshold. The paper’s remark that days of 10 mm or more make up about 5 per cent of days, if it means days of the season, is below our 12 per cent (22.6 / 188), which suggests that real wet-day amounts are even more skewed than our exponential, or that the 5 per cent counts a different base. The paper’s text does not let us tell.
Step 4: how hard is a decline of 1 day per decade to find? Over 69 seasons, the paper’s 1 day per decade is 6.8 days, about 12 per cent of 55.6. But the seasons themselves differ by 7.5 days (one standard deviation) in our model. Figure 1 is one simulated 69-season record with a decline of 1 day per decade built in: the fitted line has a slope of only −0.32 days per decade and a t value of −0.62, because the noise swamps the trend. That is one draw. Figure 2 repeats it 600 times for each size of decline: with a true decline of 1 day per decade a one-sided 2.5 per cent least-squares test finds it in 57 per cent of records; with 1.5 days per decade, 88 per cent; with 2, 99 per cent. With no real decline, the test fires in 1.7 per cent of records, the expected false alarm rate. For a 30-season window with 1 day per decade, only 8 per cent find the decline. So a decline can be real and still hard to see in a short record, which is why 178 years of SAAO data matter.
How we made the graphs
The script scripts/blog-figures/cape-town-wet-season-rain-days-wet-spell-dry-spell-length-weather-log.mjs builds daily log entries and calls monthly(log, units, rainDay) from src/lib/sci/weatherlog.ts, the monthly summary maths of the weather observer's log tool, to count rain days and sum rain at thresholds of 1, 5, 10 and 20 mm. The trend simulations count wet days directly (checked against monthly on the same seasons) and fit least squares. The 1 mm wet day, 55.6 wet days, 188-day season, 608 mm, the spell statistics and the 1 day per decade come from the paper’s text. The Markov model, the exponential amounts, the seeds, the 69 seasons and the size of the declines tested are our assumptions. No figure or table from the paper is used.
How we test the maths
tests/sci.mjs runs tests/sci-tools/weather-log.mjs on every change; it compares month means, totals, rain days, frost days and records with pandas on 630 random days with gaps. For this article we added a check on ten small daily entries (the CSV below): at a rain-day threshold of 1, 5 and 10 mm the month has 4, 2 and 1 rain days, a total of 24.2 mm and a mean temperature of 13.265 degrees.
Check it yourself
On the weather observer's log page, paste this into Days to import under Import and export, with the units left at °C and mm, and press Add to my log:
Date,Max temp,Min temp,Rain
2026-06-01,17.5,9.0,0
2026-06-02,16.0,10.5,0.4
2026-06-03,14.8,11.0,3.2
2026-06-04,15.5,10.0,12.6
2026-06-05,16.2,9.5,1.0
2026-06-06,18.0,8.0,0
2026-06-07,19.1,7.5,0
2026-06-08,17.0,10.2,6.8
2026-06-09,15.9,11.4,0.2
2026-06-10,18.3,9.9,0
- With Rain day from at 1, June shows 4 rain days, 24.2 mm of rain and a mean temperature of about 13.3 °C (13.265 before the page rounds to one decimal) (maximum and minimum averaged day by day).
- Change Rain day from to 5: 2 rain days. Change it to 10: 1 rain day. The rain total stays at 24.2 mm.
- Look at the dates by hand: days 3, 4 and 5 form one wet spell of 3 days at the 1 mm threshold, day 8 is a one-day spell, so there are 2 wet spells and 3 dry spells (days 1 and 2, 6 and 7, 9 and 10). The tool counts days, not spells; the spell count is your own check against it.
What researchers can use it for
- Choosing a wet-day threshold: show how the rain-day count of one record changes from 0.1 to 1 to 10 mm before comparing stations or papers.
- Sanity-checking spell statistics: season length, number of spells and mean spell length are linked (days = spells × length); a table that breaks the link has a mistake or uses a different definition.
- Planning a rain-gauge record: before starting, estimate how many seasons of a given scatter are needed to see a change of a given size.
- Teaching: a two-parameter weather model and a spreadsheet of wet days are enough to explain persistence, thresholds and trend tests.
The fine print
- The paper’s tables were not available to us as text. We used only numbers from its abstract and prose, and it reports several of them for different periods and stations; we matched them to the SAAO 1950 to 2018 values as best its text allows.
- Our Markov chain has no seasonal cycle inside the wet season, no link between years and no heavy tail, so it understates long dry spells, and its seasonal totals follow our exponential amounts, not the real ones.
- The detection rates depend on our assumed scatter between seasons (7.5 days). The real scatter, including the influence of climate cycles the paper discusses, may be larger or smaller.
- We do not test the paper’s links to the Southern Oscillation, the Southern Annular Mode or sunspots.
Sources
- Ndebele NE, Grab S and Hove H (2022), Wet season rainfall characteristics and temporal changes for Cape Town, South Africa, 1841-2018, Climate of the Past 18: 2463-2482, doi:10.5194/cp-18-2463-2022. Licence CC BY 4.0, checked on the Copernicus page and in Crossref (no correction or retraction listed), 2026-11-24. Values used from the text (the SAAO station, 1950-2018 unless noted): a wet day is 1 mm or more; 55.6 wet days and 608 mm per wet season (April to October, about 188 days); wet spells 28 to 31 per season of average length 1.8 days; 16.5 one-day wet spells (SD 4.17), 8.7 two-day and about 6 longer; average dry spell 4.4 to 5.6 days; 21.7 short (5 days or less) and 10 long (6 days or more) dry spells; longest dry spells 32 to 48 days over the record; a decline of 1 wet day per decade. The paper's tables were not available to us as text; we use its abstract and prose only.
- Two-state (wet or dry) Markov chain for daily rain occurrence and ordinary least-squares trend with a t test: standard methods in stochastic weather generators and statistics texts.
- The Markov model, the exponential wet-day amounts, the 69 seasons, the random seeds and the size of the trend in our tests are our assumptions. No figure or data table from the paper is used.
If you are an author or publisher and want a credit or a passage changed or removed, tell us and we will act quickly.