Sunlit Fraction Calculation¶
This guide explains how EnergyAtlas computes the sunlit fraction arrays stored on each shading group or sensor shading record.
Related API References¶
- Python reference:
voxel_shading.calculate - Web reference:
POST /api/voxelShading/calculate - Result polling:
GET /api/voxelShading/job/{jobId},GET /api/voxelShading/result/{jobId}
Source Implementation¶
EnergyAtlasCore/VoxelShading/ShadingCalculation.csEnergyAtlasCore/VoxelShading/ShadingResult.csEnergyAtlasCore/Geometry/SolarGeometry.csEnergyAtlasLib/Preprocessing/TiledSensorShading.cs
Solar Direction Grid¶
ShadingCalculation.CalculateShading builds a representative-year sun direction matrix before testing sensors.
calcPerDay = 24 * TimeStep.calcPerYear = ceil(365 / CalcUpdateFreq).- For each update period,
RayMarchingDirectionGenaverages: - solar declination from
SolarGeometry.SUN3 - equation of time from
SolarGeometry.SUN3 - For each hour and sub-hour step,
SolarGeometry.SUN4returns a unit sun vector, ornullwhen the sun is below the horizon.
The matrix shape is:
1 | |
Per-Sensor Ray Test¶
CalculateShadingSingleSensor evaluates every non-null sun vector for one sensor.
- If
sunDirection dot sensorNormal < 0, skip it because the sun is behind the surface. - Shoot a ray from
ShadingSensor.Locationin the sun direction. - Ray-march through the voxel grid up to
CalculationRadius. - If ray marching returns no voxel hit, mark that matrix cell
true. - Otherwise leave it
false.
Group Aggregation¶
Each ShadingSensor has AreaSQM; each group is area-weighted.
1 2 3 | |
If SummarizeHourly is true, sub-hour values are averaged into 24 hourly values per representative day. The output ShadingResult.TimeStep is then 1.
Parameters¶
| Parameter | Default | Effect |
|---|---|---|
Latitude |
required API request value | Site latitude for sun vector generation. |
Longitude |
required API request value | Site longitude for sun vector generation. |
TimeZone |
optional | If omitted in the two-stage worker, defaults to round(longitude / 15). |
TimeStep |
6 |
Number of calculations per hour. Must divide 60. |
SummarizeHourly |
true |
Averages sub-hour results to hourly values. |
CalcUpdateFreq |
20 |
Days represented by each representative-day shading calculation. |
CalculationRadius |
500 |
Max ray-marching distance for occluder search. |
Outputs¶
| Output field | Meaning |
|---|---|
SunlitFraction |
Representative-day sunlit fraction array for the surface/sensor record. |
CalcUpdateFreq |
Number of days represented by each day slice. |
TimeStep |
Output steps per hour; 1 when summarized hourly. |
SkyViewFactor / HorizonViewFactor |
Present when diffuse calculations are enabled. |
Interpretation¶
The API shading result is not a direct radiation value. It is a geometric visibility result. Weather-file DNI/DHI and Perez sky components are applied later by Weather.ComputeAnnualIncidentRadiationFromShadingResult.