# CSR sun

### dayLength, noon, dawn, dusk

DayLength is calculated from the combination of latitude [0°..90°] and day number [1..365] (no account for leap years). Noon is set to 12.00 minus the time equation, however, for the benefit of comparability of models, the time equation in CSR's Sun is forced to zero. Dusk and dawn equal noon +/- half the day length.

### declination

The declination of the sun is the angle between the rays of the Sun and the plane of the Earth's equator. At the solstices, the declination reaches its maximum value of 23°26'. At the moment of each equinox, the center of the sun appears to pass through the celestial equator, and the declination is 0°.

### solar altitude

The solar altitude is the apparent angle between the horizon and the sun. It depends on the latitude, the declination and the time of the day.

sine of solar altitude
```hourangle   = self.RADperHOUR * (time + self.equation - 12.)
return        (sin(self.declination) * sin(self.latitude)
+ cos(self.declination) * cos(self.latitude)
* cos(hourangle))```

### atmospheric transmission factor

calculation
```def getAtmosphericTransmissionFactor(self, measuredGlobalRadiation, time = NOON):
"""
Use measured global radiation to determine the atmospheric transmission factor.
@return: fraction transmitted
"""
SINB    = self.sineOfSolarAltitude(time)

ATMTR  = (AVRAD * (1. + 0.4 * SINB)) / (self.solarConstant * self._DSINBE)
return ATMTR```

### fraction diffuse light

The fraction of scattered light within the total radiation can be calculated in a SIMPLE way, following the straight line models by Goudriaan & Van Laar (1994: p. 32), of by curvilinear models. Of both types paramitrizations exist for daily and hourly calculations. The former (daily) mode is chosen when the time-parameter is left to default:

Of the hourly modes, the standard from ForGro seems ill-behaved:

### PAR

The PAR is linear with global radiation and a sine function taking into account the solar altitude:

PAR
```SINB    = self.sineOfSolarAltitude(time)