Outdoors
Sunrise Predictor
Ten-day sunrise and cloud inversion forecasts for UK hills, as a static site.
Is the early start worth it?
I wanted to know whether getting up before dawn would be worth the journey to a hill. A weather forecast supplies the ingredients, but a dry morning and a colourful sunrise are different questions. An inversion introduces another: whether cloud might sit below the summit rather than across the view.
Sunrise Predictor takes ten days of Open-Meteo forecasts for UK hills and ridges and scores sunrise quality separately from inversion conditions. Both results include their breakdown. The weights make the reasoning inspectable: a high total can be traced back to the conditions that earned it.
Give cloud layers different jobs
The sunrise model favours cloud for the light to catch while keeping the horizon clear. Its eight components total 100 points before bonuses:
High cloud contributes 23 points. Cover from 30 to 70 per cent earns all 23, while less than 10 per cent earns five and more than 90 per cent earns three.
Low cloud contributes 18 points, with full marks at 10 per cent or less and none above 50 per cent.
Total cloud contributes 14 points, favouring 30 to 70 per cent, while mid-level cloud contributes nine, favouring 20 to 50 per cent.
Precipitation contributes 14 points using both amount and probability. A probability below 10 per cent earns full marks; below 30 per cent with less than 0.5 mm earns 12.
Wind contributes nine points, dropping from nine below 10 km/h to zero at 40 km/h.
Light quality contributes eight points through the diffuse radiation ratio. The scorer also allocates five to air quality, favouring moderate particulates and assigning two when air-quality data is absent.
Clearing conditions can add 15 points. More than 2 mm of rain the previous day, followed by less than 0.5 mm and low cloud below 30 per cent, adds ten. A pressure rise above 5 hPa from a previous value below 1015 hPa adds five. The total is capped at 100, with Excellent beginning at 80 and Good at 65.
An inversion needs its own answer
The inversion model prioritises a still, stable atmosphere and conditions associated with fog formation. Wind has the largest weight, 20 points: below 5 km/h earns all 20, while 20 km/h or more earns zero. Sea-level pressure contributes 16 points, reaching full marks at 1025 hPa.
Visibility contributes 14 points in the opposite direction to a clear-view preference. Less than a kilometre earns full marks because the model treats fog as supporting evidence; ten kilometres or more earns none. Low CAPE, a measure of atmospheric instability, contributes up to ten points. A temperature and dew point spread of 2°C or less earns ten, as does overnight cloud cover of 20 per cent or less.
The remaining weights are eight for temperature increasing with height, six for declining visibility compared with the previous day, four for soil warmer than the air and two for precipitation. The height comparison uses temperature at 80 metres minus temperature at two metres: a difference of at least 2°C earns eight points. Location-specific wind directions can add up to six more, with the total again capped at 100.
These are separate models because their preferences differ. Fog can help the inversion score while obstructing the view. Combining everything into one attractive-morning score would conceal that distinction. The inversion result is a weighted score with likelihood labels, rather than a measured percentage probability.
Preserve the inputs and keep warnings visible
The processor samples the hour before sunrise, the sunrise hour and the hour after it, with overnight cloud taken from midnight through sunrise. Wind direction uses vector averaging so directions either side of north do not average to south. Precipitation amount comes from the daily total, an important detail when interpreting the score.
Warnings sit alongside the result. A freezing level at or below summit altitude triggers an ice warning. Wind warnings begin at 30 km/h and become very strong at 40 km/h. Visibility below five kilometres produces a warning, becoming dense fog below one kilometre. A high sunrise score does not cancel any of them.
Raw API data is archived separately from calculated scores, with an algorithm version attached. That allows historical inputs to be rescored when the rules change. The archive preserves forecasts, so rescoring can show how an algorithm changes its answers without establishing what actually happened on the hill.
Plain PHP generates static HTML from cached API responses. The output is served as files, leaving the forecasting and scoring work in the generator rather than requiring an application server for each visit.