Sky models
Index
SkyDomes.CIESkyDomes.StandardSkySkyDomes.UniformSkySkyDomes.clear_skySkyDomes.cloudy_skySkyDomes.daily_radiationSkyDomes.equal_angle_intervalsSkyDomes.equal_solid_anglesSkyDomes.radiositySkyDomes.radiositySkyDomes.skySkyDomes.waveband_conversion
Public API
SkyDomes.CIE — MethodCIE(;type = 1, θₛ = 0.0, Φₛ = 0.0, rtol = sqrt(eps(Float64)), atol = 0.0,maxevals = typemax(Int))
Create a standard CIE model of sky diffuse radiance on the horizontal plane as described by Darula and Kittler (2002). The argument type can have values from 1 to 15 representing the 15 standard CIE models. θₛ and Φₛ are the zenith and azimuth angles of the solar disc. rtol and atol and maxevals are the relative tolerance, absolute tolerance and maximum number of function evaluation of the numerical integration algorithm. See package documentation for details.
SkyDomes.StandardSky — TypeStandardSky()Standard model of overcast sky diffuse radiation Moon & Spencer (1942). See package documentation for details.
SkyDomes.UniformSky — TypeUniformSky()Model of uniform sky diffuse radiation. See package documentation for details.
SkyDomes.clear_sky — Methodclear_sky(;lat, DOY, t, altitude = 0.0, TL = 4.0)Calculate global, direct and diffuse solar radiation on the horizontal plane using the clear sky model by Ineichen and Perez (2002).
Arguments
lat: latitude in radiansDOY: day of yearf: fraction of the day (0 = sunrise, 1 = sunset)altitude: altitude above sea level in meters (default 0.0)TL: Linke turbidity coefficient (default 4.0)
Returns
A named tuple with fields:
Ig: global solar radiation on the horizontal plane in W/m^2Idir: direct solar radiation on the horizontal plane in W/m^2Idif: diffuse solar radiation on the horizontal plane in W/m^2theta: solar zenith angle in radiansphi: solar azimuth angle in radians
References
Ineichen P., Perez R., A new airmass independent formulation for the Linke turbidity coefficient, Solar Energy, Vol 73(3), pp.151–157, 2002.
SkyDomes.cloudy_sky — Methodcloudy_sky(; Ig, Iday, lat, DOY, f)Calculate global, direct and diffuse solar radiation on the horizontal plane using the cloudy sky model by Spitters et al (1986) using either observed values of solar radiation (Ig, not on a daily scale) or a named tuple with daily radiation values (see daily radiation()).
Details
When using Igas input, the equations to compute the fraction of incoming radiation that is diffuse were originally developed for hourly solar radiation levels. When usingIday` the assumption is that the relative temporal patterns for the different forms of solar radiation (total, diffuse or extraterrestrial) are the same.
Arguments
Ig: Observed global solar radiation on the horizontal plane in W/m^2Iday: Named tuple with daily radiation valueslat: latitude in radiansDOY: day of yearf: fraction of the day (0 = sunrise, 1 = sunset)
Returns
A named tuple with fields:
Ig: global solar radiation on the horizontal plane in W/m^2Idir: direct solar radiation on the horizontal plane in W/m^2Idif: diffuse solar radiation on the horizontal plane in W/m^2theta: solar zenith angle in radiansphi: solar azimuth angle in radians
References
Spitters CJ, Toussaint HA, Goudriaan J. Separating the diffuse and direct component of global radiation and its implications for modeling canopy photosynthesis Part I. Components of incoming radiation. Agricultural and Forest Meteorology Vol 38(1-3), pp. 217-29, 1986.
SkyDomes.daily_radiation — Methoddaily_radiation(; lat, DOY, Igd = nothing)Calculate extraterrestrial, global, direct and diffuse solar radiation on the horizontal plane on a daily basis. If observed values of global solar radiation are observed (Igd) the equations by Spitters et al (1986) will be used to compute the partitioning between diffuse and direct solar radiation. If not provided, it will be assume that Igd is 75% of the extraterrestrial solar radiationa and that 23% of the global radiation is diffuse (this corresponds to a clear sky).
Arguments
lat: latitude in radiansDOY: day of yearIgd: Observed daily global solar radiation on the horizontal plane in J/m^2 (NOT MJ/m2)
Returns
A named tuple with fields:
Iod: daily extraterestrial solar radiation on the horizontal plane in J/m^2Igd: daily global solar radiation on the horizontal plane in J/m^2Idir: daily direct solar radiation on the horizontal plane in J/m^2Idif: daily diffuse solar radiation on the horizontal plane in J/m^2
References
Spitters CJ, Toussaint HA, Goudriaan J. Separating the diffuse and direct component of global radiation and its implications for modeling canopy photosynthesis Part I. Components of incoming radiation. Agricultural and Forest Meteorology Vol 38(1-3), pp. 217-29, 1986.
SkyDomes.equal_angle_intervals — Methodequal_angle_intervals(ntheta, nphi)Discretize the sky into ntheta zenith rings of nphi sectors each assuming the same angle intervals for each sector (Δθ = π/2/ntheta and ΔΦ = 2π/nphi). Returns an object of type SkySectors. See package documentation for details.
SkyDomes.equal_solid_angles — Methodequal_solid_angles (ntheta, nphi)Discretize the sky into ntheta zenith rings and a number of sectors per ring that is proportional to sin(θ). The total number of sectors will be ntheta*nphi. Returns an object of type SkySectors. See package documentation for details.
SkyDomes.radiosity — Methodradiosity(m::StandardSky, sky::SkySectors, Idif::SVector{nw, Float64})Calculate the radiosity of each section of sky on the horizontal plane given diffuse irradiance on the horizontal plane (Idif with nw wavebands) assuming a Standard Sky model and for nw wavebands. See package documentation for details.
SkyDomes.radiosity — Methodradiosity(m::UniformSky, sky::SkySectors, Idif::SVector{nw, Float64}) where nwCalculate the radiosity of each section of sky on the horizontal plane given diffuse irradiance on the horizontal plane (Idif with nw wavebands) assuming a Uniform Sky model. See package documentation for details.
SkyDomes.sky — Methodsky(mesh; Idir = 0.77, nrays_dir = 100_000, theta_dir = 0.0, phi_dir = 0.0,
Idif = 0.23, nrays_dif = 1_000_000, sky_model = StandardSky,
dome_method = equal_solid_angles, ntheta = 9, nphi = 12,
kwargs...)Create a vector of directional radiation sources representing diffuse and direct solar radiation for a given mesh.
Arguments
mesh: AMeshobject generated by VPL.Idir: The direct solar radiation measured on the horizontal plane (a single value or tuple).nrays_dir: The number of rays to be generated for direct solar radiation.theta_dir: The zenith angle of the sun position (radians).phi_dir: The azimuthal angle of the sun position (radians).Idif: The diffuse solar radiation measured on the horizontal plane (a single value or tuple).nrays_dif: The total number of rays to be generated diffuse solar radiation.sky_model: The angular distribution of diffuse irradiance (StandardSky,UniformSkyorCIE).dome_method: The method to discretize hemisphere into patches for diffuse solar radiation (equal_solid_anglesorequal_angle_intervals).ntheta: The number of divisions along the zenith angle fordome_method.nphi: The number of divisions along the azimuthal angle fordome_method.kwargs...: Additional arguments to be used whendome_method = CIE
Returns
A vector of directional sources that can be used for ray tracing calculations in VPL. ```
SkyDomes.waveband_conversion — Methodwaveband_conversion(;Itype = :direct, waveband = :PAR, mode = :power)Returns the conversion coefficient from solar radiation (W/m2) to a give waveband in either power (W/m2) or photon flux (umol/m2/s). The coefficients are based on the Bird spectral model for a clear sky using June 21th in The Netherlands (latitude 52° N).
Arguments
Itype: The type of solar radiation, either:director:diffuse.waveband: The waveband of interest, one of:PAR,:UV,:blue,:red,:green, or:NIR.mode: The physical units of the target, either:power(W/m^2) or:flux(umol/m^2/s).
Examples
waveband_conversion(Itype = :diffuse, waveband = :UV, mode = :flux)
waveband_conversion(waveband = :NIR)Private
Private functions, types or constants from SkyDomes. These are not exported, so you need to prefix the function name with SkyDomes. to access them. Also bear in mind that these are not part of the public API, so they may change without notice.