Healthy Weather

The Science behind the App

Sun, UV & Vitamin D

This page documents how the app calculates the vitamin D part of its numbers, what science backs each step, and how accurate the results are. The goal is full transparency.

Where the data comes from

All weather, UV, and air quality data comes from Open-Meteo (commercial tier; open-meteo.com), an open-source weather API that aggregates outputs from multiple national meteorological models.

The UV Index (UVI) returned by Open-Meteo is itself a model output, computed from total column ozone, cloud cover, aerosols, and solar position. It represents the erythemal (sunburn-weighted) UV irradiance at the surface.

Solar altitude — the sun’s angle above the horizon at your location — is computed from your coordinates and the current time using the NREL Solar Position Algorithm.

Step 1: From UVI to vitamin D potential (VDI)

UVI is weighted across the UVA and UVB spectrum, but vitamin D synthesis only responds to UVB (280–315 nm). UVB is absorbed by stratospheric ozone far more strongly than UVA, and the path through ozone gets longer when the sun is low in the sky (the air mass is greater). So at low sun angles, UVI overestimates the vitamin-D-relevant UV reaching your skin.

To correct for this, we compute a Vitamin D Index (VDI) that converts erythemal UVI into a vitamin-D-weighted equivalent. VDI is custom to Healthy Weather — it’s not a standardized metric used elsewhere. We designed it specifically to give users a single number that represents “how good is the sun right now for making vitamin D”:

air_mass = 1 / sin(solar_altitude)
VDI = (UVI / 3.0) × exp(-0.25 × (air_mass - 1))

The exponential term applies a Beer-Lambert correction for differential ozone absorption between UVA and UVB. The constant 0.25 is fit to the empirical data in McKenzie, Liley & Björn (2009), “UV Radiation: Balancing Risks and Benefits,” Photochemistry and Photobiology 85(1):88–98 — specifically Figure 4b, which shows the UVvitD/UVery ratio as a function of solar zenith angle at 300 Dobson Units of total column ozone.

The scale we chose: VDI is anchored so that VDI = 1 corresponds to UVI 3 with the sun directly overhead — roughly the threshold above which meaningful vitamin D synthesis begins in fair skin. We deliberately kept the formula continuous below that threshold rather than clipping to zero, because some minimal synthesis genuinely does occur at lower irradiances and we wanted to reflect that honestly.

Typical range: VDI runs from 0 to about 3.5. Values of 0.5–1 indicate marginal conditions, 1–2 is good for vitamin D production, and 2+ is strong. VDI returns 0 below 15° solar altitude or at UVI 0 — below this threshold the atmospheric path is long enough that essentially no UVB reaches the surface, consistent with the “vitamin D winter” observation in Webb, Kline & Holick (1988), Influence of Season and Latitude on the Cutaneous Synthesis of Vitamin D3, Journal of Clinical Endocrinology & Metabolism 67:373–378.

Step 2: Cloud cover override

VDI as described above is what the app displays by default everywhere — based on the live UVI from Open-Meteo, which already incorporates modeled cloud cover.

When you start a tracking session, the app offers a manual cloud override. This is useful when the model’s cloud forecast doesn’t match what you actually see at your location (the model works on a grid; your spot is a single point). In override mode, the app uses Open-Meteo’s clear-sky UVI for VDI and applies your cloud setting separately as an attenuation factor:

cloud_factor = 1 - cloud_cover × 0.6

The 0.6 coefficient means a fully overcast sky still passes 40% of UVB — clouds attenuate but don’t block UV completely.

Step 3: From VDI to personal vitamin D synthesis

VDI is an environmental quantity. To convert it to vitamin D actually produced in your skin, the app multiplies by a synthesis factor that captures four personal variables.

synthesis_factor = skin_factor × age_factor × exposure_factor × sunscreen_factor

Skin type

Cutaneous vitamin D synthesis depends strongly on melanin content, since melanin absorbs UVB before it can reach the 7-dehydrocholesterol that becomes vitamin D3. The app uses these factors for Fitzpatrick types I through VI:

[1.1, 1.0, 0.7, 0.5, 0.35, 0.25]

Type II is the reference (factor 1.0). The relative differences are based on:

Older models often use a steeper penalty for darker skin types. We use the flatter vector to better reflect the post-2010 evidence that melanin’s effect on D3 synthesis is less severe when normalized to UV dose received at the skin.

Age

The concentration of 7-dehydrocholesterol — the precursor molecule that converts to vitamin D3 — declines with age. The app uses:

age_factor = max(0.4, 1 - 0.01 × max(0, age - 20))

This implements roughly a 1% per year decline starting at age 20, with a floor at 40% of peak production. At age 70 the factor is 0.5, matching the approximately 50% reduction reported in MacLaughlin & Holick (1985), Aging Decreases the Capacity of Human Skin to Produce Vitamin D3, Journal of Clinical Investigation 76(4):1536–1538. More recent work (Wagner et al. 2020, Vitamin D Synthesis Following a Single Bout of Sun Exposure in Older and Younger Men and Women, Nutrients 12(8):2237) suggests the slope may be gentler in healthy free-living elderly adults, but the MacLaughlin/Holick decline remains the reference value used in most photobiology models.

Exposed body surface area

Linear with body surface area exposed: 50% exposed = half synthesis. The app uses approximate body surface area (BSA) percentages based on the Wallace rule of nines:

These are approximations. Individual variation in clothing fit and BSA proportions can shift these by ±10%.

Sunscreen

