Skip to content
SunAngle

Methodology & sources

Two calculations sit behind this site: where the sun is, and how much energy arrives. Here is exactly how each works and where it stops being reliable.

Sun position and event times

We implement the NOAA solar position algorithm. From a date we derive the sun's declination and the equation of time; combined with your latitude and longitude, those give solar noon and the hour angle at which the sun reaches any given elevation.

Event definitions follow the standard conventions: sunrise and sunset when the sun's centre is 0.833° below the horizon (accounting for atmospheric refraction and the sun's apparent radius), civil twilight at 6°, nautical at 12°, astronomical at 18°. Golden hour is 6° above to 4° below; blue hour 4° to 6° below.

No data is fetched and no table is looked up — the algorithm works for any coordinate and any date. Nothing about it needs maintaining, because orbital mechanics do not change.

Convergence at high latitudes

A naive implementation computes the sun's declination once at solar noon and uses it for the whole day. That is fine in the tropics and wrong near the poles, where the sun crosses the horizon at a shallow angle and a small declination error becomes minutes of time error. We iterate: estimate the event time, recompute the declination at that time, and repeat until it settles.

Verification

Astronomical code fails quietly — a wrong answer still looks like a plausible time. So the implementation is checked against an independent source across eight cities from the equator to 78° north, at the solstices and equinoxes. Agreement is within two minutes everywhere, three minutes in Reykjavik.

This check caught two real bugs during development: an incorrect azimuth denominator that put the midday sun 108° off, and the high-latitude convergence problem above. It also caught a third thing worth stating plainly — our first reference source was itself inaccurate. Cross-checking against a third source showed our implementation and the second reference agreeing to the minute, with the first diverging by up to eight minutes at high latitude because it uses a 1990 algorithm with a different refraction constant.

Solar irradiance and yield

Irradiance figures come from NASA POWER, which publishes 30-year climate averages of surface solar radiation derived from the MERRA-2 reanalysis and satellite observations. We use monthly means of global horizontal irradiance and its diffuse component.

Because these are long-term climatological averages rather than a live feed, they are baked into the site at build time as static data. There is no runtime API call, and no reason for the figures to drift year to year.

From horizontal to tilted

Panels are not flat, so horizontal irradiance has to be transposed onto the tilted plane. We use the isotropic sky model (Liu and Jordan), which treats the three components separately:

  • Direct beam — scaled by the ratio of the cosine of the incidence angle on the tilted plane to that on the horizontal, integrated over the daylight hours of a representative day for each month using our own sun position code.
  • Diffuse sky — scaled by how much of the sky dome the tilted panel sees.
  • Ground reflection — using a default albedo of 0.2.

The optimal tilt is then found by brute-force search over every angle from 0° to 90°, taking the one that maximises annual output. We deliberately do not use a latitude-based formula: those are regressions fitted to particular climates and drift where the diffuse fraction is different.

System output

A panel rated at 1 kWp produces 1 kW under 1,000 W/m². So tilted irradiance in kWh/m²/day multiplied by system size in kW gives daily kWh before losses. We apply a performance ratio of 0.78 to account for inverter and wiring losses, soiling and temperature — the middle of the 0.75–0.85 range typical of modern installations.

As a sanity check, the resulting specific yields are compared against published industry figures: roughly 1,600–1,900 kWh/kWp in the US Southwest and 900–1,100 in Germany and the UK. Our values land inside those ranges for every city.

What we do not model

  • Terrain and elevation. All sun times assume a flat horizon at sea level. Mountains, buildings and altitude all shift real sunrise and sunset.
  • Shading. A single tree or chimney can cost more than getting the tilt perfect. We assume an unshaded array.
  • Any specific year. Solar figures are 30-year averages. A cloudy year will come in below them and a clear one above.
  • Panel degradation, inverter clipping, snow cover, and local rules. These matter for a real installation and belong in an installer's quote, not here.
  • Solar yield outside the listed cities. Sun times work anywhere on Earth; irradiance data is only baked in for the cities we list.

Corrections

If a figure here disagrees with a source you trust, tell us and include the source. Being checkable is the point.