## Introduction

Whilst trying to validate my implementation of the CIE Standard General Sky equations in my CIE Sky Generator web app, I noticed that there was always a small but significant difference in the values of relative sky illuminance when directly compared with results from other popular tools such as Radiance, DaySim and HoneyBee. Looking closely at their source code, it appears that they are all based on the Perez All-Weather Sky equations given in the original paper published in 1993 (Ref.1). However, those equations are slightly different from the ones adopted for calculating the CIE Standard General Sky in ISO 15469:2004(E) and CIE S 011/E:2003.

The equations used in the ISO/CIE standard are actually based on those described by Kittler, Perez and Darula in 1997 (Ref.2). These equations include an additional modifier in the relative scattering indicatrix that is not present in Perez’s original All-Weather Sky model. Figure 2 shows the sequence of equations from the ISO/CIE standard, with the additional modifier highlighted in yellow.

**Figure 1: **
An extract showing the equations given in ISO 15469:2004(E) and CIE S 011/E:2003, with this additional modifier highlighted in yellow.

For direct comparison, the original Perez All-Weather Sky model equations are shown in Figure 2. The top line is equivalent to Equation 5 in Figure 1 and the bottom line is equivalent to Equation 7.

**Figure 2: **
An extract showing the equations given in Perez's original All-Weather Sky model in 1993.

## Background

It’s quite interesting to look back through the source code of tools like Radiance, DaySim, HoneyBee and Helios32 as you can really start to see patterns and relationships between the various code bases. From what I can see, it appears that all of the relevant sky luminance distribution code derives from an early version of `gendaylit.c`

written for Radiance by Jean-Jacques Delaunay back in 1994. This appears to have been generally available, but only added to the Radiance core distribution in 2009 (see CVS log).

As explained in the file header, that original code served as the basis for the daylight calculations in Helios32 that byHeart Consultants developed from 2001 to 2009. That Helios32 code then served as the basis for `gendaymtx.c`

written for Radiance by Greg Ward in 2013, and the subsequent DaySim and HoneyBee codes.

Thus, it makes sense that these tools all use the old equations as the Delaunay code was written well before the new ISO/CIE standard and a couple of years before Kittler, Perez and Darula introduced the modified equations.

## Implication

It appears that none of the code in these tools has ever been updated to use the ISO/CIE standard equations. The code blocks shown below are direct extracts from their current code bases. To be fair, most of these tools do only mention that they implement the Perez All-Weather Sky model, but there are a growing number of forum threads discussing how to use them to simulate the 15 CIE Standard General Skies as well as several research papers that use them for climate-based daylight modelling and reference the ISO/CIE standard.

#### Radiance: gendaylit.c

```
return (1 + c_perez[0]*exp(c_perez[1]/cos(dzeta)) ) *
(1 + c_perez[2]*exp(c_perez[3]*gamma) +
c_perez[4]*cos(gamma)*cos(gamma) );
```

#### HoneyBee: gendaylit.py

```
return (1 + c_perez[0] * math.exp(c_perez[1] / math.cos(dzeta))) * \
(1 + c_perez[2] * math.exp(c_perez[3] * gamma) +
c_perez[4] * math.cos(gamma) * math.cos(gamma))
```

#### Helios32: H32_gendaylit.cpp

```
// Calculate relative luminance
//
// Reference: Perez, R., R. Seals, and J. Michalsky. 1993.
// “All-Weather Model for Sky Luminance Distribution -
// Preliminary Configuration and Validation,” Solar Energy
// 50(3):235-245, Eqn. 1.
//
double CalcRelLuminance( double gamma, double zeta )
{
return (1.0 + perez_param[0] * exp(perez_param[1] / cos(zeta))) *
(1.0 + perez_param[2] * exp(perez_param[3] * gamma) +
perez_param[4] * cos(gamma) * cos(gamma));
}
```

#### Radiance: gendaymtx.c

```
/* Reference: Perez, R., R. Seals, and J. Michalsky. 1993. */
/* All-Weather Model for Sky Luminance Distribution - */
/* Preliminary Configuration and Validation, Solar Energy */
/* 50(3):235-245, Eqn. 1. */
double CalcRelLuminance( double gamma, double zeta )
{
return (1.0 + perez_param[0] * exp(perez_param[1] / cos(zeta))) *
(1.0 + perez_param[2] * exp(perez_param[3] * gamma) +
perez_param[4] * cos(gamma) * cos(gamma));
}
```

## References

Perez, R., Seals, R., and Michalsky, J.

**All-weather model for sky luminance distribution.**Solar Energy, 50:3, pp235-245, 1993.Kittler, R., Perez, R. and Darula, S.

**A new generation of sky standards.**Proc. Lux Europa Conf., pp359-373, 1997.Darula S, Kittler R.,

**CIE general sky standard defining luminance distributions**, Proc. Conf. eSim 2002, Montreal, Canada.