Sunscreen labeled SPF 30 blocks ~97% of UVB at the application thickness used in lab testing (2 mg/cm²). But people typically apply 25–50% of that thickness in real use, and coverage is often patchy, so real-world UVB blocking is much lower than the SPF number implies. The app offers four levels:

Setting Factor Description
None 1.0 No sunscreen
Light 0.7 Spotty coverage, partially worn off, low SPF
Normal 0.4 Recently applied, decent coverage — typical real use
Diligent 0.2 Just applied, full coverage, generous amount, SPF 30+

The factor values are based on:

From synthesis factor to IU per minute

The final calculation is:

iu_per_min = VDI × synthesis_factor × calibration_constant

The calibration constant is 290. It’s anchored to the experimental finding in McKenzie, Liley & Björn (2009): at UVI 10 with the sun overhead, full body exposure, and Fitzpatrick type II skin, cutaneous D3 production is approximately 1000 IU per minute. Solving for the constant:

1000 = (10/3) × 1.0 × 1.0 × 1.0 × 1.0 × C   →   C ≈ 300

Cross-validated against:

These three independent literature anchors give a defensible calibration range of C ≈ 190–300, and we use 290 as a slight conservative bias toward the McKenzie experimental anchor.

Saturation

Vitamin D synthesis in skin doesn’t continue indefinitely with longer sun exposure. The pre-vitamin D3 in your skin reaches photochemical equilibrium with its inactive isomers (lumisterol and tachysterol) at roughly 10–20% conversion of available 7-dehydrocholesterol. Past this point, additional UVB exposure produces no additional vitamin D — only sunburn.

This is documented in Holick, MacLaughlin & Doppelt (1981), Regulation of Cutaneous Previtamin D3 Photosynthesis in Man: Skin Pigment Is Not an Essential Regulator, Science 211(4482):590–593, and refined in subsequent work by Holick and Webb.

The app tracks cumulative IU and applies a soft saturation cap during sessions. Ceiling values used:

saturation_ceiling = 15,000 × skin_factor × exposure_factor

For a Fitzpatrick II in swimwear this gives ~12,000 IU before saturation, reached in ~15–20 minutes at UVI 7. As you approach saturation, the displayed IU/min tapers smoothly to zero. The app shows a saturation indicator above 50% to signal that further sun exposure won’t add to your vitamin D production.

Accuracy

The app targets ±15% accuracy in typical conditions and ±20% across realistic ranges.

What this means in practice:

The app does not currently model:

We may add these in future versions if validation against real measurements suggests they materially improve accuracy.

What the app cannot tell you

The IU number the app shows is estimated cutaneous vitamin D3 production, not your blood level (serum 25-hydroxyvitamin D). Converting between the two depends on body fat percentage (vitamin D is fat-soluble and gets sequestered in adipose tissue), liver and kidney function, your starting baseline level, and dietary vitamin D intake. The app does not estimate serum levels.

If you have specific medical concerns about your vitamin D status, the only reliable measurement is a blood test ordered by a physician.

References

The complete bibliography for this page:

  1. McKenzie RL, Liley JB, Björn LO. UV Radiation: Balancing Risks and Benefits. Photochem Photobiol 2009;85(1):88–98.
  2. Webb AR, Kline L, Holick MF. Influence of Season and Latitude on the Cutaneous Synthesis of Vitamin D3. J Clin Endocrinol Metab 1988;67:373–378.
  3. Webb AR, Engelsen O. Calculated Ultraviolet Exposure Levels for a Healthy Vitamin D Status. Photochem Photobiol 2006;82:1697–1703.
  4. Holick MF. Vitamin D Deficiency. N Engl J Med 2007;357:266–281.
  5. Clemens TL, Adams JS, Henderson SL, Holick MF. Increased Skin Pigment Reduces the Capacity of Skin to Synthesise Vitamin D3. Lancet 1982;1(8263):74–76.
  6. MacLaughlin J, Holick MF. Aging Decreases the Capacity of Human Skin to Produce Vitamin D3. J Clin Invest 1985;76(4):1536–1538.
  7. Holick MF, MacLaughlin JA, Doppelt SH. Regulation of Cutaneous Previtamin D3 Photosynthesis in Man: Skin Pigment Is Not an Essential Regulator. Science 1981;211(4482):590–593.
  8. Matsuoka LY, Ide L, Wortsman J, MacLaughlin JA, Holick MF. Sunscreens Suppress Cutaneous Vitamin D3 Synthesis. J Clin Endocrinol Metab 1987;64:1165–1168.
  9. Faurschou A, Beyer DM, Schmedes A, Bogh MK, Philipsen PA, Wulf HC. The Relation Between Sunscreen Layer Thickness and Vitamin D Production after Ultraviolet B Exposure. Br J Dermatol 2012;167:391–395.
  10. Petersen B, Wulf HC. Application of Sunscreen — Theory and Reality. Photodermatol Photoimmunol Photomed 2014;30:96–101.
  11. Bogh MK, Schmedes AV, Philipsen PA, Thieden E, Wulf HC. Vitamin D Production after UVB Exposure Depends on Baseline Vitamin D and Total Cholesterol but Not on Skin Pigmentation. J Invest Dermatol 2010;130:546–553.
  12. Wagner CL et al. Vitamin D Synthesis Following a Single Bout of Sun Exposure in Older and Younger Men and Women. Nutrients 2020;12(8):2237.
  13. Young AR et al. Optimal Sunscreen Use During a Sun Holiday with a Very High Ultraviolet Index Allows Vitamin D Synthesis Without Sunburn. Br J Dermatol 2019.

If you have questions or spot something wrong, please reach out via our support page.